added scripts

This commit is contained in:
Simon
2020-12-27 20:43:51 +01:00
parent c334612df6
commit dc144ce896
9 changed files with 86564 additions and 100 deletions
+25 -98
View File
@@ -39,7 +39,8 @@ module-margin-left = 1
module-margin-right = 1
padding-right= 2
font-0 = Hack Nerd Font:fontformat=truetype:pixelsize=10;1
font-1 = Font Awesome 5 Free:fontformat=truetype:pixelsize=10:antialias=true;0
font-1 = Font Font Awesome 5 Free Solid:style=Solid:fontformat=truetype:pixelsize=10:antialias=true;0
font-2 = Font Awesome 5 Free:fontformat=truetype:pixelsize=10:antialias=true;0
tray-position = left
tray-padding = 9
tray-detached = false
@@ -66,7 +67,8 @@ module-margin-left = 1
module-margin-right = 1
padding-right= 2
font-0 = Hack Nerd Font:fontformat=truetype:pixelsize=10;1
font-1 = Font Awesome 5 Free:fontformat=truetype:pixelsize=10:antialias=true;0
font-1 = Font Font Awesome 5 Free Solid:style=Solid:fontformat=truetype:pixelsize=10:antialias=true;0
font-2 = Font Awesome 5 Free:fontformat=truetype:pixelsize=10:antialias=true;0
tray-position = left
tray-padding = 9
tray-detached = false
@@ -78,7 +80,7 @@ enable-ipc = true
; Bars PC
[bar/pc_primary_landscape]
modules-left = disk_short_pc checkupd ovpn nvpn eth_pc
modules-left = disk_short_pc checkupdates ovpn nvpn eth_pc playerctl
modules-center = i3
modules-right = sensors_cpu_pc nvgpu memory date
monitor = ${env:MONITOR:DP-4}
@@ -94,7 +96,7 @@ module-margin-left = 1
module-margin-right = 1
padding-right= 2
font-0 = Hack Nerd Font:fontformat=truetype:pixelsize=10;1
font-1 = Font Awesome 5 Free:fontformat=truetype:pixelsize=10:antialias=true;0
font-1 = Material Design Icons:fontformat=truetype:pixelsize=11:antialias=true;1
tray-position = left
tray-padding = 9
tray-detached = false
@@ -120,7 +122,7 @@ module-margin-left = 1
module-margin-right = 1
padding-right= 2
font-0 = Hack Nerd Font:fontformat=truetype:pixelsize=10;1
font-1 = Font Awesome 5 Free:fontformat=truetype:pixelsize=10:antialias=true;0
font-1 = Material Design Icons:fontformat=truetype:pixelsize=10:antialias=true;0
tray-position = left
tray-padding = 9
tray-detached = false
@@ -129,46 +131,6 @@ tray-background = ${root.background}
tray-scale = 1.0
enable-ipc = true
[bar/pc_secondary_landscape]
modules-left =
modules-center = i3
modules-right = date
monitor = ${env:MONITOR:HDMI-0}
width = 100%
height = 18
fixed-center = true
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3
line-color = #000
separator =|
module-margin-left = 1
module-margin-right = 1
padding-right= 2
font-0 = Hack Nerd Font:fontformat=truetype:pixelsize=10;1
font-1 = Font Awesome 5 Free:fontformat=truetype:pixelsize=9:antialias=true;0
enable-ipc = true
[bar/pc_tertiary_landscape]
modules-left =
modules-center = i3
modules-right = date
monitor = ${env:MONITOR:HDMI-1}
width = 100%
height = 18
fixed-center = true
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3
line-color = #000
separator =|
module-margin-left = 1
module-margin-right = 1
padding-right= 2
font-0 = Hack Nerd Font:fontformat=truetype:pixelsize=10;1
font-1 = Font Awesome 5 Free:fontformat=truetype:pixelsize=9:antialias=true;0
enable-ipc = true
; Modules
; Module Date
@@ -176,7 +138,7 @@ enable-ipc = true
[module/date]
type = internal/date
interval = 1
date = tme:
date = 󰃭
date-alt = %d.%m.%Y,
time = %H:%M
time-alt = %H:%M:%S
@@ -184,58 +146,24 @@ label = %date% %time%
; Module Updates
[module/update]
[module/checkupdates]
type = custom/script
interval = 60
format = upd: <label>
label-maxlen=5
label-ellipsis=true
exec = "echo $(yay -Qu 2>/dev/null | wc -l | awk '$1 ~ /^[[:digit:]]+$/')"
click-left = "setsid alacritty -e sh -c 'echo ---UPDATE LIST---; echo; yay -Syy; yay -Qu; echo ; read -p ---END---'"
click-right = "setsid alacritty -e sh -c 'echo ---UPDATING---; echo ; yay -Syu --sudoloop; echo ; read -p ---END---'"
click-middle = "setsid alacritty -e sh -c 'echo ---UPDATING, NOCONFIRM---; echo ; yay -Syu --sudoloop --noconfirm; echo ; read -p ---END---'"
; This module uses 'checkupdates-aur' to fetch update count without database sync
[module/checkupd]
type = custom/script
interval = 60
format = upd: <label>
format = 󰂪 <label>
label-maxlen=500
label-ellipsis=true
exec = "echo $(/bin/checkupdates-aur | wc -l | awk '$1 ~ /^[[:digit:]]+$/') 2>&1"
click-left = "setsid alacritty -e sh -c 'echo ---UPDATE LIST---; echo; /bin/checkupdates-aur; echo ; read -p ---END---'"
click-right = "setsid alacritty -e sh -c 'echo ---UPDATING---; echo ; yay -Syu --sudoloop; echo ; read -p ---END---'"
click-middle = "setsid alacritty -e sh -c 'echo ---UPDATING, NOCONFIRM---; echo ; yay -Syu --sudoloop --noconfirm; echo ; read -p ---END---'"
; This module uses 'checkupdates-aur' to fetch update count without database sync
[module/checkupd_manjaro]
type = custom/script
interval = 60
format = upd: <label>
label-maxlen=5
label-ellipsis=true
exec = "echo $(checkupdates | wc -l | awk '$1 ~ /^[[:digit:]]+$/') 2>&1"
click-left = "setsid alacritty -e sh -c 'echo ---UPDATE LIST---; echo; checkupdates-aur; echo ; read -p ---END---'"
click-right = "setsid alacritty -e sh -c 'echo ---UPDATING---; echo ; yay -Syu --sudoloop; echo ; read -p ---END---'"
click-middle = "setsid alacritty -e sh -c 'echo ---UPDATING, NOCONFIRM---; echo ; yay -Syu --sudoloop --noconfirm; echo ; read -p ---END---'"
exec = "echo $(bash ~/.config/polybar/scripts/update.sh --count-short)"
click-left = "setsid alacritty -e bash ~/.config/polybar/scripts/update.sh --list"
click-right = "setsid alacritty -e bash ~/.config/polybar/scripts/update.sh --update"
click-middle = "setsid alacritty -e bash ~/.config/polybar/scripts/update.sh --update-noconfirm"
; Module HW-Statistics
[module/cpu]
type = internal/cpu
interval = 2
label = cpu: %percentage%%
[module/temperature]
type = internal/temperature
interval = 3
label = tmp: %temperature-c%
; run 'sensors-detect' from 'lm_sensors' first
[module/sensors_cpu_pc]
type = custom/script
interval = 2
format = cpu: <label>
format = 󰍛 <label>
label-maxlen=15
label-ellipsis=true
exec = "echo $((top -bn1 | grep 'Cpu(s)' | sed 's/.*, *\([0-9.]*\)%* id.*/\1/' | awk -F '.' '{print 100 - $1}' ; echo '%, ' ; sensors | grep "CPUTIN" | awk -F' ' '{print $2}' | awk -F'.' '{print $1}' | tr -d '+'; echo '°') | tr -d '\n')"
@@ -244,7 +172,7 @@ click-left = "setsid alacritty -e sh -c htop"
[module/sensors_cpu_yoga3]
type = custom/script
interval = 2
format = cpu: <label>
format = 󰍛 <label>
label-maxlen=15
label-ellipsis=true
exec = "echo $((top -bn1 | grep 'Cpu(s)' | sed 's/.*, *\([0-9.]*\)%* id.*/\1/' | awk -F '.' '{print 100 - $1}' ; echo '%, ' ; sensors | grep "Package id 0:" | awk -F' ' '{print $4}' | awk -F'.' '{print $1}' | tr -d '+'; echo '°') | tr -d '\n')"
@@ -253,12 +181,12 @@ click-left = "setsid alacritty -e sh -c htop"
[module/memory]
type = internal/memory
interval = 2
label = ram: %percentage_used%%
label = 󰆼 %percentage_used%%
[module/nvgpu]
type = custom/script
interval = 2
format = gpu: <label>
format = 󰹑 <label>
label-maxlen=15
label-ellipsis=true
;exec = "echo $(nvidia-settings -q GPUUtilization | awk -F'=' '{print $3}' | awk '{print $1}' | sed 's/\,/%/g')"
@@ -286,7 +214,7 @@ type = internal/network
interface = enp5s0
interval = 3
format-connected = <label-connected>
label-connected = eth: %local_ip%
label-connected = 󰈀 %local_ip%
[module/eth_yoga3]
type = internal/network
@@ -350,18 +278,17 @@ format-muted-foreground = ${root.foreground}
label-muted =  x
interval = 1
[module/songname]
[module/playerctl]
type = custom/script
interval = 3
tail = true
format-prefix = ""
format = <label>
label-maxlen=50
label-ellipsis=true
exec = echo $(printf "%s: %s" "$(playerctl metadata artist 2>&1)" "$(playerctl metadata title 2>&1)" | sed -r 's/No players found//g;' | awk 'length > 2')
exec = ~/.config/polybar/scripts/playerctl.sh
click-left = "playerctl play-pause"
click-right = "playerctl next"
click-middle = "playerctl previous"
[module/menu-media]
[module/playerctl-buttons]
type = custom/menu
expand-right = true
label-open = 
@@ -400,7 +327,7 @@ label-discharging = bat: %percentage%%
[module/disk_short_pc]
type = custom/script
format = | dsk: <label>
format = | 󰆓 <label>
interval = 10
exec = echo $(df -h / | tail +2 | awk -F ' ' '{print $3 " / " $2 " (" $5 ")"}' | tr -d 'G')