Skip to content
Snippets Groups Projects
Verified Commit 0ff9306f authored by Legy (Beini)'s avatar Legy (Beini)
Browse files

Fix run-sway script to work with more complex status commands

parent b88804d4
No related branches found
No related tags found
No related merge requests found
......@@ -3,17 +3,18 @@
set -e
set -u
readonly default_bar_command="$(swaymsg -t get_bar_config bar-0 | jq --raw-output .status_command)"
readonly executable_name=qbar
readonly sway_bar_id=bar-0
readonly default_bar_command="$(swaymsg -t get_bar_config "$sway_bar_id" | jq .status_command)"
stack build
readonly temp_dir=$(mktemp -d)
readonly stderr=$temp_dir/stderr
mkfifo $stderr
trap "swaymsg bar $sway_bar_id status_command $default_bar_command; rm -rf $temp_dir" EXIT INT HUP TERM
trap "swaymsg bar $sway_bar_id status_command '$default_bar_command'; rm -rf $temp_dir" EXIT INT HUP TERM
swaymsg bar $sway_bar_id status_command "exec $(stack path --local-install-root)/bin/$executable_name $@ -- server 2> $stderr"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment