Skip to content

Instantly share code, notes, and snippets.

@aberranthacker
aberranthacker / hotkey.sh
Last active April 28, 2018 08:09
Modified version of script from http://akuederle.com/windows-like-appshortcuts-in-linux to set Win+n keybindings to behave like in Windows
#!/bin/sh
desk_id=$(xdotool get_desktop)
apps_table=$(wmctrl -lx | awk -v desk_id=$desk_id '$2==desk_id {print $0}')
win_id=$(printf '%x' $(xdotool getactivewindow))
active_window_class=$(echo "$apps_table" | awk -v id=$win_id '$0 ~ id {print $3}')
if [[ "$active_window_class" = "$2" ]];
then
xdotool getactivewindow windowminimize;
else