dotfiles

:)
git clone https://git.sr.ht/~ashymad/dotfiles
Log | Files | Refs | Submodules | LICENSE

sys (462B)


      1 #!/bin/sh
      2 
      3 which systemctl >/dev/null 2>&1 && ctlcmd=systemctl || ctlcmd=loginctl
      4 
      5 case $1 in
      6     lock)
      7         exec swaylock $(awww query --json | jq -r '."".[] | ("-i\n" + .name + ":" + .displaying.image)') -s fill
      8         ;;
      9     reboot)
     10         exec $ctlcmd reboot
     11         ;;
     12     suspend)
     13         exec $ctlcmd suspend
     14         ;;
     15     poweroff)
     16         exec $ctlcmd poweroff
     17         ;;
     18     *)
     19         echo "Unknown command: '$1'"
     20         exit 1
     21         ;;
     22 esac