Revert: I've found a way to keep dunst and notify about yubikey in the statusbar.
This commit is contained in:
parent
b45a8b3c70
commit
ee352e389e
@ -28,7 +28,7 @@ set_input() {
|
|||||||
set_bt_profile() {
|
set_bt_profile() {
|
||||||
bt_sink=$(pactl list cards | awk -F'"' '/device.name.*bluez/ {print $2}')
|
bt_sink=$(pactl list cards | awk -F'"' '/device.name.*bluez/ {print $2}')
|
||||||
[ -z "${bt_sink}" ] &&
|
[ -z "${bt_sink}" ] &&
|
||||||
{ notify-send -t 1000 "ﳌ no headphones connected"; exit; }
|
{ dunstify -u critical "ﳌ no headphones connected"; exit; }
|
||||||
profile_chosen=$(printf "profile mSBC\\nprofile LDAC\\n$div\\nback\\nexit" | dmenu -c -l 5 -i)
|
profile_chosen=$(printf "profile mSBC\\nprofile LDAC\\n$div\\nback\\nexit" | dmenu -c -l 5 -i)
|
||||||
case "$profile_chosen" in
|
case "$profile_chosen" in
|
||||||
back) show_current ;;
|
back) show_current ;;
|
||||||
@ -47,7 +47,7 @@ show_current() {
|
|||||||
chosen=$(printf "Output: $def_snk\\nInput: $def_src" | dmenu -c -l 2)
|
chosen=$(printf "Output: $def_snk\\nInput: $def_src" | dmenu -c -l 2)
|
||||||
if [ "$1" = "no_switch" ]; then
|
if [ "$1" = "no_switch" ]; then
|
||||||
case "$chosen" in
|
case "$chosen" in
|
||||||
*) notify-send -t 1000 -t 1000 "婢 no device to switch" ;;
|
*) dunstify -u critical "婢 no device to switch" ;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
case "$chosen" in
|
case "$chosen" in
|
||||||
|
@ -40,6 +40,7 @@ onescreen() {
|
|||||||
|
|
||||||
postrun() {
|
postrun() {
|
||||||
feh --no-fehbg --bg-scale ~/.local/share/wallpaper.jpg
|
feh --no-fehbg --bg-scale ~/.local/share/wallpaper.jpg
|
||||||
|
{ killall dunst ; setsid -f dunst ;} >/dev/null 2>&1 # Restart dunst to ensure proper location on screen
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get all possible displays
|
# Get all possible displays
|
||||||
@ -50,7 +51,7 @@ screens=$(echo "$allposs" | awk '/ connected/ {print $1}')
|
|||||||
|
|
||||||
# If there's only one screen
|
# If there's only one screen
|
||||||
[ "$(echo "$screens" | wc -l)" -lt 2 ] &&
|
[ "$(echo "$screens" | wc -l)" -lt 2 ] &&
|
||||||
{ onescreen "$screens" "native"; postrun; notify-send -t 1000 ' no device to switch'; exit ;}
|
{ onescreen "$screens" "native"; postrun; dunstify -u critical ' no device to switch'; exit ;}
|
||||||
|
|
||||||
# Get user choice including both and manual selection:
|
# Get user choice including both and manual selection:
|
||||||
chosen=$(printf -- "%s\\nmulti" "$screens" | dmenu -c -l 5 -i -p "select output") &&
|
chosen=$(printf -- "%s\\nmulti" "$screens" | dmenu -c -l 5 -i -p "select output") &&
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
icon='\uf028'
|
|
||||||
if [ $1 ]; then
|
if [ $1 ]; then
|
||||||
case $1 in
|
case $1 in
|
||||||
inc) pactl set-sink-volume @DEFAULT_SINK@ +5%;;
|
inc) pactl set-sink-volume @DEFAULT_SINK@ +5%;;
|
||||||
dec) pactl set-sink-volume @DEFAULT_SINK@ -5%;;
|
dec) pactl set-sink-volume @DEFAULT_SINK@ -5%;;
|
||||||
esac
|
esac
|
||||||
volume=$(pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | awk -F' / *' '{print $2}')
|
volume=$(pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | awk -F' / *' '{print $2}')
|
||||||
notify-send -t 1000 " volume: $volume"
|
dunstify -u low -h int:value:$volume -r 20 -t 800 "volume: $volume"
|
||||||
else
|
else
|
||||||
mic=$(pactl get-source-volume @DEFAULT_SOURCE@ | awk -F' / ' '{print $2}' | tr -d '%')
|
mic=$(pactl get-source-volume @DEFAULT_SOURCE@ | awk -F' / ' '{print $2}' | tr -d '%')
|
||||||
[ $(pactl get-source-mute @DEFAULT_SOURCE@ | awk -F': ' '{print $2}') = yes ] || [ "$mic" -eq 0 ] && micmute="<span foreground='#ffffff' background='#770000'> \uf131 </span> " || micmute=""
|
[ $(pactl get-source-mute @DEFAULT_SOURCE@ | awk -F': ' '{print $2}') = yes ] || [ "$mic" -eq 0 ] && micmute="<span foreground='#ffffff' background='#770000'> \uf131 </span> " || micmute=""
|
||||||
|
@ -328,26 +328,26 @@
|
|||||||
# IMPORTANT: colors have to be defined in quotation marks.
|
# IMPORTANT: colors have to be defined in quotation marks.
|
||||||
# Otherwise the "#" and following would be interpreted as a comment.
|
# Otherwise the "#" and following would be interpreted as a comment.
|
||||||
background = "#272822"
|
background = "#272822"
|
||||||
foreground = "#feffff"
|
foreground = "#c7c7c7"
|
||||||
highlight = "#feffff"
|
highlight = "#c7c7c7"
|
||||||
frame_color = "#272822"
|
frame_color = "#c7c7c7"
|
||||||
timeout = 1
|
timeout = 1
|
||||||
# Icon for notifications with low urgency, uncomment to enable
|
# Icon for notifications with low urgency, uncomment to enable
|
||||||
#icon = /path/to/icon
|
#icon = /path/to/icon
|
||||||
|
|
||||||
[urgency_normal]
|
[urgency_normal]
|
||||||
background = "#e8b923"
|
background = "#272822"
|
||||||
foreground = "#272822"
|
foreground = "#feffff"
|
||||||
highlight = "#feffff"
|
highlight = "#feffff"
|
||||||
frame_color = "#272822"
|
frame_color = "#feffff"
|
||||||
timeout = 2
|
timeout = 2
|
||||||
# Icon for notifications with normal urgency, uncomment to enable
|
# Icon for notifications with normal urgency, uncomment to enable
|
||||||
#icon = /path/to/icon
|
#icon = /path/to/icon
|
||||||
|
|
||||||
[urgency_critical]
|
[urgency_critical]
|
||||||
background = "#770000"
|
background = "#770000"
|
||||||
foreground = "#ffffff"
|
foreground = "#feffff"
|
||||||
frame_color = "#770000"
|
frame_color = "#feffff"
|
||||||
timeout = 2
|
timeout = 2
|
||||||
# Icon for notifications with critical urgency, uncomment to enable
|
# Icon for notifications with critical urgency, uncomment to enable
|
||||||
#icon = /path/to/icon
|
#icon = /path/to/icon
|
||||||
|
@ -128,19 +128,14 @@ screens = [
|
|||||||
record_history=False,
|
record_history=False,
|
||||||
),
|
),
|
||||||
widget.Spacer(),
|
widget.Spacer(),
|
||||||
widget.Notify(
|
widget.GenPollText(
|
||||||
default_timeout=5,
|
update_interval=0.5,
|
||||||
background="#e8b923",
|
func=lambda: subprocess.check_output("sb-yubikey").decode(),
|
||||||
foreground="#000000",
|
|
||||||
),
|
),
|
||||||
widget.GenPollText(
|
widget.GenPollText(
|
||||||
update_interval=1,
|
update_interval=1,
|
||||||
func=lambda: subprocess.check_output("sb-mail").decode(),
|
func=lambda: subprocess.check_output("sb-mail").decode(),
|
||||||
),
|
),
|
||||||
widget.GenPollText(
|
|
||||||
update_interval=0.5,
|
|
||||||
func=lambda: subprocess.check_output("sb-volume").decode(),
|
|
||||||
),
|
|
||||||
widget.GenPollText(
|
widget.GenPollText(
|
||||||
update_interval=1,
|
update_interval=1,
|
||||||
func=lambda: subprocess.check_output("sb-network").decode(),
|
func=lambda: subprocess.check_output("sb-network").decode(),
|
||||||
|
Loading…
Reference in New Issue
Block a user