#!/usr/bin/env sh if ! exist kanshictl; then printf "Requires command 'kanshictl' on system." exit 1 fi picker=dmenu if exist bemenu; then picker=bemenu elif exist wofi; then picker=wofi elif exist rofi; then picker=rofi fi regex='s/profile \+\(.*\) \+{/\1/p' list=$(sed -ne "$regex" "${XDG_CONFIG_HOME:-~/.config}/kanshi/config") profile=$(printf "%s" "$list" | "$picker") if [ -z "$profile" ]; then return else kanshictl switch "$profile" fi if [ "$1" = '-v' ]; then notify-send "Kanshi profile set" "Set to: $profile" fi