Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert to default #60

Closed
andia89 opened this issue Jul 10, 2015 · 28 comments
Closed

Revert to default #60

andia89 opened this issue Jul 10, 2015 · 28 comments

Comments

@andia89
Copy link
Collaborator

andia89 commented Jul 10, 2015

I guess it would be a good idea, to have a way to revert to the default icons (if the user wants to stop using this icon theme). I guess for that a major rewrite is necessary :(

@bilelmoussaoui
Copy link
Owner

I think that won't be that hard.. we just need to create a folder, create an other folder inside. And copy back the icons if you want to revert back the icons?

@andia89
Copy link
Collaborator Author

andia89 commented Jul 10, 2015

Yeah something like that

@bilelmoussaoui
Copy link
Owner

I will give it a try today

@bilelmoussaoui
Copy link
Owner

I finished this one, but it's a little hard to fix spotify & google chrome icons..i think we will need a script for reverting the old icons?

@andia89
Copy link
Collaborator Author

andia89 commented Jul 10, 2015

Can't we use the same script with just exchanging the icons?

@bilelmoussaoui
Copy link
Owner

Yeah, but we will need a backup script in this case?

@andia89
Copy link
Collaborator Author

andia89 commented Jul 10, 2015

Backup script? What do you mean

@bilelmoussaoui
Copy link
Owner

I thought that we will need a script to backup the original spotify/chrome icons. But i will just copy the zip/pak file and copy it back when you run the reinstall/revert script

@bilelmoussaoui
Copy link
Owner

@wa4557 can you try my latest commit?

@andia89
Copy link
Collaborator Author

andia89 commented Jul 11, 2015

Not quite:
First error message:

Traceback (most recent call last):
  File "./script.py", line 293, in <module>
    install() 
  File "./script.py", line 196, in install
    backup(app,apps[app]['link'],app_icons)
  File "./script.py", line 127, in backup
    backup_spotify(icons_folder)
  File "./script.py", line 147, in backup_spotify
    move(src, backup_app_path)
  File "/usr/lib/python3.4/shutil.py", line 521, in move
    raise Error("Destination path '%s' already exists" % real_dst)
shutil.Error: Destination path '/home/andreas/.Hardcode-Tray-Backup/spotify/resources.zip' already exists

Second: for variety the whole folder where the pictures are located is backed up. Wouldn't it make more sense to backup only the files the script is overwriting?

@bilelmoussaoui
Copy link
Owner

@wa4557 can you try again? :p

@andia89
Copy link
Collaborator Author

andia89 commented Jul 11, 2015

Everything works (except spotify):

fixing spotify failed with error:
Traceback (most recent call last):
File "svg2png.py", line 11, in
fout = open(symlfile, 'wb')
FileNotFoundError: [Errno 2] No such file or directory: 'resources_old/_linux/spotify_icon.ico'

etc...

@bilelmoussaoui
Copy link
Owner

Well, maybe you've lost the recources.zip folder ? as this issue is in the install file

@andia89
Copy link
Collaborator Author

andia89 commented Jul 11, 2015

nope. still there

@andia89
Copy link
Collaborator Author

andia89 commented Jul 11, 2015

Whoa look what's in in my resources.zip now :) Wtf happened here?
unbenannt

@bilelmoussaoui
Copy link
Owner

WTF :O how that even possible? can you try reinstalling spotify and retry again, this issue was there before i guess

@andia89
Copy link
Collaborator Author

andia89 commented Jul 11, 2015

No idea what happened here. The problem doesn't occur again, and everything is now correctly backed up 👍

@andia89
Copy link
Collaborator Author

andia89 commented Jul 11, 2015

Some more things:

  • as far as I can see the script doesn't remove the icons from .local/share/sni-qt when choosing to revert. I guess however that this is the way to revert for the sni-qt icons
  • could you please add a space after the double dot? choice = int(input("Please choose :")) (Too small to make a PR)
  • is it really necessary to have two distinct functions for spotify & google chrome? From what I can see they do exactly the same; and all the information should already be in the arguments passed to the backup function, right?

@bilelmoussaoui
Copy link
Owner

  • for the sni-qt folder, the icons are removed in my case, which application you're using?
  • fixed
  • i merged chrome & spotify function

@andia89
Copy link
Collaborator Author

andia89 commented Jul 11, 2015

Cool, Yeah sni-qt is fixed my bad, but there's another serious problem:
unbenannt

This happens when opening google-chrome after running the script (although the script shouldn't do anything since the google chrome icons are not there yet)

@andia89
Copy link
Collaborator Author

andia89 commented Jul 11, 2015

In other words. The script should only do a backup if the icons are actually overwritten, somewhere after if theme_icon

@andia89
Copy link
Collaborator Author

andia89 commented Jul 11, 2015

Ok this whole revert thing doesn't work as you want it to happen: If the script is run more than once e.g. resources.zip is copied from opt/spotify to hardcode-tray-backup. The problem however: The second time a resources.zip is copied that is already overwritten with the theme icon. Right now I have no idea how to deal with that :(

@bilelmoussaoui
Copy link
Owner

For the google chrome issue, i guess that the icon names are not the same as in my computer, could you verify that?
And for the backup/revert i was thinking about creating a file named "already_backudup" , what do you think about this?

@andia89
Copy link
Collaborator Author

andia89 commented Jul 11, 2015

Nope same icon name, copying doesn't work somehow. Or copy and don't overwrite already files ?

@bilelmoussaoui
Copy link
Owner

@wa4557 this should be fixed now

@bilelmoussaoui
Copy link
Owner

after merging your latest PR, is this fixed now or there's still something to do ?

@andia89
Copy link
Collaborator Author

andia89 commented Jul 11, 2015

Hmm. What if there will be a new resource.zip in the future in a new version? Then reverting back will most likely break the program. But I don't think this is something we can't fix. In general this works now :)

@bilelmoussaoui
Copy link
Owner

@wa4557 i've installed the new beta of spotify and they've changed a lot of things. the spotify indicator does not seem to work now; we will take a look at this when this version will be released!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants