Skip to content

Instantly share code, notes, and snippets.

@lamcw
Last active December 11, 2019 06:02
Show Gist options
  • Save lamcw/bd03fd0ce969a621ec82f1b51023aa35 to your computer and use it in GitHub Desktop.
Save lamcw/bd03fd0ce969a621ec82f1b51023aa35 to your computer and use it in GitHub Desktop.
Sway display toggle
#!/bin/sh
is_active=$(swaymsg -t get_outputs | jq ".. | select(.name? == \"${1}\") | .active")
if [ $is_active = "false" ]
then
swaymsg "output ${1} enable"
else
swaymsg "output ${1} disable"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment