first commit
This commit is contained in:
198
polybar/.config/polybar/config.ini
Normal file
198
polybar/.config/polybar/config.ini
Normal file
@@ -0,0 +1,198 @@
|
||||
[settings]
|
||||
screenchange-reload = true
|
||||
pseudo-transparency = true
|
||||
|
||||
[colors]
|
||||
primary = #77A7D2
|
||||
secondary = #F00000
|
||||
foreground = #CDCDCD
|
||||
|
||||
alert = #A54242
|
||||
disabled = #707880
|
||||
|
||||
background = #242424
|
||||
background-alt = #373B41
|
||||
|
||||
[bar/top]
|
||||
monitor = ${env:MONITOR}
|
||||
monitor-strict = true
|
||||
|
||||
font-0 = Terminus:pixelsize=18;3
|
||||
font-1 = TerminessTTF Nerd Font:pixelsize=14;3
|
||||
|
||||
width = 100%
|
||||
height = 28
|
||||
radius = 0
|
||||
|
||||
line-size = 2
|
||||
|
||||
background = ${colors.background}
|
||||
foreground = ${colors.foreground}
|
||||
|
||||
separator = |
|
||||
separator-foreground = ${colors.disabled}
|
||||
|
||||
border-size = 0
|
||||
border-color = #00000000
|
||||
|
||||
padding-left = 0
|
||||
padding-right = 1
|
||||
|
||||
module-margin = 1
|
||||
|
||||
modules-left = xworkspaces i3 xwindow
|
||||
modules-right = cpu temperature memory pulseaudio xkeyboard battery date
|
||||
|
||||
tray-position = right
|
||||
tray-detached = false
|
||||
|
||||
cursor-click = pointer
|
||||
|
||||
[module/xworkspaces]
|
||||
type = internal/xworkspaces
|
||||
pin-workspaces = true
|
||||
enable-scroll = false
|
||||
|
||||
label-active = %name%
|
||||
label-active-background = ${colors.background-alt}
|
||||
label-active-underline= ${colors.primary}
|
||||
label-active-padding = 1
|
||||
|
||||
label-occupied = %name%
|
||||
label-occupied-padding = 1
|
||||
|
||||
label-urgent = %name%
|
||||
label-urgent-background = ${colors.alert}
|
||||
label-urgent-padding = 1
|
||||
|
||||
label-empty = %name%
|
||||
label-empty-foreground = ${colors.disabled}
|
||||
label-empty-padding = 1
|
||||
|
||||
[module/i3]
|
||||
type = internal/i3
|
||||
|
||||
label-mode = %mode%
|
||||
label-mode-padding = 1
|
||||
label-mode-background = ${colors.secondary}
|
||||
|
||||
format = <label-mode>
|
||||
|
||||
[module/xwindow]
|
||||
type = internal/xwindow
|
||||
label = %title:0:60:...%
|
||||
|
||||
[module/cpu]
|
||||
type = internal/cpu
|
||||
interval = 2
|
||||
label = %percentage:2%%
|
||||
format-prefix = "Cpu:"
|
||||
format-prefix-foreground = ${colors.primary}
|
||||
|
||||
[module/temperature]
|
||||
type = internal/temperature
|
||||
|
||||
thermal-zone = 0
|
||||
warn-temperature = 70
|
||||
|
||||
format = <label>
|
||||
format-underline = ${colors.primary}
|
||||
format-warn = <label-warn>
|
||||
format-warn-underline = ${self.format-underline}
|
||||
|
||||
label = %temperature-c%
|
||||
label-warn = %temperature-c%
|
||||
label-warn-foreground = ${colors.secondary}
|
||||
|
||||
[module/memory]
|
||||
type = internal/memory
|
||||
interval = 2
|
||||
format-prefix = "Ram:"
|
||||
format-prefix-foreground = ${colors.primary}
|
||||
label = %percentage_used:2%%
|
||||
|
||||
[module/pulseaudio]
|
||||
type = internal/pulseaudio
|
||||
|
||||
label-volume = %percentage%%
|
||||
label-muted = muted
|
||||
label-muted-foreground = ${colors.disabled}
|
||||
|
||||
format-volume-prefix = "Vol:"
|
||||
format-volume-prefix-foreground = ${colors.primary}
|
||||
format-volume = <label-volume>
|
||||
|
||||
[module/xkeyboard]
|
||||
type = internal/xkeyboard
|
||||
blacklist-0 = num lock
|
||||
|
||||
label-layout = %layout%
|
||||
label-layout-foreground = ${colors.primary}
|
||||
|
||||
label-indicator-padding = 2
|
||||
label-indicator-margin = 1
|
||||
label-indicator-background = ${colors.secondary}
|
||||
|
||||
format = <label-indicator><label-layout>
|
||||
|
||||
[module/battery]
|
||||
type = internal/battery
|
||||
|
||||
battery = BAT1
|
||||
poll-interval = 5
|
||||
full-at = 99
|
||||
low-at = 5
|
||||
; adapter = AC1AD
|
||||
|
||||
label-charging = %percentage%%
|
||||
label-discharging = %percentage%%
|
||||
label-full = F
|
||||
label-low = L
|
||||
|
||||
format-charging = <animation-charging> <label-charging>
|
||||
format-discharging = <ramp-capacity> <label-discharging>
|
||||
; format-discharging-prefix = "Discharging "
|
||||
format-discharging-prefix-foreground = ${colors.secondary}
|
||||
format-full = <ramp-capacity> <label-full>
|
||||
format-low = <animation-low> <label-low>
|
||||
|
||||
; Only applies if <ramp-capacity> is used
|
||||
ramp-capacity-0 =
|
||||
ramp-capacity-1 =
|
||||
ramp-capacity-2 =
|
||||
ramp-capacity-3 =
|
||||
ramp-capacity-4 =
|
||||
|
||||
; Only applies if <animation-charging> is used
|
||||
animation-charging-0 =
|
||||
animation-charging-1 =
|
||||
animation-charging-2 =
|
||||
animation-charging-3 =
|
||||
animation-charging-4 =
|
||||
animation-charging-framerate = 750
|
||||
|
||||
; Only applies if <animation-low> is used
|
||||
animation-low-0 =
|
||||
animation-low-1 =
|
||||
animation-low-framerate = 200
|
||||
|
||||
[module/date]
|
||||
type = internal/date
|
||||
interval = 1
|
||||
|
||||
date = %H:%M
|
||||
date-alt = %Y-%m-%d %H:%M:%S
|
||||
|
||||
label = %date%
|
||||
label-foreground = ${colors.primary}
|
||||
|
||||
; [module/battery-info]
|
||||
; type = custom/script
|
||||
; interval = 5
|
||||
; exec = $PATH_POLYBAR/scripts/battery-info.sh
|
||||
|
||||
; [module/bluetooth]
|
||||
; type = custom/script
|
||||
; exec = $PATH_POLYBAR/scripts/bluetooth.sh
|
||||
; tail = true
|
||||
; click-left = $PATH_POLYBAR/scripts/bluetooth.sh --toggle &
|
||||
19
polybar/.config/polybar/launch.sh
Normal file
19
polybar/.config/polybar/launch.sh
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
export PATH_POLYBAR="$HOME/.config/polybar"
|
||||
|
||||
# Terminate already running bar instances
|
||||
# If all your bars have ipc enabled, you can use
|
||||
polybar-msg cmd quit &
|
||||
|
||||
# Otherwise you can use the nuclear option:
|
||||
killall -q polybar &
|
||||
|
||||
# Launch.
|
||||
if type "xrandr"; then
|
||||
for m in $(xrandr --query | grep -w connected | cut -d " " -f1); do
|
||||
MONITOR=$m polybar top --reload &
|
||||
done
|
||||
else
|
||||
polybar top &
|
||||
fi
|
||||
4
polybar/.config/polybar/modules/network.ini
Normal file
4
polybar/.config/polybar/modules/network.ini
Normal file
@@ -0,0 +1,4 @@
|
||||
[module/test]
|
||||
type = custom/script
|
||||
exec = "$HOME/.config/polybar/scripts/battery-shell.sh"
|
||||
interval = 10
|
||||
49
polybar/.config/polybar/scripts/battery-info.sh
Normal file
49
polybar/.config/polybar/scripts/battery-info.sh
Normal file
@@ -0,0 +1,49 @@
|
||||
#!/bin/sh
|
||||
|
||||
PATH_BATTERY="/sys/class/power_supply/BAT0"
|
||||
|
||||
status=$(cat "$PATH_BATTERY/status")
|
||||
charge=$(cat "$PATH_BATTERY/capacity")
|
||||
|
||||
if [ "$status" = "Charging" ]; then
|
||||
# Идёт зарядка.
|
||||
if [ "$charge" -le 20 ]; then
|
||||
icon=""
|
||||
elif [ "$charge" -le 50 ]; then
|
||||
icon=""
|
||||
elif [ "$charge" -le 70 ]; then
|
||||
icon=""
|
||||
elif [ "$charge" -le 80 ]; then
|
||||
icon=""
|
||||
elif [ "$charge" -le 90 ]; then
|
||||
icon=""
|
||||
elif [ "$charge" -le 97 ]; then
|
||||
icon=""
|
||||
else
|
||||
icon=" "
|
||||
fi
|
||||
else
|
||||
if [ "$charge" -le 10 ]; then
|
||||
icon=""
|
||||
elif [ "$charge" -le 30 ]; then
|
||||
icon=""
|
||||
elif [ "$charge" -le 40 ]; then
|
||||
icon=""
|
||||
elif [ "$charge" -le 50 ]; then
|
||||
icon=""
|
||||
elif [ "$charge" -le 60 ]; then
|
||||
icon=""
|
||||
elif [ "$charge" -le 70 ]; then
|
||||
icon=""
|
||||
elif [ "$charge" -le 80 ]; then
|
||||
icon=""
|
||||
elif [ "$charge" -le 90 ]; then
|
||||
icon=""
|
||||
elif [ "$charge" -le 97 ]; then
|
||||
icon=""
|
||||
else
|
||||
icon=""
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$icon $charge%"
|
||||
60
polybar/.config/polybar/scripts/bluetooth.sh
Normal file
60
polybar/.config/polybar/scripts/bluetooth.sh
Normal file
@@ -0,0 +1,60 @@
|
||||
#!/bin/sh
|
||||
|
||||
bluetooth_print() {
|
||||
bluetoothctl | while read -r; do
|
||||
if [ "$(systemctl is-active "bluetooth.service")" = "active" ]; then
|
||||
printf '#1'
|
||||
|
||||
devices_paired=$(bluetoothctl devices Paired | grep Device | cut -d ' ' -f 2)
|
||||
counter=0
|
||||
|
||||
for device in $devices_paired; do
|
||||
device_info=$(bluetoothctl info "$device")
|
||||
|
||||
if echo "$device_info" | grep -q "Connected: yes"; then
|
||||
device_alias=$(echo "$device_info" | grep "Alias" | cut -d ' ' -f 2-)
|
||||
|
||||
if [ $counter -gt 0 ]; then
|
||||
printf ", %s" "$device_alias"
|
||||
else
|
||||
printf " %s" "$device_alias"
|
||||
fi
|
||||
|
||||
counter=$((counter + 1))
|
||||
fi
|
||||
done
|
||||
|
||||
printf '\n'
|
||||
else
|
||||
# printf 'test\n'
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
bluetooth_toggle() {
|
||||
if bluetoothctl show | grep -q "Powered: no"; then
|
||||
bluetoothctl power on >> /dev/null
|
||||
sleep 1
|
||||
|
||||
devices_paired=$(bluetoothctl devices Paired | grep Device | cut -d ' ' -f 2)
|
||||
echo "$devices_paired" | while read -r line; do
|
||||
bluetoothctl connect "$line" >> /dev/null
|
||||
done
|
||||
else
|
||||
devices_paired=$(bluetoothctl devices Paired | grep Device | cut -d ' ' -f 2)
|
||||
echo "$devices_paired" | while read -r line; do
|
||||
bluetoothctl disconnect "$line" >> /dev/null
|
||||
done
|
||||
|
||||
bluetoothctl power off >> /dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
--toggle)
|
||||
bluetooth_toggle
|
||||
;;
|
||||
*)
|
||||
bluetooth_print
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user