You are not logged in.
I have a bunch of desktops and I would like the desktop number to flash up when I switch to it with my shortcut keys. Anyone have any reccomendations?
Offline
conky can show you your current desktop... But it's probably not what you were expecting.
Offline
Not exactly but I have it configured and running to list the desktops.
I was really looking for a large flash just to remind me what desktop I am on.
This is what I did so far: http://wiki.hackspherelabs.com/index.php?title=Conky
Can you make conky appear and dissappear?
Last edited by webdawg (2014-01-16 18:53:13)
Offline
How about using notify-send and a script like:
#!/bin/bash
#Description: Using notify-send, pop-up the current workspace number when changing workspaces
#Requires: xfce4-notifyd, libnotify, wmctrl
CURRENT_WORKSPACE=$(($(wmctrl -d | grep \* | cut -d' ' -f1)+1))
while true
do
sleep 1
NEW_WORKSPACE=$(($(wmctrl -d | grep \* | cut -d' ' -f1)+1))
if [ $CURRENT_WORKSPACE -ne $NEW_WORKSPACE ]; then
notify-send " workspace" "<b><span font='100'>$NEW_WORKSPACE</span></b>"
CURRENT_WORKSPACE=$NEW_WORKSPACE
fi
done
exit 0
Offline
I like it man. I will test that too.
Offline
Works awsome too. I added the timeout:
#!/bin/bash
#Description: Using notify-send, pop-up the current workspace number when changing workspaces
#Requires: xfce4-notifyd, libnotify, wmctrl
CURRENT_WORKSPACE=$(($(wmctrl -d | grep \* | cut -d' ' -f1)+1))
while true
do
sleep 1
NEW_WORKSPACE=$(($(wmctrl -d | grep \* | cut -d' ' -f1)+1))
if [ $CURRENT_WORKSPACE -ne $NEW_WORKSPACE ]; then
notify-send -t 500 " workspace" "<b><span font='100'>$NEW_WORKSPACE</span></b>"
CURRENT_WORKSPACE=$NEW_WORKSPACE
fi
done
exit 0
You know of anyway to have xfce send the notification? This still works great.
Offline
You know of anyway to have xfce send the notification?
Unfortunately no. I don't think the code base supports it. You can always create an enhancement request if you want at https://bugzilla.xfce.org/.
Offline
Did you make this script or did you find it somewhere?
Offline
Did you make this script or did you find it somewhere?
I was looking for something similar a couple of months back and wrote it.
In case you're interested, I've enhanced it to also show the workspace name centered (though right now the workspace names can't have spaces in them - I blame my mis-understanding of bash arrays for this). Plus some code to ensure that only one instance of it runs.
#!/bin/bash
#Name: wsp_notify
#Description: Using notify-send, pop-up the current workspace number when changing workspaces
#Requires: xfce4-notifyd, libnotify, wmctrl
#debug mode: bash -xv /path/to/wsp_notify 2>&1 | tee wsp_notify.log
# make sure that only one instance of this script is running per user
lockfile=/tmp/.wsp_notify.$USER.lockfile
if ( set -o noclobber; echo "locked" > "$lockfile") 2> /dev/null; then
trap 'rm -f "$lockfile"; exit $?' INT TERM EXIT
echo "wsp_notifyDEBUG: Locking succeeded" >&2
# on startup, set the CURRENT_WORKSPACE value
CURRENT_WORKSPACE=$(($(wmctrl -d | grep \* | cut -d' ' -f1)+1))
# get the workspace names (starts at index 2)
NAMES=(`xfconf-query -c xfwm4 -p /general/workspace_names | grep -v "Value is an array"`)
# every second, query the active workspace number and if different from the previous one, send a notification
while true
do
sleep 1
NEW_WORKSPACE=$(($(wmctrl -d | grep \* | cut -d' ' -f1)+1))
NEW_WORKSPACE_NAME="${NAMES[$(($NEW_WORKSPACE-1))]}"
if [ $CURRENT_WORKSPACE -ne $NEW_WORKSPACE ]; then
notify-send -t 5 "$(echo Workspace | sed -e :a -e 's/^.\{1,12\}$/ & /;ta')" "<b><span font='110'>$NEW_WORKSPACE</span></b>\n<i>$(echo $NEW_WORKSPACE_NAME | sed -e :a -e 's/^.\{1,17\}$/ & /;ta')</i>"
CURRENT_WORKSPACE=$NEW_WORKSPACE
fi
done
# can't create lockfile - notify user and quit
else
echo "wsp_notifyDEBUG: Lock failed, check for existing process and/or lock file and delete - exiting." >&2
exit 1
fi
exit 0
Offline
Offline
I changed the sleep timeout to 0.0001s because I wanted the notification to be faster, I hope that's okay
Works awsome too. I added the timeout:
#!/bin/bash #Description: Using notify-send, pop-up the current workspace number when changing workspaces #Requires: xfce4-notifyd, libnotify, wmctrl CURRENT_WORKSPACE=$(($(wmctrl -d | grep \* | cut -d' ' -f1)+1)) while true do sleep 1 NEW_WORKSPACE=$(($(wmctrl -d | grep \* | cut -d' ' -f1)+1)) if [ $CURRENT_WORKSPACE -ne $NEW_WORKSPACE ]; then notify-send -t 500 " workspace" "<b><span font='100'>$NEW_WORKSPACE</span></b>" CURRENT_WORKSPACE=$NEW_WORKSPACE fi done exit 0
You know of anyway to have xfce send the notification? This still works great.
Offline