mirror of
https://git.disroot.org/FollieHiyuki/dotfiles.git
synced 2024-11-25 00:38:23 -05:00
dunst: 1.6.0 config, now works natively on Wayland
This commit is contained in:
parent
452b6aa9e8
commit
ae689b3c15
@ -21,8 +21,9 @@
|
||||
- `setup/` directory contains installers for additional packages.
|
||||
- Stuff I use:
|
||||
- **Text editor:** [Emacs](http://www.gnu.org/software/emacs/) + [Neovim](https://github.com/neovim/neovim)
|
||||
- **Fonts:** [Sarasa Gothic](https://github.com/be5invis/Sarasa-Gothic), [Iosevka Nerd Font](https://github.com/ryanoasis/nerd-fonts)
|
||||
- **Fonts:** [Sarasa Gothic](https://github.com/be5invis/Sarasa-Gothic), [Iosevka Nerd Font](https://github.com/ryanoasis/nerd-fonts), [Iosevka](https://github.com/be5invis/Iosevka)
|
||||
- **Backlight control:** [light](https://github.com/haikarainen/light) / [brightnessctl](https://github.com/Hummer12007/brightnessctl)
|
||||
- **Notification daemon:** [mako](https://github.com/emersion/mako) / [dunst](https://github.com/dunst-project/dunst)
|
||||
- **Clipboard manager:** [greenclip](https://github.com/erebe/greenclip) / [clipman](https://github.com/yory8/clipman)
|
||||
- **Mixer:** [pulsemixer](https://github.com/GeorgeFilipkin/pulsemixer)
|
||||
- **mpris:** [mpDris2](https://github.com/eonpatapon/mpDris2), [mpv-mpris](https://github.com/hoyon/mpv-mpris), [playerctl](https://github.com/altdesktop/playerctl)
|
||||
|
@ -43,7 +43,13 @@ case ${server} in
|
||||
wayland)
|
||||
cp -rfv ./home/.config/foot/ ~/.config/foot/
|
||||
cp -rfv ./home/.config/hikari/ ~/.config/hikari/
|
||||
# Dunst is Wayland native too, since 1.6.0
|
||||
if command -v dunst >/dev/null
|
||||
then
|
||||
cp -rfv ./home/.config/dunst/ ~/.config/dunst/
|
||||
else
|
||||
cp -rfv ./home/.config/mako/ ~/.config/mako/
|
||||
fi
|
||||
cp -rfv ./home/.config/nwg-launchers/ ~/.config/nwg-launchers/
|
||||
cp -rfv ./home/.config/river/ ~/.config/river/
|
||||
cp -rfv ./home/.config/sway/ ~/.config/sway/
|
||||
|
@ -304,15 +304,12 @@
|
||||
(desktop-environment-screenlock-command "~/.local/bin/X11/i3lock.sh"))
|
||||
|
||||
;; Control dunst
|
||||
(defun disable-desktop-notifications ()
|
||||
(defun close-desktop-notifications ()
|
||||
(interactive)
|
||||
(start-process-shell-command "notify-send" nil "notify-send \"DUNST_COMMAND_PAUSE\""))
|
||||
(defun enable-desktop-notifications ()
|
||||
(interactive)
|
||||
(start-process-shell-command "notify-send" nil "notify-send \"DUNST_COMMAND_RESUME\""))
|
||||
(start-process-shell-command "dunstctl" nil "dunstctl close-all"))
|
||||
(defun toggle-desktop-notifications ()
|
||||
(interactive)
|
||||
(start-process-shell-command "notify-send" nil "notify-send \"DUNST_COMMAND_TOGGLE\""))
|
||||
(start-process-shell-command "dunstctl" nil "dunstctl set-paused toggle"))
|
||||
|
||||
;; Clipboard managing with greenclip
|
||||
(defun ivy-greenclip ()
|
||||
|
@ -29,7 +29,24 @@
|
||||
# the top and down respectively.
|
||||
# The width can be negative. In this case the actual width is the
|
||||
# screen width minus the width defined in within the geometry option.
|
||||
geometry = "0x0-5+30"
|
||||
geometry = "0x5-5+30"
|
||||
|
||||
# Turn on the progess bar
|
||||
progress_bar = true
|
||||
|
||||
# Set the progress bar height. This includes the frame, so make sure
|
||||
# it's at least twice as big as the frame width.
|
||||
progress_bar_height = 10
|
||||
|
||||
# Set the frame width of the progress bar
|
||||
progress_bar_frame_width = 1
|
||||
|
||||
# Set the minimum width for the progress bar
|
||||
progress_bar_min_width = 150
|
||||
|
||||
# Set the maximum width for the progress bar
|
||||
progress_bar_max_width = 300
|
||||
|
||||
|
||||
# Show how many messages are currently hidden (because of geometry).
|
||||
indicate_hidden = yes
|
||||
@ -41,7 +58,7 @@
|
||||
# The transparency of the window. Range: [0; 100].
|
||||
# This option will only work if a compositing window manager is
|
||||
# present (e.g. xcompmgr, compiz, etc.).
|
||||
transparency = 5
|
||||
transparency = 0
|
||||
|
||||
# The height of the entire notification. If the height is smaller
|
||||
# than the font height and padding combined, it will be raised
|
||||
@ -59,6 +76,9 @@
|
||||
# Horizontal padding.
|
||||
horizontal_padding = 8
|
||||
|
||||
# Padding between text and icon.
|
||||
text_icon_padding = 2
|
||||
|
||||
# Defines width in pixels of frame around the notification window.
|
||||
# Set to 0 to disable.
|
||||
frame_width = 2
|
||||
@ -102,7 +122,7 @@
|
||||
# <u>underline</u>
|
||||
#
|
||||
# For a complete reference see
|
||||
# <http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
|
||||
# <https://developer.gnome.org/pango/stable/pango-Markup.html>.
|
||||
#
|
||||
# strip: This setting is provided for compatibility with some broken
|
||||
# clients that send markup even though it's not enabled on the
|
||||
@ -134,6 +154,10 @@
|
||||
# Possible values are "left", "center" and "right".
|
||||
alignment = center
|
||||
|
||||
# Vertical alignment of message text and icon.
|
||||
# Possible values are "top", "center" and "bottom".
|
||||
vertical_alignment = center
|
||||
|
||||
# Show age of message if message is older than show_age_threshold
|
||||
# seconds.
|
||||
# Set to -1 to disable.
|
||||
@ -164,6 +188,11 @@
|
||||
# Align icons left/right/off
|
||||
icon_position = left
|
||||
|
||||
# Scale small icons up to this size, set to 0 to disable. Helpful
|
||||
# for e.g. small files or high-dpi screens. In case of conflict,
|
||||
# max_icon_size takes precedence over this.
|
||||
min_icon_size = 0
|
||||
|
||||
# Scale larger icons down to this size, set to 0 to disable
|
||||
max_icon_size = 64
|
||||
|
||||
@ -177,7 +206,7 @@
|
||||
sticky_history = yes
|
||||
|
||||
# Maximum amount of notifications kept in history
|
||||
history_length = 7
|
||||
history_length = 20
|
||||
|
||||
### Misc/Advanced ###
|
||||
|
||||
@ -217,6 +246,22 @@
|
||||
# notification height to avoid clipping text and/or icons.
|
||||
corner_radius = 10
|
||||
|
||||
# Ignore the dbus closeNotification message.
|
||||
# Useful to enforce the timeout set by dunst configuration. Without this
|
||||
# parameter, an application may close the notification sent before the
|
||||
# user defined timeout.
|
||||
ignore_dbusclose = false
|
||||
|
||||
### Wayland ###
|
||||
# These settings are Wayland-specific. They have no effect when using X11
|
||||
|
||||
# Uncomment this if you want to let notications appear under fullscreen
|
||||
# applications (default: overlay)
|
||||
# layer = top
|
||||
|
||||
# Set this to true to use X11 output on Wayland.
|
||||
force_xwayland = false
|
||||
|
||||
### Legacy
|
||||
|
||||
# Use the Xinerama extension instead of RandR for multi-monitor support.
|
||||
@ -231,13 +276,15 @@
|
||||
|
||||
### mouse
|
||||
|
||||
# Defines action of mouse event
|
||||
# Defines list of actions for each mouse event
|
||||
# Possible values are:
|
||||
# * none: Don't do anything.
|
||||
# * do_action: If the notification has exactly one action, or one is marked as default,
|
||||
# invoke it. If there are multiple and no default, open the context menu.
|
||||
# * close_current: Close current notification.
|
||||
# * close_all: Close all notifications.
|
||||
# These values can be strung together for each mouse event, and
|
||||
# will be executed in sequence.
|
||||
mouse_left_click = do_action
|
||||
mouse_middle_click = close_all
|
||||
mouse_right_click = close_current
|
||||
@ -252,6 +299,10 @@
|
||||
# where there are multiple screens with very different dpi values.
|
||||
per_monitor_dpi = false
|
||||
|
||||
# The internal keyboard shortcut support in dunst is now considered deprecated
|
||||
# and should be replaced by dunstctl calls. You can use the configuration of your
|
||||
# WM or DE to bind these to shortcuts of your choice.
|
||||
# Check the dunstctl manual page for more info.
|
||||
[shortcuts]
|
||||
|
||||
# Shortcuts are specified as [modifier+][modifier+]...key
|
||||
@ -259,20 +310,21 @@
|
||||
# "mod3" and "mod4" (windows-key).
|
||||
# Xev might be helpful to find names for keys.
|
||||
|
||||
# Close notification.
|
||||
close = ctrl+space
|
||||
# Close notification. Equivalent dunstctl command:
|
||||
# dunstctl close
|
||||
# close = ctrl+space
|
||||
|
||||
# Close all notifications.
|
||||
close_all = ctrl+shift+space
|
||||
# Close all notifications. Equivalent dunstctl command:
|
||||
# dunstctl close-all
|
||||
# close_all = ctrl+shift+space
|
||||
|
||||
# Redisplay last message(s).
|
||||
# On the US keyboard layout "grave" is normally above TAB and left
|
||||
# of "1". Make sure this key actually exists on your keyboard layout,
|
||||
# e.g. check output of 'xmodmap -pke'
|
||||
history = ctrl+grave
|
||||
# Redisplay last message(s). Equivalent dunstctl command:
|
||||
# dunstctl history-pop
|
||||
# history = ctrl+grave
|
||||
|
||||
# Context menu.
|
||||
context = ctrl+shift+period
|
||||
# Context menu. Equivalent dunstctl command:
|
||||
# dunstctl context
|
||||
# context = ctrl+shift+period
|
||||
|
||||
[urgency_low]
|
||||
# IMPORTANT: colors have to be defined in quotation marks.
|
||||
|
@ -9,7 +9,7 @@ gsettings set org.gnome.desktop.interface cursor-size '24'
|
||||
# Autostart
|
||||
pipewire &
|
||||
mpd &
|
||||
mako -c ~/.config/mako/config &
|
||||
start_notify &
|
||||
wl-paste -t text --watch clipman store &
|
||||
waybar -c ~/.config/waybar/config-generic -s ~/.config/waybar/style-generic.css &
|
||||
mpDris2 &
|
||||
|
@ -8,7 +8,7 @@ riverctl spawn 'wlr-randr --output DP-2 --mode 1920x1080@60.000000Hz --pos -1920
|
||||
|
||||
riverctl spawn 'pipewire'
|
||||
riverctl spawn 'mpd'
|
||||
riverctl spawn 'mako -c ~/.config/mako/config'
|
||||
riverctl spawn 'start_notify'
|
||||
riverctl spawn 'wl-paste -t text --watch clipman store'
|
||||
riverctl spawn 'waybar'
|
||||
riverctl spawn 'swayidle -w before-sleep swaylock'
|
||||
@ -68,7 +68,7 @@ riverctl map normal $mod+Mod1 C spawn clipboard --clear
|
||||
riverctl map normal $mod C spawn clipman clear --tool wofi
|
||||
|
||||
# Dismiss notifications
|
||||
riverctl map normal $mod+Mod1 N spawn makoctl dismiss --all
|
||||
riverctl map normal $mod+Mod1 N spawn dismiss_notify
|
||||
|
||||
# Emacs
|
||||
riverctl map normal $mod+Mod1 E spawn emacsclient -c -a emacs
|
||||
|
@ -80,7 +80,7 @@ input * xkb_numlock enable
|
||||
#
|
||||
exec pipewire
|
||||
exec mpd
|
||||
exec mako -c ~/.config/mako/config
|
||||
exec start_notify
|
||||
exec wl-paste -t text --watch clipman store
|
||||
exec swayidle -w \
|
||||
timeout 300 'swaylock' \
|
||||
@ -205,7 +205,7 @@ bindsym Print exec screenshot --region
|
||||
bindsym $mod+Print exec screenshot --full
|
||||
|
||||
# Dismiss notifications
|
||||
bindsym $mod+Mod1+n exec makoctl dismiss --all
|
||||
bindsym $mod+Mod1+n exec dismiss_notify
|
||||
|
||||
# Emacs
|
||||
bindsym $mod+Mod1+e exec emacsclient -c -a emacs
|
||||
|
@ -98,7 +98,7 @@ modifier = <super> <alt>
|
||||
autostart_wf_shell = false
|
||||
|
||||
# Notifications
|
||||
notifications = mako -c ~/.config/mako/config
|
||||
notifications = start_notify
|
||||
|
||||
# The bar
|
||||
bar = waybar -c ~/.config/waybar/config-generic -s ~/.config/waybar/style-generic.css
|
||||
|
3
home/.local/bin/Wayland/dismiss_notify
Executable file
3
home/.local/bin/Wayland/dismiss_notify
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
makoctl dismiss --all 2>/dev/null || dunstctl close-all
|
8
home/.local/bin/Wayland/start_notify
Executable file
8
home/.local/bin/Wayland/start_notify
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
if command -v mako >/dev/null
|
||||
then
|
||||
mako -c ~/.config/mako/config &
|
||||
else
|
||||
dunst &
|
||||
fi
|
@ -1,25 +1,37 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
if [ -z "$WAYLAND_DISPLAY" ]; then
|
||||
notification=dunst
|
||||
else
|
||||
notification=mako
|
||||
fi
|
||||
_notify_brightness() {
|
||||
if command -v mako >/dev/null
|
||||
then
|
||||
icon="$HOME/.config/mako/idea.png"
|
||||
else
|
||||
icon="$HOME/.config/dunst/idea.png"
|
||||
fi
|
||||
notify-send -h string:x-canonical-private-synchronous:brightness "Brightness: $1%" -h int:value:"$1" -i "${icon}"
|
||||
}
|
||||
|
||||
case $1 in
|
||||
up)
|
||||
if command -v light >/dev/null
|
||||
then
|
||||
light -A 5 > /dev/null && notify-send -i ~/.config/${notification}/idea.png "Brightness: $(light -G | cut -d '.' -f 1)%"
|
||||
light -A 5 >/dev/null
|
||||
brightness="$(light -G | cut -d '.' -f 1)"
|
||||
_notify_brightness "$brightness"
|
||||
else
|
||||
brightnessctl set 5%+ >/dev/null && notify-send -i ~/.config/${notification}/idea.png "Brightness: $(brightnessctl i | grep '%' | awk -F'(' '{print $2}' | awk -F'%' '{print $1}')%"
|
||||
brightnessctl set 5%+ >/dev/null
|
||||
brightness="$(brightnessctl i | grep '%' | awk -F'(' '{print $2}' | awk -F'%' '{print $1}')"
|
||||
_notify_brightness "$brightness"
|
||||
fi ;;
|
||||
down)
|
||||
if command -v light >/dev/null
|
||||
then
|
||||
light -U 5 > /dev/null && notify-send -i ~/.config/${notification}/idea.png "Brightness: $(light -G | cut -d '.' -f 1)%"
|
||||
light -U 5 >/dev/null
|
||||
brightness="$(light -G | cut -d '.' -f 1)"
|
||||
_notify_brightness "$brightness"
|
||||
else
|
||||
brightnessctl set 5%- >/dev/null && notify-send -i ~/.config/${notification}/idea.png "Brightness: $(brightnessctl i | grep '%' | awk -F'(' '{print $2}' | awk -F'%' '{print $1}')%"
|
||||
brightnessctl set 5%- >/dev/null
|
||||
brightness="$(brightnessctl i | grep '%' | awk -F'(' '{print $2}' | awk -F'%' '{print $1}')"
|
||||
_notify_brightness "$brightness"
|
||||
fi ;;
|
||||
*)
|
||||
;;
|
||||
|
@ -4,7 +4,7 @@ DIR_COLORSCRIPTS="$HOME/.local/bin/colorscripts"
|
||||
list_colorscripts="$(/usr/bin/ls "${DIR_COLORSCRIPTS}" | cut -d ' ' -f 1 | nl)"
|
||||
length_colorscripts="$(/usr/bin/ls "${DIR_COLORSCRIPTS}" | wc -l)"
|
||||
|
||||
function _random() {
|
||||
_random() {
|
||||
declare -i random_index=$RANDOM%$length_colorscripts
|
||||
[[ $random_index -eq 0 ]] && random_index=1
|
||||
|
||||
|
@ -1,57 +1,54 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -z "$WAYLAND_DISPLAY" ]
|
||||
if command -v mako >/dev/null
|
||||
then
|
||||
notification=dunst
|
||||
else
|
||||
notification=mako
|
||||
else
|
||||
notification=dunst
|
||||
fi
|
||||
|
||||
# Use pulseaudio backend first (pulsemixer)
|
||||
if command -v pulsemixer >/dev/null
|
||||
then
|
||||
_notify() {
|
||||
_notify_volume() {
|
||||
volume=$(pulsemixer --get-volume)
|
||||
# I only have 2 channels :)
|
||||
left=$(echo "$volume" | cut -d' ' -f1)
|
||||
right=$(echo "$volume" | cut -d' ' -f2)
|
||||
average=$(((left+right)/2))
|
||||
notify-send -i "$HOME/.config/${notification}/speaker.png" "Volume: $average%"
|
||||
# 2 channels
|
||||
left=$(echo "${volume}" | cut -d' ' -f1)
|
||||
right=$(echo "${volume}" | cut -d' ' -f2)
|
||||
|
||||
notify-send -h string:x-canonical-private-synchronous:audio -h int:value:"${left}" -i "$HOME/.config/${notification}/speaker.png" "Volume: L:${left}% / R:${right}%"
|
||||
}
|
||||
|
||||
case $1 in
|
||||
increase)
|
||||
pulsemixer --change-volume +5 && _notify
|
||||
pulsemixer --change-volume +5 && _notify_volume
|
||||
;;
|
||||
decrease)
|
||||
pulsemixer --change-volume -5 && _notify
|
||||
pulsemixer --change-volume -5 && _notify_volume
|
||||
;;
|
||||
toggle)
|
||||
pulsemixer --toggle-mute
|
||||
status=$(pulsemixer --get-mute)
|
||||
if [ "$status" -eq 1 ] || [ "$status" = "true" ]
|
||||
if [ "${status}" -eq 1 ] || [ "${status}" = "true" ]
|
||||
then
|
||||
notify-send -i "$HOME/.config/${notification}/mute.png" "Sound muted"
|
||||
else
|
||||
notify-send -i "$HOME/.config/${notification}/speaker.png" "Sound unmuted"
|
||||
fi
|
||||
;;
|
||||
fi ;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
# Then fallback to the ALSA one (alsamixer + amixer)
|
||||
else
|
||||
_notify_alsa() {
|
||||
_notify_volume() {
|
||||
volume=$(amixer get Master | sed -nre 's/.*\\[(.*%)\\].*/\\1/p')
|
||||
notify-send -i "$HOME/.config/${notification}/speaker.png" "Volume: $volume"
|
||||
notify-send -h string:x-canonical-private-synchronous:audio -h int:value:"${volume}" -i "$HOME/.config/${notification}/speaker.png" "Volume: ${volume}"
|
||||
}
|
||||
|
||||
case $1 in
|
||||
increase)
|
||||
amixer set Master 5+ && _notify_alsa
|
||||
amixer set Master 5+ && _notify_volume
|
||||
;;
|
||||
decrease)
|
||||
amixer set Master 5- && _notify_alsa
|
||||
amixer set Master 5- && _notify_volume
|
||||
;;
|
||||
toggle)
|
||||
amixer set Master toggle
|
||||
@ -60,8 +57,7 @@ else
|
||||
notify-send -i "$HOME/.config/${notification}/mute.png" "Sound muted"
|
||||
else
|
||||
notify-send -i "$HOME/.config/${notification}/speaker.png" "Sound unmuted"
|
||||
fi
|
||||
;;
|
||||
fi ;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
Loading…
Reference in New Issue
Block a user