Skip to content

Instantly share code, notes, and snippets.

@bulatenkom
bulatenkom / toggle_chatgpt-window.sh
Last active March 14, 2024 13:56
[Xorg, KDE, custom shortcuts] Script to focus/hide separate chrome window with opened ChatGPT
#!/usr/bin/env sh
get_active_desktop_num() {
wmctrl -d | awk '/*/{print NR-1}'
}
if wmctrl -l | grep -Eq "$(get_active_desktop_num) $(hostname) ChatGPTxyz"; then
# Hide (move window to unused virtual desktop)
wmctrl -r ChatGPTxyz -t 5
else