mirror of
				https://github.com/AquaMorph/dotfiles.git
				synced 2025-11-04 09:13:18 +00:00 
			
		
		
		
	Battery percentage
This commit is contained in:
		@@ -72,6 +72,11 @@ bindsym $mod+space focus mode_toggle
 | 
				
			|||||||
# focus the parent container
 | 
					# focus the parent container
 | 
				
			||||||
bindsym $mod+a focus parent
 | 
					bindsym $mod+a focus parent
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# media controls
 | 
				
			||||||
 | 
					bindsym Ctrl+Left exec playerctl previous
 | 
				
			||||||
 | 
					bindsym Ctrl+Down exec playerctl play-pause
 | 
				
			||||||
 | 
					bindsym Ctrl+Right exec playerctl next
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Gaps
 | 
					# Gaps
 | 
				
			||||||
set $inner 16
 | 
					set $inner 16
 | 
				
			||||||
set $outer 0
 | 
					set $outer 0
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -37,7 +37,7 @@ font-5 = Font Awesome 5 Free Solid:pixelsize=70;3
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
modules-left = i3
 | 
					modules-left = i3
 | 
				
			||||||
modules-center = xwindow
 | 
					modules-center = xwindow
 | 
				
			||||||
modules-right = backlight volume network battery date
 | 
					modules-right = backlight volume network battery mouse-battery date
 | 
				
			||||||
 | 
					
 | 
				
			||||||
tray-position = right
 | 
					tray-position = right
 | 
				
			||||||
tray-padding = 2
 | 
					tray-padding = 2
 | 
				
			||||||
@@ -47,42 +47,26 @@ type = internal/xwindow
 | 
				
			|||||||
label = %title:0:80:...%
 | 
					label = %title:0:80:...%
 | 
				
			||||||
format-background = ${colors.black}
 | 
					format-background = ${colors.black}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[module/bspwm]
 | 
					 | 
				
			||||||
type = internal/bspwm
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
label-focused = %index%
 | 
					 | 
				
			||||||
label-focused-background = ${colors.blue}
 | 
					 | 
				
			||||||
label-focused-underline= ${colors.pink}
 | 
					 | 
				
			||||||
label-focused-padding = 2
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
label-occupied = %index%
 | 
					 | 
				
			||||||
label-occupied-padding = 2
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
label-urgent = %index%!
 | 
					 | 
				
			||||||
label-urgent-background = ${colors.alert}
 | 
					 | 
				
			||||||
label-urgent-padding = 2
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
label-empty = %index%
 | 
					 | 
				
			||||||
label-empty-foreground = ${colors.foreground-alt}
 | 
					 | 
				
			||||||
label-empty-padding = 2
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[module/i3]
 | 
					[module/i3]
 | 
				
			||||||
type = internal/i3
 | 
					type = internal/i3
 | 
				
			||||||
format = <label-state> <label-mode>
 | 
					format = <label-state> <label-mode>
 | 
				
			||||||
index-sort = true
 | 
					index-sort = true
 | 
				
			||||||
wrapping-scroll = false
 | 
					wrapping-scroll = false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					strip-wsnumbers = true
 | 
				
			||||||
 | 
					fuzzy-match = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
label-mode-padding = 2
 | 
					label-mode-padding = 2
 | 
				
			||||||
label-mode-foreground = #000
 | 
					label-mode-foreground = #000
 | 
				
			||||||
label-mode-background = ${colors.pink}
 | 
					label-mode-background = ${colors.pink}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
label-focused = %index%
 | 
					label-focused = %index%
 | 
				
			||||||
label-focused-background = ${module/bspwm.label-focused-background}
 | 
					label-focused-background = ${colors.blue}
 | 
				
			||||||
label-focused-underline = ${module/bspwm.label-focused-underline}
 | 
					label-focused-underline = ${colors.pink}
 | 
				
			||||||
label-focused-padding = ${module/bspwm.label-focused-padding}
 | 
					label-focused-padding = 2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
label-unfocused = %index%
 | 
					label-unfocused = %index%
 | 
				
			||||||
label-unfocused-padding = ${module/bspwm.label-occupied-padding}
 | 
					label-unfocused-padding = 2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
label-visible = %index%
 | 
					label-visible = %index%
 | 
				
			||||||
label-visible-background = ${self.label-focused-background}
 | 
					label-visible-background = ${self.label-focused-background}
 | 
				
			||||||
@@ -90,8 +74,8 @@ label-visible-underline = ${self.label-focused-background}
 | 
				
			|||||||
label-visible-padding = ${self.label-focused-padding}
 | 
					label-visible-padding = ${self.label-focused-padding}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
label-urgent = %index%!
 | 
					label-urgent = %index%!
 | 
				
			||||||
label-urgent-background = ${module/bspwm.label-urgent-background}
 | 
					label-urgent-background = ${colors.alert}
 | 
				
			||||||
label-urgent-padding = ${module/bspwm.label-urgent-padding}
 | 
					label-urgent-padding = 2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[module/date]
 | 
					[module/date]
 | 
				
			||||||
type = internal/date
 | 
					type = internal/date
 | 
				
			||||||
@@ -192,6 +176,12 @@ label-connected-underline = ${colors.blue}
 | 
				
			|||||||
label-disconnected = 
 | 
					label-disconnected = 
 | 
				
			||||||
label-disconnected-underline = ${colors.pink}
 | 
					label-disconnected-underline = ${colors.pink}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[module/mouse-battery]
 | 
				
			||||||
 | 
					type = custom/script
 | 
				
			||||||
 | 
					exec = ~/.config/scripts/get-mouse-battery.sh
 | 
				
			||||||
 | 
					label = %output%
 | 
				
			||||||
 | 
					interval = 60
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[settings]
 | 
					[settings]
 | 
				
			||||||
screenchange-reload = true
 | 
					screenchange-reload = true
 | 
				
			||||||
;compositing-background = xor
 | 
					;compositing-background = xor
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										11
									
								
								scripts/get-mouse-battery.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										11
									
								
								scripts/get-mouse-battery.sh
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,11 @@
 | 
				
			|||||||
 | 
					#! /bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					mouseState=$(upower -i /org/freedesktop/UPower/devices/mouse_hidpp_battery_0)
 | 
				
			||||||
 | 
					batteryPercentage=$(echo $mouseState | grep percentage | grep -Po '\d+%')
 | 
				
			||||||
 | 
					charging=$(echo $mouseState | grep 'state: charging')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ ! -z "$charging" ]; then
 | 
				
			||||||
 | 
					    echo Charging
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
					    echo $batteryPercentage
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
		Reference in New Issue
	
	Block a user