This commit is contained in:
nnduc
2026-09-21 19:05:35 +07:00
parent ca45037e65
commit 55cb16f74c
7 changed files with 270 additions and 127 deletions
+3 -4
View File
@@ -10,7 +10,7 @@
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod1
set $wallpaper_dir /sync/images/wallpapers
set $wallpaper_dir /media/sync/images/wallpapers
set $terminal 'alacritty'
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
@@ -29,7 +29,6 @@ exec --no-startup-id dex --autostart --environment i3
#exec --no-startup-id /usr/bin/gnome-keyring-daemon --start --components=gpg,pkcs11,secrets,ssh
# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
# screen before suspend. Use systemctl lock-session to lock your screen.
exec --no-startup-id xrandr --output HDMI-0 --mode 1920x1080 --rate 120
# burn-in prevention: blank after 5min, DPMS off after 10min, skip lock if fullscreen
exec --no-startup-id xset b off
@@ -55,7 +54,7 @@ exec --no-startup-id blueman-applet
exec --no-startup-id /usr/bin/gnome-keyring-daemon --start --components=ssh,pkcs11
exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
exec --no-startup-id ~/.config/i3/scripts/wallpaper-rotate $wallpaper_dir
#exec --no-startup-id pasystray
exec --no-startup-id pasystray
exec --no-startup-id polybar
set $refresh_i3status killall -SIGUSR1 i3status
@@ -260,7 +259,7 @@ bindsym $mod+r mode "resize"
for_window [class="signal"] floating enable
for_window [class="Dino"] floating enable
for_window [class="firefox"] move container to workspace 1
for_window [class="thunderbird"] move container to workspace 4
for_window [class="eu.betterbird.Betterbird"] move container to workspace 4
for_window [class="Thunar"] move container to workspace 3
for_window [class="steam_app_1364781"] border none, fullscreen enable
-95
View File
@@ -1,95 +0,0 @@
#!/usr/bin/env bash
# original source: https://gitlab.com/Nmoleo/i3-volume-brightness-indicator
# changed to use brightnessctl [xbacklight is non functional on modern hardware]
# by joekamprad [Aug 2025]
bar_color="#7f7fff"
volume_step=1
brightness_step=5
max_volume=100
notification_timeout=1000 # in ms
# Uses regex to get volume from pactl
function get_volume {
pactl get-sink-volume @DEFAULT_SINK@ | grep -Po '[0-9]{1,3}(?=%)' | head -1
}
# Uses regex to get mute status from pactl
function get_mute {
pactl get-sink-mute @DEFAULT_SINK@ | grep -Po '(?<=Mute: )(yes|no)'
}
# Uses brightnessctl instead of xbacklight
function get_brightness {
brightnessctl g | awk '{print int($1)}'
# You could also use: brightnessctl info | grep -Po '(?<=Current brightness: )[0-9]+'
}
# Calculates brightness percentage
function get_brightness_percent {
current=$(brightnessctl g)
max=$(brightnessctl m)
percent=$(( 100 * current / max ))
echo $percent
}
function get_volume_icon {
volume=$(get_volume)
mute=$(get_mute)
if [ "$volume" -eq 0 ] || [ "$mute" == "yes" ] ; then
volume_icon=""
elif [ "$volume" -lt 50 ]; then
volume_icon=""
else
volume_icon=""
fi
}
function get_brightness_icon {
brightness_icon=""
}
function show_volume_notif {
volume=$(get_volume)
get_volume_icon
notify-send -i volume_icon -t 1000 "Volume" "$volume_icon $volume%" -h int:value:$volume -h string:x-canonical-private-synchronous:volume
}
function show_brightness_notif {
get_brightness_icon
brightness=$(get_brightness_percent)
notify-send -i brightness_icon -t $notification_timeout -h string:x-dunst-stack-tag:brightness_notif -h int:value:$brightness "$brightness_icon $brightness%"
}
case $1 in
volume_up)
pactl set-sink-mute @DEFAULT_SINK@ 0
volume=$(get_volume)
if [ $(( "$volume" + "$volume_step" )) -gt $max_volume ]; then
pactl set-sink-volume @DEFAULT_SINK@ $max_volume%
else
pactl set-sink-volume @DEFAULT_SINK@ +$volume_step%
fi
show_volume_notif
;;
volume_down)
pactl set-sink-volume @DEFAULT_SINK@ -$volume_step%
show_volume_notif
;;
volume_mute)
pactl set-sink-mute @DEFAULT_SINK@ toggle
show_volume_notif
;;
brightness_up)
brightnessctl s +$brightness_step% > /dev/null
show_brightness_notif
;;
brightness_down)
brightnessctl s $brightness_step%- > /dev/null
show_brightness_notif
;;
esac