drawgrid,deskmngr upd
parent
8655e383d2
commit
24225a054e
15
bin/deskmngr
15
bin/deskmngr
|
@ -11,9 +11,7 @@ mkdir -p $SESSIONDIR
|
||||||
|
|
||||||
savesession() {
|
savesession() {
|
||||||
curdesk=$(wmctrl -d | grep "*" | awk '{print $1}')
|
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
|
filename=$(yad --center --title "Save session as:" --entry --entry-label="Session name" --entry-text="Session name") || exit 1
|
||||||
#echo "$filename"
|
|
||||||
windows=()
|
windows=()
|
||||||
wmctrl -l -p -G | {
|
wmctrl -l -p -G | {
|
||||||
while IFS= read -r line
|
while IFS= read -r line
|
||||||
|
@ -22,15 +20,14 @@ savesession() {
|
||||||
if [[ "$DESK" != "-1" ]]; then
|
if [[ "$DESK" != "-1" ]]; then
|
||||||
if [[ "$DESK" == "$curdesk" ]]; then
|
if [[ "$DESK" == "$curdesk" ]]; then
|
||||||
cmdline=$(ps -fp $PID -o command=)
|
cmdline=$(ps -fp $PID -o command=)
|
||||||
|
if [[ $cmdline != *quake-term* ]]; then
|
||||||
xwininfo -id "$ID" -wm | grep -q Undecorated && D="u" || D="d"
|
xwininfo -id "$ID" -wm | grep -q Undecorated && D="u" || D="d"
|
||||||
##
|
##
|
||||||
frameY=$(xwininfo -id "$ID" -stats | grep "Relative upper-left Y:" | cut -d: -f2)
|
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)
|
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-frameX)) $((y_offset-2*frameY)) $cmdline")
|
||||||
|
fi
|
||||||
|
|
||||||
#windows+=("$D $width $height $x_offset $y_offset $cmdline")
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
@ -44,7 +41,7 @@ savesession() {
|
||||||
sd -s "cherrytree" "cherrytree --new-window" "$SESSIONDIR/${filename// /_}.desk"
|
sd -s "cherrytree" "cherrytree --new-window" "$SESSIONDIR/${filename// /_}.desk"
|
||||||
sd -s "pcmanfm -d" "pcmanfm -n" "$SESSIONDIR/${filename// /_}.desk"
|
sd -s "pcmanfm -d" "pcmanfm -n" "$SESSIONDIR/${filename// /_}.desk"
|
||||||
fi
|
fi
|
||||||
#echo "$desktop"
|
|
||||||
geany "$SESSIONDIR/${filename// /_}.desk"
|
geany "$SESSIONDIR/${filename// /_}.desk"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,12 +54,9 @@ restoresession() {
|
||||||
while IFS= read -r line
|
while IFS= read -r line
|
||||||
do
|
do
|
||||||
read -r D width height x y cmdline< <(echo $line)
|
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}
|
wmctrl -s ${DESK}
|
||||||
${cmdline} > /dev/null 2>&1 &
|
${cmdline} > /dev/null 2>&1 &
|
||||||
# wmctrl -lp| tail -n1 |awk '{print $1}'
|
|
||||||
|
|
||||||
# _NET_WM_STATE(ATOM) = _OB_WM_STATE_UNDECORATED
|
|
||||||
sleep 1.5
|
sleep 1.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
|
||||||
|
@ -73,7 +67,6 @@ restoresession() {
|
||||||
}
|
}
|
||||||
|
|
||||||
listsessions() {
|
listsessions() {
|
||||||
#for i in $(ls -1 ${SESSIONDIR}); do echo "${i}";done
|
|
||||||
ls -1 ${SESSIONDIR}
|
ls -1 ${SESSIONDIR}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ magick -size $AVAILSIZE xc:LavenderBlush3 -stroke LavenderBlush2 -strokewidth 1
|
||||||
-draw "$rectangles" \
|
-draw "$rectangles" \
|
||||||
-style Normal +stroke -pointsize 14 -fill gray16 -draw "$text" \
|
-style Normal +stroke -pointsize 14 -fill gray16 -draw "$text" \
|
||||||
/tmp/grid.png
|
/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
|
sleep 1
|
||||||
dghelper=$(wmctrl -l -p |grep "DrawGrid helper")
|
dghelper=$(wmctrl -l -p |grep "DrawGrid helper")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue