Thursday, May 9, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 1030  / 2 Years ago, mon, march 14, 2022, 10:00:05

I am looking for a way to use the icons from the users theme (in gnome) in a bash script.



The solution could be a environment variable or a file where the path to the users icon set is written.



Eg. of use :



notify-send --icon=$MYICONPATH/status/32/info.svg "info"

More From » gnome

 Answers
0

Assuming you are using the GNOME environment, you can get the name of the icon theme with gconftool-2 (Ubuntu versions < 11.04) or gsettings (Ubuntu >= 11.04). Depending on your use case, that might already be enough:



gconf:



ICON_THEME=$(gconftool-2 -g /desktop/gnome/interface/icon_theme)
MYICONPATH=/usr/share/icons/$ICON_THEME


gsettings:



ICON_THEME=$(gsettings get org.gnome.desktop.interface icon-theme)
MYICONPATH=/usr/share/icons/${ICON_THEME:1:-1}

[#43885] Wednesday, March 16, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
llianconclad

Total Points: 65
Total Questions: 109
Total Answers: 127

Location: Mali
Member since Fri, Dec 3, 2021
2 Years ago
llianconclad questions
Sun, May 1, 22, 08:47, 2 Years ago
Tue, Nov 8, 22, 02:33, 2 Years ago
Mon, Aug 23, 21, 15:58, 3 Years ago
Sun, Jul 25, 21, 18:19, 3 Years ago
;