2

I'm a bit of a tinkerer and changed my most commonly used application icons to have my own steam-punk theme.

The only application whose icon I couldn't get to change was qBitTorrent.

The .desktop files are only present in /usr/share/applications to make them available to all users and ~/.local/share/applications/ has been verified not to contain any desktop files.

Can anyone shed a light on why this is happening? (And give some direction how to change that icon?)

SteamPunk Launcher

For the ones out there who don't know about SteamPunk: I want to change the ugly blue icon... ;-)

Some more info:

$ lsattr /usr/share/applications/qBittorrent.desktop
-------------e-- /usr/share/applications/qBittorrent.desktop

$ lsattr /usr/share/pixmaps/Steampunk-Vlc-Audio-Player-Icon-Mkii.png 
-------------e-- /usr/share/pixmaps/Steampunk-Vlc-Audio-Player-Icon-Mkii.png

Now that I've got qTox running myself (with a little bit of help from @JacobVlijm) and no one has given me any ideas for qBittorrent, I'm adding a bounty...

Note:

I'm not looking to change the icon using the ~/.local/share/applications/ override but for all users in /usr/share/applications/ or any other system-wide setting!

4
  • 1
    Hi Fabby, How did you install it? I downloaded it here: github.com/tux3/qTox, unpacked it (just an executable), ran it and it created a qtox.desktop file locally. I then changed the icon without a problem. see dl.dropboxusercontent.com/u/1155139/fabby/1.png and dl.dropboxusercontent.com/u/1155139/fabby/2.png Sep 12, 2015 at 7:09
  • apt-cache policy qtox-unity noteworthy output: 500 https://pkg.tox.chat/debian/ nightly/release amd64 Packages
    – Fabby
    Sep 15, 2015 at 16:50
  • @kos: It's my own theme, sorry... Just a bunch of icons converted to 128x128 in /usr/share/pixmaps and then a bunch of manually edited .desktop files... That's why I'm running into trouble... Doing stuff I'd better not do! ;-) (as every firefox update needs me to go in and edit the desktop file again.)
    – Fabby
    Sep 15, 2015 at 18:28
  • @kos: Yep, and only in qBittorrent! All the others work flawlessly... :-(
    – Fabby
    Sep 15, 2015 at 18:34

1 Answer 1

6
+100

The problem is that qBittorrent's .desktop file sets the icon based on the localization:

sed -n '/^Icon\(\[[^]]*\]\)\?=.*$/p' /usr/share/applications/qBittorrent.desktop
Icon=qbittorrent
Icon[be]=qbittorrent
Icon[cs]=qbittorrent
Icon[el]=qbittorrent
Icon[en_GB]=qbittorrent
Icon[es]=qbittorrent
Icon[eu]=qbittorrent
Icon[fi]=qbittorrent
Icon[gl]=qbittorrent
Icon[it]=qbittorrent
Icon[ja]=qbittorrent
Icon[lt]=qbittorrent
Icon[nb]=qbittorrent
Icon[pl]=qbittorrent
Icon[pt]=qbittorrent
Icon[pt_BR]=qbittorrent
Icon[ro]=qbittorrent
Icon[ru]=qbittorrent
Icon[sv]=qbittorrent
Icon[uk]=qbittorrent
Icon[vi]=qbittorrent
Icon[zh_TW]=qbittorrent
Icon[en_AU]=qbittorrent

So changing the icon set by the first generic Icon= entry doesn't help:

screenshot1

You'll have to set the Icon= entry matching your current locale; however since localizing the icon by setting the very same icon for each locale is a very silly thing to do in first place, you might as well just change all the Icon= entries by running this command (it will create a qBittorrent.desktop.bak backup file in /usr/share/applications):

sudo sed -i.bak 's|^Icon\(\[[^]]*\]\)\?=.*$|Icon\1=/path/to/icon|' /usr/share/applications/qBittorrent.desktop
Insert the path to the icon here-------------------^-----------^
user@user-X550CL ~ % sudo sed -i.bak 's|^Icon\(\[[^]]*\]\)\?=.*$|Icon\1=/home/user/icon.png|' /usr/share/applications/qBittorrent.desktop 
user@user-X550CL ~ % sed -n '/^Icon\(\[[^]]*\]\)\?=.*$/p' /usr/share/applications/qBittorrent.desktop
Icon=/home/user/icon.png
Icon[be]=/home/user/icon.png
Icon[cs]=/home/user/icon.png
Icon[el]=/home/user/icon.png
Icon[en_GB]=/home/user/icon.png
Icon[es]=/home/user/icon.png
Icon[eu]=/home/user/icon.png
Icon[fi]=/home/user/icon.png
Icon[gl]=/home/user/icon.png
Icon[it]=/home/user/icon.png
Icon[ja]=/home/user/icon.png
Icon[lt]=/home/user/icon.png
Icon[nb]=/home/user/icon.png
Icon[pl]=/home/user/icon.png
Icon[pt]=/home/user/icon.png
Icon[pt_BR]=/home/user/icon.png
Icon[ro]=/home/user/icon.png
Icon[ru]=/home/user/icon.png
Icon[sv]=/home/user/icon.png
Icon[uk]=/home/user/icon.png
Icon[vi]=/home/user/icon.png
Icon[zh_TW]=/home/user/icon.png
Icon[en_AU]=/home/user/icon.png

Or delete the localized Icon= entries and change the generic Icon= entry by running this command (it will create a qBittorrent.desktop.bak backup file in /usr/share/applications):

sudo sed -i.bak '/^Icon\(\[[^]]*\]\)\=.*$/d; s|^Icon=.*$|Icon=/path/to/icon|'
Insert the path to the icon here------------------------------^-----------^
user@user-X550CL ~ % sudo sed -i.bak '/^Icon\(\[[^]]*\]\)\=.*$/d; s|^Icon=.*$|Icon=/path/to/icon|' /usr/share/applications/qBittorrent.desktop
user@user-X550CL ~ % sed -n '/^Icon\(\[[^]]*\]\)\?=.*$/p' /usr/share/applications/qBittorrent.desktop
Icon=/path/to/icon

Or just change the Icon= entry matching your current locale by any mean, such as:

sudo nano /usr/share/applications/qBittorrent.desktop

screenshot2

3
  • +1, Same here, I knew it existed, never ran into it though. One tiny thing; I'd prefer to edit a local copy as a general rule :). Sep 15, 2015 at 20:01
  • 1
    @Fabby Yes sorry, I changed it but not fast enough, here's the original if you messed it up using my command: paste.ubuntu.com/12420131. That's silly tough, I don't get why setting the same icon for each locale, just don't set anything and let it fall back to the general. -_-
    – kos
    Sep 15, 2015 at 20:02
  • 1
    @kos nice catch! Sep 15, 2015 at 20:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .