上面的解决方案不错。:-)
与此同时,我写了一个脚本来完成相同的任务。你可以将它挂钩到lxqt快捷键上 - meta+left等等。
#!/bin/bash
# -x
offset_lubuntu_panel=50
width=$(wmctrl -d |head -n1 | cut -f5 -d' '|cut -dx -f1) # size of your monitor, say 1600x900
height=$(( $(wmctrl -d |head -n1 | cut -f5 -d' '|cut -dx -f2) - offset_lubuntu_panel))
width_half=$((width/2))
height_half=$((height/2))
case $1 in
left)
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz # un-maximizing an active window:
sleep .1
wmctrl -r :ACTIVE: -e 0,0,0,$width_half,$height # left half
;;
right)
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz # un-maximizing an active window:
sleep .1
wmctrl -r :ACTIVE: -e 0,$width_half,0,$width_half,$height # right half
;;
up)
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz # un-maximizing an active window:
sleep .1
wmctrl -r :ACTIVE: -e 0,0,0,$width,$height_half # upper half
;;
down)
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz # un-maximizing an active window:
sleep .1
wmctrl -r :ACTIVE: -e 0,0,$height_half,$width,$height_half # lower half
;;
max)
wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz # maximizing the current window
;;
*)
echo -e "\t$(basename $0) [left|right|up|down|max]"
echo -e "\t\twmctrl -r :ACTIVE: -e 0,0,0,$width,$heightpulka # gravity,x,y,w,h"
echo -e "\tRun: lxqt-config-globalkeyshortcuts to add shortcuts to your system"
echo -e "\tor edit manually this file: ~/.config/lxqt/globalkeyshortcuts.conf"
echo
;;
esac