Skip to content

Instantly share code, notes, and snippets.

@blackjack75
Last active April 10, 2024 12:43
Show Gist options
  • Save blackjack75/731f54cc2f26234e7e5530f13d3a0704 to your computer and use it in GitHub Desktop.
Save blackjack75/731f54cc2f26234e7e5530f13d3a0704 to your computer and use it in GitHub Desktop.
Resize and remove window decoration on PopOS and Linux desktops (from stack overflow) . Last commented lines show usage example.
#!/usr/bin/env zsh
wait_find_window_id() {
while true; do
window_id=$(wmctrl -l | grep "$1" | awk '{print $1}')
if [ -n "$window_id" ]; then
echo "$window_id"
return
fi
sleep 0.05
done
}
fix_window() {
#hide title bar
xprop -f _MOTIF_WM_HINTS 32c -set _MOTIF_WM_HINTS "0x2, 0x0, 0x0, 0x0, 0x0" -id $1
}
resize_window() {
#resize
wmctrl -i -r "$1" -e 0,"$2","$3","$4","$5"
}
#window_id=$(wait_find_window_id "$window_name")
#echo "Window '$window_name' found with ID: $window_id"
#resize_window "$window_id" "$new_x" "$new_y" "$new_width" "$new_height"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment