PC & IT SUPPORT MADE EASY FORUM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

linux mint restore windows on login on cinnamon

Go down

linux mint restore windows on login on cinnamon Empty linux mint restore windows on login on cinnamon

Post by jamied_uk 28th June 2020, 11:38

type

Code:
echo $DESKTOP_SESSION


Code:
mkdir ~/Desktop/.workspaces
wmctrl -s 0
echo 0 > ~/Desktop/.workspaces/current_workspace
cat >> ~/Desktop/.workspaces/switchWorkspace.sh <<'EOB'
#!/bin/bash
if [ "$(ls ~/Desktop)" ]; then mv ~/Desktop/* -t ~/Desktop/.workspaces/$(<~/Desktop/.workspaces/current_workspace)/; fi
wmctrl -s $1
echo $1 > ~/Desktop/.workspaces/current_workspace
if [ "$(ls ~/Desktop/.workspaces/$1)" ]; then mv ~/Desktop/.workspaces/$1/* -t ~/Desktop/; fi
EOB
chmod u+x ~/Desktop/.workspaces/switchWorkspace.sh
mkdir ~/Desktop/.workspaces/0
mkdir ~/Desktop/.workspaces/1
mkdir ~/Desktop/.workspaces/2
mkdir ~/Desktop/.workspaces/3
forums.linuxmint.com/viewtopic.php?t=273832
jamied_uk
jamied_uk
Admin

Posts : 3053
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

linux mint restore windows on login on cinnamon Empty Re: linux mint restore windows on login on cinnamon

Post by jamied_uk 28th June 2020, 11:51

Setup Script


Code:
#!/bin/bash
#
# ./switchWorkspace.sh 0-3
#
# https://jnet.forumotion.com/t1695-linux-mint-restore-windows-on-login-on-cinnamon#2620
#
# https://forums.linuxmint.com/viewtopic.php?t=273832
#
dir="~/Desktop/.workspaces"
#
if [[ ! -e $dir ]]; then
    mkdir $dir
elif [[ ! -d $dir ]]; then
    echo "$dir already exists but is not a directory" 1>&2
fi
#
wmctrl -s 0
echo 0 > ~/Desktop/.workspaces/current_workspace
cat >> ~/Desktop/.workspaces/switchWorkspace.sh <<'EOB'
#!/bin/bash
if [ "$(ls ~/Desktop)" ]; then mv ~/Desktop/* -t ~/Desktop/.workspaces/$(<~/Desktop/.workspaces/current_workspace)/; fi
wmctrl -s $1
echo $1 > ~/Desktop/.workspaces/current_workspace
if [ "$(ls ~/Desktop/.workspaces/$1)" ]; then mv ~/Desktop/.workspaces/$1/* -t ~/Desktop/; fi
EOB
chmod u+x ~/Desktop/.workspaces/switchWorkspace.sh
#
if [[ ! -e ~/Desktop/.workspaces/0 ]]; then
    mkdir ~/Desktop/.workspaces/0
elif [[ ! -d ~/Desktop/.workspaces/0 ]]; then
    echo "~/Desktop/.workspaces/0 already exists but is not a directory" 1>&2
fi
#
if [[ ! -e ~/Desktop/.workspaces/1 ]]; then
    mkdir ~/Desktop/.workspaces/1
elif [[ ! -d ~/Desktop/.workspaces/1 ]]; then
    echo "~/Desktop/.workspaces/1 already exists but is not a directory" 1>&2
fi
#
if [[ ! -e ~/Desktop/.workspaces/2 ]]; then
    mkdir ~/Desktop/.workspaces/2
elif [[ ! -d ~/Desktop/.workspaces/2 ]]; then
    echo "~/Desktop/.workspaces/2 already exists but is not a directory" 1>&2
fi
#
if [[ ! -e ~/Desktop/.workspaces/3 ]]; then
    mkdir ~/Desktop/.workspaces/3
elif [[ ! -d ~/Desktop/.workspaces/3 ]]; then
    echo "~/Desktop/.workspaces/3 already exists but is not a directory" 1>&2
fi
jamied_uk
jamied_uk
Admin

Posts : 3053
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum