feat(waybar): more tooltips
This commit is contained in:
parent
c64aa6e34f
commit
18d425813f
3 changed files with 43 additions and 19 deletions
|
|
@ -46,8 +46,8 @@ animations {
|
||||||
}
|
}
|
||||||
|
|
||||||
input {
|
input {
|
||||||
kb_layout = us,us
|
kb_layout = us,us,us
|
||||||
kb_variant = ,colemak
|
kb_variant = ,dvorak,colemak
|
||||||
follow_mouse = 1
|
follow_mouse = 1
|
||||||
sensitivity = 0
|
sensitivity = 0
|
||||||
touchpad {
|
touchpad {
|
||||||
|
|
@ -104,8 +104,8 @@ bind = , XF86Tools, submap, scripts
|
||||||
submap = scripts
|
submap = scripts
|
||||||
|
|
||||||
bind = , A, exec, ctl audio out
|
bind = , A, exec, ctl audio out
|
||||||
bind = , C, exec, sh -lc 'cliphist list | fuzzel --dmenu --prompt="clip: " | cliphist decode | wl-copy'
|
bind = , C, exec, sh -lc 'cliphist list | fuzzel --dmenu --prompt="clip: " | cliphist decode | wl-copy'
|
||||||
bind = , K, exec, ctl keyboard toggle
|
bind = , K, exec, ctl keyboard next
|
||||||
bind = , O, exec, ctl ocr
|
bind = , O, exec, ctl ocr
|
||||||
bind = , P, exec, hypr pull
|
bind = , P, exec, hypr pull
|
||||||
bind = , S, exec, ctl screenshot
|
bind = , S, exec, ctl screenshot
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ in
|
||||||
format = "";
|
format = "";
|
||||||
tooltip = true;
|
tooltip = true;
|
||||||
tooltip-format = "Keyboard Layout: {long}";
|
tooltip-format = "Keyboard Layout: {long}";
|
||||||
on-click = "ctl keyboard toggle";
|
on-click = "ctl keyboard next";
|
||||||
on-click-right = "ctl keyboard pick";
|
on-click-right = "ctl keyboard pick";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -152,6 +152,7 @@ in
|
||||||
tooltip-format-ethernet = "{ifname} · {ipaddr}";
|
tooltip-format-ethernet = "{ifname} · {ipaddr}";
|
||||||
tooltip-format-disconnected = "disconnected";
|
tooltip-format-disconnected = "disconnected";
|
||||||
on-click = "rfkill toggle wifi";
|
on-click = "rfkill toggle wifi";
|
||||||
|
on-click-right = "ctl wifi pick";
|
||||||
};
|
};
|
||||||
|
|
||||||
battery = {
|
battery = {
|
||||||
|
|
@ -282,6 +283,7 @@ in
|
||||||
ctl = {
|
ctl = {
|
||||||
appname = "ctl";
|
appname = "ctl";
|
||||||
icon_position = "off";
|
icon_position = "off";
|
||||||
|
horizontal_padding = 28;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
50
scripts/ctl
50
scripts/ctl
|
|
@ -45,24 +45,20 @@ ocr)
|
||||||
;;
|
;;
|
||||||
keyboard)
|
keyboard)
|
||||||
case "$2" in
|
case "$2" in
|
||||||
toggle)
|
next)
|
||||||
if [ "${XDG_SESSION_TYPE:-}" = "wayland" ]; then
|
if [ "${XDG_SESSION_TYPE:-}" = "wayland" ]; then
|
||||||
if [ "$XDG_CURRENT_DESKTOP" = "Hyprland" ]; then
|
if [ "$XDG_CURRENT_DESKTOP" = "Hyprland" ]; then
|
||||||
hyprctl switchxkblayout current next
|
hyprctl switchxkblayout current next
|
||||||
elif [ "$XDG_CURRENT_DESKTOP" = "sway" ]; then
|
elif [ "$XDG_CURRENT_DESKTOP" = "sway" ]; then
|
||||||
if swaymsg -t get_inputs | grep -qi "Colemak"; then
|
swaymsg input type:keyboard xkb_switch_layout next
|
||||||
swaymsg input type:keyboard xkb_variant "''"
|
|
||||||
else
|
|
||||||
swaymsg input type:keyboard xkb_variant colemak
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
current="$(setxkbmap -query | awk '/variant/{print $2}')"
|
current="$(setxkbmap -query | awk '/variant/{print $2}')"
|
||||||
if [ "$current" = "colemak" ]; then
|
case "$current" in
|
||||||
setxkbmap -layout us
|
"") setxkbmap -layout us -variant dvorak ;;
|
||||||
else
|
dvorak) setxkbmap -layout us -variant colemak ;;
|
||||||
setxkbmap -layout us -variant colemak
|
*) setxkbmap -layout us ;;
|
||||||
fi
|
esac
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
pick)
|
pick)
|
||||||
|
|
@ -75,13 +71,13 @@ keyboard)
|
||||||
Colemak) variant="colemak" ;;
|
Colemak) variant="colemak" ;;
|
||||||
esac
|
esac
|
||||||
if [ "$XDG_CURRENT_DESKTOP" = "Hyprland" ]; then
|
if [ "$XDG_CURRENT_DESKTOP" = "Hyprland" ]; then
|
||||||
hyprctl keyword input:kb_layout "us,us"
|
hyprctl keyword input:kb_layout "us,us,us"
|
||||||
hyprctl keyword input:kb_variant ",$variant"
|
hyprctl keyword input:kb_variant ",$variant"
|
||||||
hyprctl switchxkblayout current 1
|
hyprctl switchxkblayout current 1
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: ctl keyboard {toggle|pick}" >&2
|
echo "Usage: ctl keyboard {next|pick}" >&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
@ -159,6 +155,32 @@ volume)
|
||||||
fi
|
fi
|
||||||
notify-send -a ctl -t 2500 -r 5556 "$icon $bar"
|
notify-send -a ctl -t 2500 -r 5556 "$icon $bar"
|
||||||
;;
|
;;
|
||||||
|
wifi)
|
||||||
|
case "$2" in
|
||||||
|
pick)
|
||||||
|
require fuzzel
|
||||||
|
station=$(iwctl device list 2>/dev/null | sed 's/\x1b\[[0-9;]*[a-zA-Z]//g' | awk '/station/{print $1}')
|
||||||
|
[ -z "$station" ] && { echo "ctl: no wifi device found" >&2; exit 1; }
|
||||||
|
iwctl station "$station" scan 2>/dev/null
|
||||||
|
sleep 1
|
||||||
|
networks=$(iwctl station "$station" get-networks 2>/dev/null | \
|
||||||
|
sed 's/\x1b\[[0-9;]*[a-zA-Z]//g' | \
|
||||||
|
awk 'NR>4 && /\S/' | \
|
||||||
|
sed 's/^[[:space:]>]*//' | \
|
||||||
|
sed 's/[[:space:]]\{3,\}.*//' | \
|
||||||
|
sed 's/[[:space:]]*$//' | \
|
||||||
|
grep -v '^-')
|
||||||
|
[ -z "$networks" ] && exit 0
|
||||||
|
ssid=$(printf '%s\n' "$networks" | fuzzel --dmenu --prompt="wifi: " --no-icons)
|
||||||
|
[ -z "$ssid" ] && exit 0
|
||||||
|
iwctl station "$station" connect "$ssid"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: ctl wifi {pick}" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
power)
|
power)
|
||||||
require fuzzel
|
require fuzzel
|
||||||
lock=" Lock"
|
lock=" Lock"
|
||||||
|
|
@ -176,7 +198,7 @@ power)
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: ctl {screenshot|ocr|keyboard|audio|brightness|volume|power}" >&2
|
echo "Usage: ctl {screenshot|ocr|keyboard|audio|wifi|brightness|volume|power}" >&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue