drawgrid,deskmngr upd

master
Daniel Napora 2021-05-19 02:35:11 +02:00
parent 8655e383d2
commit 24225a054e
2 changed files with 5 additions and 12 deletions

View File

@ -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}
}

View File

@ -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")