From 1988cce97ed8b846769719f050089ec963b219a8 Mon Sep 17 00:00:00 2001 From: nnduc Date: Sat, 4 May 2024 18:30:16 +0700 Subject: [PATCH] Extend for laptop usage --- README.md | 4 ++++ i3/config | 12 ++++++++++- polybar/config.ini | 52 +++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 66 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9a422a8..5e35323 100644 --- a/README.md +++ b/README.md @@ -3,4 +3,8 @@ - i3wm - polybar - tiramisu +- A Nerd Fonts (for icons) +## For brightness and media control: +- brightnessctl (You have to add user to the following groups: video input) +- playerctl ![stones](./screenshots/Screenshot_20240503_095414.png) diff --git a/i3/config b/i3/config index a1daeb5..51b3427 100644 --- a/i3/config +++ b/i3/config @@ -28,7 +28,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 +exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork --ignore-empty-password -i /data/sync/images/wallpapers/stonebeach.png bindsym $mod+l exec i3lock --ignore-empty-password -i /data/sync/images/wallpapers/stonebeach.png bindsym $mod+Shift+p exec loginctl poweroff now @@ -55,6 +55,16 @@ bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status +# Media player key bindings (need media-sound/playerctl for playerctl.) +bindsym XF86AudioPlay exec playerctl play +bindsym XF86AudioPause exec playerctl pause +bindsym XF86AudioNext exec playerctl next +bindsym XF86AudioPrev exec playerctl previous + +# Brightness key bindings +bindsym XF86MonBrightnessUp exec brightnessctl set +5% +bindsym XF86MonBrightnessDown exec brightnessctl set 5%- + # Use Mouse+$mod to drag floating windows to their wanted position floating_modifier $mod diff --git a/polybar/config.ini b/polybar/config.ini index ecd6f4e..3b46400 100644 --- a/polybar/config.ini +++ b/polybar/config.ini @@ -51,7 +51,7 @@ module-margin = 1 separator = | separator-foreground = ${colors.disabled} -font-0 = CaskaydiaCove Nerd Font Mono:pixelsize=14;3 +font-0 = Hack Nerd Font:pixelsize=14;3 modules-left = xworkspaces xwindow modules-right = polytiramisu memory cpu date @@ -116,6 +116,56 @@ date-alt = %Y-%m-%d %H:%M:%S label = %date% label-foreground = ${colors.altprime} +[module/battery] +type = internal/battery +full-at = 99 +low-at = 5 +; Use the following command to list batteries and adapters: +; $ ls -1 /sys/class/power_supply/ +battery = BAT0 +adapter = AC +time-format = %H:%M +label-charging = Charging %percentage%% +label-discharging = Discharging %percentage%% +format-charging = +format-discharging = + +label-full = Fully charged +label-low = BATTERY LOW + +; Only applies if is used +ramp-capacity-0 =  +ramp-capacity-1 =  +ramp-capacity-2 =  +ramp-capacity-3 =  +ramp-capacity-4 =  + +; Only applies if is used +bar-capacity-width = 10 + +; Only applies if is used +animation-charging-0 =  +animation-charging-1 =  +animation-charging-2 =  +animation-charging-3 =  +animation-charging-4 =  +; Framerate in milliseconds +animation-charging-framerate = 750 + +; Only applies if is used +animation-discharging-0 =  +animation-discharging-1 =  +animation-discharging-2 =  +animation-discharging-3 =  +animation-discharging-4 =  +; Framerate in milliseconds +animation-discharging-framerate = 500 + +animation-low-0 = ! +animation-low-1 = +animation-low-framerate = 200 + +poll-interval = 5 [module/polytiramisu] type = custom/script