Skip to content

Instantly share code, notes, and snippets.

@avalonv
Last active October 28, 2023 03:55
Show Gist options
  • Select an option

  • Save avalonv/04aec5ff61991822efdb7b16ee8d0c21 to your computer and use it in GitHub Desktop.

Select an option

Save avalonv/04aec5ff61991822efdb7b16ee8d0c21 to your computer and use it in GitHub Desktop.
i3_togglesticky
#!/usr/bin/env bash
# toggle sticky for focused window
# requires xdotool
state=enabled
mywindow=$(xdotool getactivewindow)
if [[ $state == 'enabled' ]]; then
i3-msg "[id=$mywindow] sticky disable"
sed -i '5s/.*/state=disabled/' $0
else
i3-msg "[id=$mywindow] sticky enable"
sed -i '5s/.*/state=enabled/' $0
fi
@avalonv

avalonv commented May 26, 2019

Copy link
Copy Markdown
Author

this is no longer needed as i3 now natively supports sticky toggle
(maybe it was available all along? maybe im dumb >.>)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment