#!/bin/sh DesktopIndex=`xprop -root _NET_CURRENT_DESKTOP | awk '{print $3}'` DesktopName=`xprop -root 8s _NET_DESKTOP_NAMES |awk '{print $(3+'$DesktopIndex')}'|tr -d '",'` echo Desktop is now $DesktopName CurrentDesktopDirectory=`find ~/.config/Desktops -type l` DesiredDesktopDirectory=$HOME/.config/Desktops/$DesktopName echo The Current Desktop Directory is $CurrentDesktopDirectory echo The Desired Desktop Directory is $DesiredDesktopDirectory if [ $CurrentDesktopDirectory != $DesiredDesktopDirectory ] then rm $CurrentDesktopDirectory mkdir $CurrentDesktopDirectory mv ~/Desktop/* $CurrentDesktopDirectory mv $DesiredDesktopDirectory/* ~/Desktop rmdir $DesiredDesktopDirectory ln -s ~/Desktop $DesiredDesktopDirectory fi