You are not logged in.
I created a bash script which when executed as a desktop application modifies its own application icon. This is done by altering the Icon= line in the application's .desktop file.
Here is a gif of the application in action: http://gfycat.com/TepidThankfulHart. As you can tell, there is an approximately two second delay before the icon changes. I was wondering if there was a way of making the icon change immediately.
For completeness sake here is the script I am using:
#!/bin/bash
LAUNCHER=/home/alessandro/Scripts/wallpaper_cycle.desktop
PLAY_ICON=media-playback-start-symbolic
PAUSE_ICON=media-playback-pause-symbolic
if [ ! -z $(grep "Icon=$PLAY_ICON" $LAUNCHER) ]; then
sed -i -e "s/Icon=$PLAY_ICON/Icon=$PAUSE_ICON/g" $LAUNCHER
elif [ ! -z $(grep "Icon=$PAUSE_ICON" $LAUNCHER) ]; then
sed -i -e "s/Icon=$PAUSE_ICON/Icon=$PLAY_ICON/g" $LAUNCHER
fi
Last edited by SenorSalad (2015-07-07 18:32:21)
Offline
What version of xfdesktop are you running?
Try forcing an xfdesktop reload at the end of the script:
xfdesktop --reload
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
I am running xfwm4 version 4.11.1git.22344d9 (revision 22344d9) for Xfce 4.10.
Unfortunately
xfdesktop --reload
does not help.
Offline
What does the following return:
xfdesktop --help
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Usage:
xfdesktop [OPTION...]
Help Options:
-h, --help Show help options
--help-all Show all help options
--help-gtk Show GTK+ Options
--help-sm-client Show session management options
Application Options:
-V, --version Display version information
--reload Reload all settings, refresh image list
--menu Pop up the menu (at the current mouse position)
--windowlist Pop up the window list (at the current mouse position)
--arrange Automatically arrange all the icons on the desktop
--quit Cause xfdesktop to quit
--display=DISPLAY X display to use
Offline
Well that confirms that the command is indeed "xfdesktop --reload". Sorry it didn't help.
It looks like xfdesktop uses glib's GFileMonitor to monitor file changes and call functions to deal with the changes. It may be that this is just how long the process takes on your system. I was hoping that forcing an xfdesktop reload might help. I am unaware of any setting that would speed up GLib's File Monitoring process.
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Thanks anyway Toz. I'll leave this thread open in case a wizard shows up with a solution, if that's all right with you.
Offline
[ Generated in 0.010 seconds, 7 queries executed - Memory usage: 545.09 KiB (Peak: 545.93 KiB) ]