You are not logged in.
Pages: 1
I need simple applet.
- Run script.
- Script return 0 (ok) or 1 (fail)
- Show icon. If 0 - show first icon.
- It 1 - show second icon.
It applet will be places in panel.
Near other indicators.
Settings:
- script
- incos
Offline
The xfce4-genmon-plugin can do this, but without the icons. With some clever scripting you can also do this with normal launchers (change the icon of the desktop file, use %k to get the uri to the file).
Offline
I use launcher system to check mail.
- Create a launcher, make it run your script
- Go in ~/.config/xfce4/panel, the last created directory "launcher-##" normally contain a .desktop file (look inside and verify that is the launcher that run your script by looking the "Exec=" property)
- Now your script :
#!/bin/bash
launcherDir=~/.config/xfce4/panel/launcher-##
##### Your code ####
...
##################
function gendesktop
{
cat <<EOF
[Desktop Entry]
Version=1.0
Type=Application
Name=$1
Comment=
Icon=$2
Exec=/path/to/your/script
Path=
Terminal=false
StartupNotify=false
EOF
}
rm -f $launcherDir/*.desktop
if [ $res == 0 ]; then
gendesktop "Tool tips that OK" "path to your icon, or icon name from gtk cache icons" > $launcherDir/$$.desktop
else
gendesktop "Tool tips that not ok" "path to your second icon" > $launcherDir/$$.desktop
fi
- There must be is a better way to force update the launcher's icon than creating a new .desktop file. Nick, is that what you are refering by using %k ?
Xfce is NOT Xubuntu. Bugs in Xubuntu don't mean that Xfce is buggy ...
Offline
If you use %k in the command, it will be replaced with the desktop file uri. You can use that in the script to modify the launcher.
#!/bin/sh
filename=${1#file://}
desktop-file-edit --set-icon="face-tired" "$filename"
touch "$filename"
# Do stuff
sleep 5
desktop-file-edit --set-icon="face-smile" "$filename"
touch "$filename"
Only create a launcher with the following command "scriptname.sh %k"
Offline
See also the genmon page: http://goodies.xfce.org/projects/panel- … mon-plugin
Offline
Pages: 1
[ Generated in 0.008 seconds, 8 queries executed - Memory usage: 534.48 KiB (Peak: 535.33 KiB) ]