bilelmoussaoui / StartupWMClassFixer

Will help you fix unrecognized/ugly icons in Linux.
GNU General Public License v2.0
30 stars 4 forks source link

Things to do #1

Closed bilelmoussaoui closed 8 years ago

bilelmoussaoui commented 8 years ago

Example of database file : desktop file name, startupwmclass value

bilelmoussaoui commented 8 years ago

@wa4557 Do you want to contribute on this? :) The script will add/update StartupWMClass propoerty in the desktop file of "infected" application, to make the icons look right in a dash(Gnome)/Dock or when using Alt + Tab. Almost every steam game has this issue, and some of other application like Octave, Arduino IDE...

andia89 commented 8 years ago

Sure thing. I guess this might be an issue that is best solved using bash scripts. Python is a bit of an overkill here...

andia89 commented 8 years ago

I can provide the bash script (I actually have a bit more time now the next weeks:) But you have to tell me what I should do

bilelmoussaoui commented 8 years ago

I'm going to use bash script

Le 21 nov. 2015 à 10:10, Andreas Angerer notifications@github.com a écrit :

Sure thing. I guess this might be an issue that is best solved using bash scripts. Python is a bit of an overkill here...

— Reply to this email directly or view it on GitHub.

bilelmoussaoui commented 8 years ago

Well, we should read the database file that will contain the application name, the desktop file name , and the startupWMclass value! For each file we should check in every desktop file location, /usr/share/applications and .local/share/applications we can get that from Hardcode-fixer i guess; and if the file do exists, we add the startupWMclass if the property does not exists; the script will need root permissions as some files do exists in /usr/..

andia89 commented 8 years ago

Ah ok, that should be fairly easy. Right now I'm working on the musseq icon but as soon as I'm finished with that I can work on the script. Do youu want to start or should I build from scratch. I guess it's ok if we just both work on it and upload the changes

bilelmoussaoui commented 8 years ago

I will start working on it and upload the changes

andia89 commented 8 years ago

:+1:

bilelmoussaoui commented 8 years ago

@wa4557 I added the script :) We just need to implement restore/backup

bilelmoussaoui commented 8 years ago

Done!

bilelmoussaoui commented 8 years ago

@wa4557 If you have some free time, can you take a look at Readme file if everything is correct,the bash script too as i'm not really used to it :P

andia89 commented 8 years ago

Wow that was fast:) we could implement a restore function by saving in the database if and what was previously in startupwmclass and restore that value if someone wants to revert

Bilal Elmoussaoui notifications@github.com schrieb am Sa., 21.11.2015, 12:32:

@wa4557 https://github.com/wa4557 I added the script :) We just need to implement restore/backup

— Reply to this email directly or view it on GitHub https://github.com/bil-elmoussaoui/StartupWMClassFixer/issues/1#issuecomment-158629323 .

bilelmoussaoui commented 8 years ago

I just copied the old file, is that good enough? i just need to add a ignore list for backup as we don't really need to backup desktop file that are in $HOME/desktop/

andia89 commented 8 years ago

I guess that's ok. A few things I'm going to fix however:

  1. Remove the extension of the script. It's usually not considered good coding practice keeping the .sh extension. https://askubuntu.com/questions/503127/should-i-save-my-scripts-with-the-sh-extension
  2. Backup files should be saved as .bak instead of .backup
  3. If the file database.csv is not available we could wget it instead of exiting the script

Otherwise :+1:

bilelmoussaoui commented 8 years ago

Good!!! :dancer:

bilelmoussaoui commented 8 years ago

I use $(xdg-user-dir DESKTOP) to get the directory of $HOME/Desktop (depends on the language the user's using) as we run the script as root we the result is /home/root/Desktop/, do you have any idea or an other way to do that?

andia89 commented 8 years ago

Hmm why do you need that folder?

bilelmoussaoui commented 8 years ago

Steam creates desktop files there too

andia89 commented 8 years ago

That's tricky because in German for example the folder is called Schreibtisch so we cannot hardcode the name... We could replace root with ${SUDO_USER:-$USER}?

bilelmoussaoui commented 8 years ago

Good idea!! we will need to replace /root/ with /${SUDO_USER:-$USER}/ to avoid the case that user has a username like rootblabla! can you do that?

andia89 commented 8 years ago

Sure :)

andia89 commented 8 years ago

No that doesn't work :( The thing is that if i run sudo xdg-user-dir DESKTOP i get /root/Desktop but if I run /home/andreas/Schreibtisch so the name is also different...

bilelmoussaoui commented 8 years ago

There's no way to run a code as an other user? :(

andia89 commented 8 years ago

sudo -u ${SUDO_USER:-$USER} xdg-user-dir DESKTOP should work

bilelmoussaoui commented 8 years ago

Done :+1:

andia89 commented 8 years ago

:+1: