From 24225a054e455b46935ac26273a698646b38fc84 Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Wed, 19 May 2021 02:35:11 +0200 Subject: [PATCH] drawgrid,deskmngr upd --- bin/deskmngr | 15 ++++----------- bin/drawgrid | 2 +- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/bin/deskmngr b/bin/deskmngr index 12d6c62..b4a9d87 100755 --- a/bin/deskmngr +++ b/bin/deskmngr @@ -11,9 +11,7 @@ mkdir -p $SESSIONDIR savesession() { curdesk=$(wmctrl -d | grep "*" | awk '{print $1}') - echo "$curdesk" filename=$(yad --center --title "Save session as:" --entry --entry-label="Session name" --entry-text="Session name") || exit 1 - #echo "$filename" windows=() wmctrl -l -p -G | { while IFS= read -r line @@ -22,15 +20,14 @@ savesession() { if [[ "$DESK" != "-1" ]]; then if [[ "$DESK" == "$curdesk" ]]; then cmdline=$(ps -fp $PID -o command=) + if [[ $cmdline != *quake-term* ]]; then xwininfo -id "$ID" -wm | grep -q Undecorated && D="u" || D="d" ## frameY=$(xwininfo -id "$ID" -stats | grep "Relative upper-left Y:" | cut -d: -f2) frameX=$(xwininfo -id "$ID" -stats | grep "Relative upper-left X:" | cut -d: -f2) windows+=("$D $width $height $((x_offset-frameX)) $((y_offset-2*frameY)) $cmdline") - - - #windows+=("$D $width $height $x_offset $y_offset $cmdline") + fi fi fi done @@ -44,7 +41,7 @@ savesession() { sd -s "cherrytree" "cherrytree --new-window" "$SESSIONDIR/${filename// /_}.desk" sd -s "pcmanfm -d" "pcmanfm -n" "$SESSIONDIR/${filename// /_}.desk" fi - #echo "$desktop" + geany "$SESSIONDIR/${filename// /_}.desk" } } @@ -57,12 +54,9 @@ restoresession() { while IFS= read -r line do read -r D width height x y cmdline< <(echo $line) - #echo -e "Desktop ID: $DESK , Decorated: $D, Size: ${width}x${height}, position: $x $y\nCommandline: $cmdline" wmctrl -s ${DESK} ${cmdline} > /dev/null 2>&1 & - # wmctrl -lp| tail -n1 |awk '{print $1}' - - # _NET_WM_STATE(ATOM) = _OB_WM_STATE_UNDECORATED + sleep 1.5 wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz if [[ "$D" = "u" ]]; then xdotool key super+b; fi @@ -73,7 +67,6 @@ restoresession() { } listsessions() { - #for i in $(ls -1 ${SESSIONDIR}); do echo "${i}";done ls -1 ${SESSIONDIR} } diff --git a/bin/drawgrid b/bin/drawgrid index b3fcaa2..9b251ee 100755 --- a/bin/drawgrid +++ b/bin/drawgrid @@ -30,7 +30,7 @@ magick -size $AVAILSIZE xc:LavenderBlush3 -stroke LavenderBlush2 -strokewidth 1 -draw "$rectangles" \ -style Normal +stroke -pointsize 14 -fill gray16 -draw "$text" \ /tmp/grid.png -feh -N -x --title "DrawGrid helper" /tmp/grid.png > /dev/null 2>&1 & +feh -N -x -g "$AVAILSIZE" --title "DrawGrid helper" /tmp/grid.png > /dev/null 2>&1 & sleep 1 dghelper=$(wmctrl -l -p |grep "DrawGrid helper")