在同一桌面上创建显示或隐藏我想要的任何窗口,而不是默认SUPER+NUM功能。
我也想删除默认(旧)的。
gsettings set org.gnome.shell.extensions.dash-to-dock hot-keys false
gsettings set org.gnome.shell.keybindings switch-to-application-1 []
gsettings set org.gnome.shell.keybindings switch-to-application-2 []
gsettings set org.gnome.shell.keybindings switch-to-application-3 []
gsettings set org.gnome.shell.keybindings switch-to-application-4 []
gsettings set org.gnome.shell.keybindings switch-to-application-5 []
gsettings set org.gnome.shell.keybindings switch-to-application-6 []
gsettings set org.gnome.shell.keybindings switch-to-application-7 []
gsettings set org.gnome.shell.keybindings switch-to-application-8 []
gsettings set org.gnome.shell.keybindings switch-to-application-9 []
sudo apt get install dconf-editor
dconf-editor
org.gnome.shell.keybindings
然后单击并设置'[]'(可能会删除)sudo apt install xdotool
gedit ~/Tools/ywm.sh
并粘贴剪贴板内容sudo chmod u+x '~/Tools/ywm.sh'
Shortcut
+
按钮bash -c "bash ~/Tools/ywm.sh gnome-terminal"
bash -c "bash ~/Tools/ywm.sh google-chrome"
bash -c "bash ~/Tools/ywm.sh code"
bash -c "bash ~/Tools/ywm.sh nautilus"
bash -c "bash ~/Tools/ywm.sh gedit"
# !/bin/bash
# Window manager script
# Show, hide or create window in the current workspace with It's WM_CLASS
# $1, WM_CLASS
# $2, Optional command
# Copyright © ~ Yunus Emre Ak
# Suppose that these script written in '~/Tools/ywm.sh'
# # Need permission to work as shurtcut
# chmod u+x '~/Tools/ywm.sh'
# Getting windows id if exist
if [ ${#1} -gt 0 ]; then
# Work only in the current workspace
WID=$(xdotool search --desktop $(xdotool get_desktop) --classname $1)
if [ ${#WID} -gt 0 ]; then
# If opened more, find focused one and hide
if [[ "$WID" =~ "$(xdotool getwindowfocus)" ]]; then
xdotool windowminimize $(xdotool getwindowfocus)
else
# Open first windows if not, then try second
let "WID1 = $(echo $WID | awk '{print $1}')"
let "WID2 = $(echo $WID | awk '{print $2}')"
xdotool windowactivate $WID1 || xdotool windowactivate $WID2
fi
else
# If optional exec not exist, execute WM_CLASS
if [ ${#2} -gt 0 ]; then
$2
else
$1
fi
fi
else
echo "Need to get parameter which are 'WM_CLASS' and optional Exec"
echo "Ex: 'bash ywm.sh chrome google-chrome'"
fi
# Shortcuts for favorite app
# bash -c "bash ~/Tools/ywm.sh gnome-terminal" # SUPER + 1
# bash -c "bash ~/Tools/ywm.sh google-chrome" # SUPER + 2
# bash -c "bash ~/Tools/ywm.sh code" # SUPER + 3
# bash -c "bash ~/Tools/ywm.sh nautilus" # SUPER + 4
# bash -c "bash ~/Tools/ywm.sh gedit" # SUPER + 4