linux mint restore windows on login on cinnamon
Page 1 of 1
linux mint restore windows on login on cinnamon
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
Re: linux mint restore windows on login on cinnamon
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
Similar topics
» KDE 5 for Linux Mint 17 and other linux distros like open suse
» Linux Mint 13 Files
» How to auto login linux kde and other environments
» How To Use Linux Mint Extensions in any linux distro
» Linux Mint 14 "Nadia" - KDE (64-bit)
» Linux Mint 13 Files
» How to auto login linux kde and other environments
» How To Use Linux Mint Extensions in any linux distro
» Linux Mint 14 "Nadia" - KDE (64-bit)
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum