add overwrite session to deskmngr
parent
6e0e220f6c
commit
a9664b339a
|
@ -41,8 +41,12 @@ esac
|
||||||
savesession() {
|
savesession() {
|
||||||
curdesk=$(wmctrl -d | grep "*" | awk '{print $1}')
|
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 [ $(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
|
filename=$(yad --center --title "$SAVE_AS" --entry --entry-label="$SESSNAME" --entry-text="$SESSNAME") || exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
windows=()
|
windows=()
|
||||||
wmctrl -l -p -G | {
|
wmctrl -l -p -G | {
|
||||||
while IFS= read -r line
|
while IFS= read -r line
|
||||||
|
@ -104,7 +108,7 @@ restoresession() {
|
||||||
wmctrl -s ${DESK}
|
wmctrl -s ${DESK}
|
||||||
${cmdline} > /dev/null 2>&1 &
|
${cmdline} > /dev/null 2>&1 &
|
||||||
|
|
||||||
sleep 1.5
|
sleep 5
|
||||||
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
|
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
|
||||||
if [[ "$D" = "u" ]]; then xdotool key super+b; fi
|
if [[ "$D" = "u" ]]; then xdotool key super+b; fi
|
||||||
wmctrl -r :ACTIVE: -e 0,${x},${y},${width},${height}
|
wmctrl -r :ACTIVE: -e 0,${x},${y},${width},${height}
|
||||||
|
|
Loading…
Reference in New Issue