From 399e639bac51a6bb1a32c6a05291979e38406fee Mon Sep 17 00:00:00 2001 From: Tran Hau Date: Sun, 4 Apr 2021 16:39:21 +0700 Subject: [PATCH] chore(config): add volume i3status --- config/i3/config | 27 ++------------------------- config/i3status/config | 12 ++++++------ 2 files changed, 8 insertions(+), 31 deletions(-) diff --git a/config/i3/config b/config/i3/config index 7fa3a96..e7ce683 100644 --- a/config/i3/config +++ b/config/i3/config @@ -2,21 +2,16 @@ set $mod Mod4 -# Font for window titles. Will also be used by the bar unless a different font -# is used in the bar {} block below. font pango:Cascadia Code 12 -# The combination of xss-lock, nm-applet and pactl is a popular choice, so -# they are included here as an example. Modify as you see fit. - # 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 # Use pactl to adjust volume in PulseAudio. set $refresh_i3status killall -SIGUSR1 i3status -bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status -bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status +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 bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status @@ -33,24 +28,12 @@ bindsym $mod+Shift+q kill bindsym $mod+d exec "rofi -combi-modi window,drun -show combi" # change focus -bindsym $mod+j focus left -bindsym $mod+k focus down -bindsym $mod+l focus up -bindsym $mod+semicolon focus right - -# alternatively, you can use the cursor keys: bindsym $mod+Left focus left bindsym $mod+Down focus down bindsym $mod+Up focus up bindsym $mod+Right focus right # move focused window -bindsym $mod+Shift+j move left -bindsym $mod+Shift+k move down -bindsym $mod+Shift+l move up -bindsym $mod+Shift+semicolon move right - -# alternatively, you can use the cursor keys: bindsym $mod+Shift+Left move left bindsym $mod+Shift+Down move down bindsym $mod+Shift+Up move up @@ -134,12 +117,6 @@ mode "resize" { # Pressing right will grow the window’s width. # Pressing up will shrink the window’s height. # Pressing down will grow the window’s height. - bindsym j resize shrink width 10 px or 10 ppt - bindsym k resize grow height 10 px or 10 ppt - bindsym l resize shrink height 10 px or 10 ppt - bindsym semicolon resize grow width 10 px or 10 ppt - - # same bindings, but for the arrow keys bindsym Left resize shrink width 10 px or 10 ppt bindsym Down resize grow height 10 px or 10 ppt bindsym Up resize shrink height 10 px or 10 ppt diff --git a/config/i3status/config b/config/i3status/config index 8a14134..55b2538 100644 --- a/config/i3status/config +++ b/config/i3status/config @@ -6,11 +6,11 @@ general { order += "wireless _first_" order += "ethernet _first_" order += "battery all" -order += "memory" +order += "volume master" order += "tztime local" wireless _first_ { - format_up = "Wifi: %quality at %essid" + format_up = "Wifi: %essid" format_down = "Wifi: down" } @@ -23,10 +23,10 @@ battery all { format = "%status %percentage %remaining" } -memory { - format = "Used %used Avail %available" - threshold_degraded = "1G" - format_degraded = "MEMORY < %available" +volume master { + format = "Sound: %volume" + format_muted = "Sound: muted (%volume)" + device = "pulse" } tztime local {