Posts

Showing posts from April, 2024

dmmsh-wlr for managing outputs in Wayland using wlr-randr

Managing outputs in Wayland is smooth and easy by using wlr-randr while some compositors such as sway and hyprland have their own tools to manage outputs. See: sway-output(5) man page and Monitors - Hyprland Wiki respectively. To automate managing the outputs, the following dash script is provided by mshii. #!/bin/dash # check if it is run as root and exit if [ $(($(id -u))) -eq 0 ]; then exit 0 fi # test if it is already running and exit SCRIPTNAME= " $(basename -- $0) " if pidof -x " $SCRIPTNAME " -o $$ > /dev/null 2>&1; then notify-send -t 2700 "clean exit" "the script is already running" exit 0 fi # chech if it is in terminal or exit isinterminal_func () { case " $(ps -o stat= -p $$) " in *+*) echo "in terminal, continue..." ;; *) notify-send -t 2700 "clean exit" "please run it in terminal." ; exit 0 ;; esac } # simp...