Remove stupid dependencies (picom,dunst), notification in unix way (tiramisu).

Rebinding some keys.
This commit is contained in:
nnduc 2024-05-03 09:57:17 +07:00
parent 40c577abdf
commit 995676fdc5
5 changed files with 41 additions and 13 deletions

View File

@ -2,6 +2,5 @@
## Dependencies
- i3wm
- polybar
- picom
- dunst
![stones](./screenshots/Screenshot_20240501_233812.png)
- tiramisu
![stones](./screenshots/Screenshot_20240503_095414.png)

View File

@ -29,7 +29,7 @@ exec --no-startup-id dex --autostart --environment i3
# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
# screen before suspend. Use loginctl lock-session to lock your screen.
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
bindsym $mod+l exec i3lock --ignore-empty-password -i /usr/share/wallpapers/Next/contents/images/1920x1080.png
bindsym $mod+l exec i3lock --ignore-empty-password -i /data/sync/images/wallpapers/stonebeach.png
bindsym $mod+Shift+p exec loginctl poweroff now
bindsym $mod+Shift+o exec loginctl reboot now
@ -45,13 +45,11 @@ exec --no-startup-id feh --bg-fill '/data/sync/images/wallpapers/stonebeach.jpg'
exec --no-startup-id nextcloud
exec --no-startup-id pasystray
exec --no-startup-id nohup gentoo-pipewire-launcher restart >/dev/null 2>&1 &
# Use pactl to adjust volume in PulseAudio.
exec --no-startup-id polybar
exec --no-startup-id picom --config ~/.config/picom/picom.conf -b
exec --no-startup-id dunst -conf ~/.config/dunst/dunst.rc
set $refresh_i3status killall -SIGUSR1 i3status
# Use pactl to adjust volume in PulseAudio.
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5% && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5% && $refresh_i3status
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
@ -114,7 +112,8 @@ bindsym $mod+h split h
bindsym $mod+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
bindsym $mod+f floating toggle
bindsym $mod+Shift+space fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
@ -122,7 +121,6 @@ bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle

View File

@ -53,9 +53,8 @@ separator-foreground = ${colors.disabled}
font-0 = CaskaydiaCove Nerd Font Mono:pixelsize=14;3
modules-left = xworkspaces xwindow
modules-right = memory cpu date
# filesystem
modules-left = xworkspaces xwindow
modules-right = polytiramisu memory cpu date
cursor-click = pointer
cursor-scroll = ns-resize
@ -118,6 +117,13 @@ date-alt = %Y-%m-%d %H:%M:%S
label = %date%
label-foreground = ${colors.altprime}
[module/polytiramisu]
type = custom/script
# Path to where you put polytiramisu.sh:
exec = ~/.config/polybar/scripts/polytiramisu.sh
format = <label>
tail = true
[settings]
screenchange-reload = true
pseudo-transparency = true

25
polybar/scripts/polytiramisu.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/sh
# Show tiramisu notifications in polybar.
# How many seconds notification is displayed:
display_duration=7.0
# Maximum number of characters:
char_limit=150
# Stop old tiramisu processes if any:
pgrep -x tiramisu >/dev/null && killall tiramisu
# Start a new tiramisu process:
tiramisu -o '#summary #body' |
while read -r line; do
# Cut notification by character limit:
if [ "${#line}" -gt "$char_limit" ]; then
line="$(echo "$line" | cut -c1-$((char_limit-1)))"
fi
# Display notification for the duration time:
echo "$line"
sleep "$display_duration"
echo " "
done

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB