add overwrite session to deskmngr

master
Daniel Napora 2021-10-11 09:27:02 +02:00
parent 6e0e220f6c
commit a9664b339a
1 changed files with 6 additions and 2 deletions

View File

@ -41,8 +41,12 @@ esac
savesession() {
curdesk=$(wmctrl -d | grep "*" | awk '{print $1}')
if [ $(wmctrl -l -p -G | awk -v c=$curdesk '$2 == c {print $2}' | wc -l) == "0" ];then notify-send -i dialog-warning "$TITLE" "$TEXT";exit 1;fi
if [ -n "$1" ]; then
filename="$1"
else
filename=$(yad --center --title "$SAVE_AS" --entry --entry-label="$SESSNAME" --entry-text="$SESSNAME") || exit 1
fi
windows=()
wmctrl -l -p -G | {
while IFS= read -r line
@ -104,7 +108,7 @@ restoresession() {
wmctrl -s ${DESK}
${cmdline} > /dev/null 2>&1 &
sleep 1.5
sleep 5
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
if [[ "$D" = "u" ]]; then xdotool key super+b; fi
wmctrl -r :ACTIVE: -e 0,${x},${y},${width},${height}