mirror of
https://github.com/cizordj/i3-themer.git
synced 2024-04-21 12:32:12 +00:00
172 lines
4.1 KiB
Bash
172 lines
4.1 KiB
Bash
#!/bin/bash
|
|
|
|
function polybarConfig(){
|
|
|
|
function wired_connection(){
|
|
ls /sys/class/net | grep 'enp' | tr -d '\n'
|
|
}
|
|
function wireless_connection(){
|
|
ls /sys/class/net | grep 'wl' | tr -d '\n'
|
|
}
|
|
|
|
local USER='$USER'
|
|
cat << POLYBAR
|
|
[module/i3]
|
|
type = internal/i3
|
|
format = <label-state> <label-mode>
|
|
index-sort = true
|
|
wrapping-scroll = false
|
|
|
|
label-mode-padding = 2
|
|
label-mode-foreground = ${polybar['label-mode-foreground']}
|
|
label-mode-background = ${polybar['label-mode-background']}
|
|
|
|
label-focused = %index%
|
|
label-focused-background = ${polybar['label-focused-background']}
|
|
label-focused-foreground = ${polybar['label-focused-foreground']}
|
|
label-focused-padding = 2
|
|
|
|
label-unfocused = %index%
|
|
label-unfocused-background = ${polybar['label-unfocused-background']}
|
|
label-unfocused-foreground = ${polybar['label-unfocused-foreground']}
|
|
label-unfocused-padding = 2
|
|
|
|
label-visible = %index%
|
|
label-visible-background = ${polybar['label-visible-background']}
|
|
label-visible-foreground = ${polybar['label-visible-foreground']}
|
|
label-visible-padding = 2
|
|
|
|
label-urgent = %index%
|
|
label-urgent-background = #BA2922
|
|
label-urgent-padding = 2
|
|
|
|
[module/wlan]
|
|
type = internal/network
|
|
interface = $(wireless_connection)
|
|
interval = 3.0
|
|
|
|
format-connected = <ramp-signal> <label-connected>
|
|
format-connected-foreground = ${polybar['format-connected-foreground']}
|
|
format-connected-background = ${polybar['format-connected-background']}
|
|
format-connected-padding = 2
|
|
label-connected = %essid%
|
|
|
|
format-disconnected =
|
|
|
|
ramp-signal-0 =
|
|
ramp-signal-1 =
|
|
ramp-signal-2 =
|
|
ramp-signal-3 =
|
|
ramp-signal-4 =
|
|
ramp-signal-foreground = ${polybar['ramp-signal-foreground']}
|
|
|
|
[module/eth]
|
|
type = internal/network
|
|
interface = $(wired_connection)
|
|
interval = 3.0
|
|
|
|
format-connected-padding = 2
|
|
format-connected-foreground = ${polybar['format-connected-foreground']}
|
|
format-connected-background = ${polybar['format-connected-background']}
|
|
format-connected-prefix = " "
|
|
format-connected-prefix-foreground = ${polybar['format-connected-prefix-foreground']}
|
|
label-connected = %local_ip%
|
|
|
|
format-disconnected =
|
|
|
|
[module/date]
|
|
type = internal/date
|
|
interval = 1
|
|
|
|
date =
|
|
date-alt = " %Y-%m-%d"
|
|
|
|
time = %H:%M
|
|
time-alt = %H:%M:%S
|
|
|
|
format-prefix =
|
|
format-foreground = ${polybar['format-foreground']}
|
|
format-background = ${polybar['format-background']}
|
|
format-padding = 2
|
|
|
|
label = %date% %time%
|
|
|
|
[module/powermenu]
|
|
type = custom/menu
|
|
|
|
expand-right = true
|
|
|
|
format-spacing = 1
|
|
|
|
label-open =
|
|
label-open-foreground = ${polybar['label-open-foreground']}
|
|
label-close = cancel
|
|
label-close-foreground = ${polybar['label-close-foreground']}
|
|
label-separator = |
|
|
label-separator-foreground = ${polybar['label-separator-foreground']}
|
|
|
|
menu-0-0 = reboot
|
|
menu-0-0-exec = menu-open-1
|
|
menu-0-1 = power off
|
|
menu-0-1-exec = menu-open-2
|
|
menu-0-2 = log off
|
|
menu-0-2-exec = menu-open-3
|
|
|
|
menu-1-0 = reboot
|
|
menu-1-0-exec = i3exit reboot
|
|
menu-1-1 = get back
|
|
menu-1-1-exec = menu-open-0
|
|
|
|
menu-2-0 = power off
|
|
menu-2-0-exec = i3exit shutdown
|
|
menu-2-1 = get back
|
|
menu-2-1-exec = menu-open-0
|
|
|
|
menu-3-0 = log off
|
|
menu-3-0-exec = i3exit logout
|
|
menu-3-1 = get back
|
|
menu-3-1-exec = menu-open-0
|
|
|
|
[settings]
|
|
screenchange-reload = true
|
|
|
|
[global/wm]
|
|
margin-top = 0
|
|
margin-bottom = 0
|
|
|
|
[module/alsa]
|
|
type = internal/alsa
|
|
|
|
master-soundcard = default
|
|
speaker-soundcard = default
|
|
headphone-soundcard = default
|
|
|
|
Master-mixer = default
|
|
|
|
mapped = true
|
|
|
|
label-volume-background = ${polybar['format-background']}
|
|
label-muted-background = ${polybar['format-background']}
|
|
ramp-volume-background = ${polybar['format-background']}
|
|
ramp-headphones-background = ${polybar['format-background']}
|
|
label-volume-foreground = ${polybar['format-foreground']}
|
|
label-muted-foreground = ${polybar['format-foreground']}
|
|
ramp-volume-foreground = ${polybar['format-foreground']}
|
|
ramp-headphones-foreground = ${polybar['format-foreground']}
|
|
|
|
format-volume = <ramp-volume><label-volume>
|
|
format-muted = <label-muted>
|
|
|
|
label-muted = " muted "
|
|
label-volume = " %percentage% "
|
|
|
|
format-volume-padding = 0
|
|
format-muted-padding = 0
|
|
|
|
ramp-volume-0 = " "
|
|
ramp-volume-1 = " "
|
|
ramp-volume-2 = " "
|
|
ramp-headphones-0 = " "
|
|
POLYBAR
|
|
}
|