我目前正在设置一个新的 Cinnamon 环境,我所有的快捷方式都可以正常工作。我设法在网上找到了这个脚本,我必须允许我在显示器之间移动窗口:
#!/bin/bash
#get the window geometry
widthHeight=( $(wmctrl -l -G | grep -v ' \-1 ' | awk 'END{print $5,$6}' ))
#toggle if $1 is set and set to left - move window to left
if [[ ! -z $1 ]]; then
if [[ $1 == "left" ]]; then
#this window is in another screen
wmctrl -r ":ACTIVE:" -e 0,0,0,${widthHeight[0]},${widthHeight[1]}
else
wmctrl -r ":ACTIVE:" -e 0,1920,0,${widthHeight[0]},${widthHeight[1]}
fi
fi
Run Code Online (Sandbox Code Playgroud)
但是,如果窗口最大化或对齐到显示器的任一侧,则它不起作用。有谁知道如何修改这个脚本,以便它总是将窗口移动到下一个监视器?