miner commits

This commit is contained in:
Zastian Pretorius
2022-08-13 23:14:23 +01:00
parent c91fc60a85
commit 1432905eaa
24 changed files with 3579 additions and 439 deletions

View File

@@ -0,0 +1,15 @@
[colors]
background = #1d1d2d
background-alt = #11111b
foreground = #cdd6f4
primary = #89dceb
secondary = #74c7ec
alert = #f38ba8
black = #24283b
cyan = #89dceb
green = #a6e3a1
orange = #fab387
yellow = #f9e2af
red = #f38ba8
pink = #f5c2e7
blue = #89b4fa

View File

@@ -1,457 +1,122 @@
;==========================================================
;
;
; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗
; ██╔══████╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══████╔══██
; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔
; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗
; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║
; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
;
;
; To learn more about how to configure Polybar
; go to https://github.com/jaagr/polybar
;
; The README contains a lot of information
;
;==========================================================
; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗
; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝
; ██╔═══╝ ██║ ██║██║ ██╔╝ ██╔══██╗██╔══████╔══██╗
; ██║ ██████╔╝███████╗██║ ██████╔╝██║ ██████
; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═
[colors]
background = #282a36
foreground = #f8f8f2
background-alt = #99444444
foreground-alt = #f8f8f2
primary = #6e5991
secondary = #363949
alert = #bd2c40
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[bar/barbase1]
monitor = HDMI-A-0
offset-y = -2
;width = 100%
height = 29
fixed-center = false
monitor-fallback =eDP
width = 100%
height = 25
radius = 0
fixed-center = true
border-size = 0
border-color = ${colors.background}
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3
line-color = #f00
border-size = 0
border-color = #00000000
padding-left = 0
padding-right = 2
module-margin-left = 1
module-margin-right = 2
font-0 = Ubuntu:pixelsize=10;1
font-1 = Source Han Sans JP:pixelsize=10;1
font-2 = siji:pixelsize=10;1
padding-right = 1
module-margin-left = 0
module-margin-right = 0
font-0 = "JetBrainsMono Nerd Font:size=15;5"
font-1 = "SauceCodePro Nerd Font Mono:size=20;5"
font-2 = "Material Icons:pixelsize=20;5"
font-3 = "Sinji:pixelsize=15;5"
font-4 = "Togalite medium:pixelsize=11;2"
font-5 = "SauceCodePro Nerd Font Mono:size=16;5"
font-6 = "JetBrainsMono Nerd Font Mono:size=12;4"
font-7 = "JetBrainsMono Nerd Font:pixelsize=12;4"
font-8 = "Source Han Sans JP:pixelsize=14;2"
; MODULES SETUP
modules-left = ewmh
modules-center =
modules-right = filesystem pulseaudio xkeyboard memory cpu wlan eth battery date powermenu
;modules-center = left1 spotify-artist spotify-track left2
modules-right = right1 volume sep1 memory sep1 pacman-updates sep1 cpu date right2
tray-position = right
tray-padding = 2
tray-offset-y = 2
tray-offset-x = 2
cursor-click = pointer
cursor-scroll = ns-resize
cursor-scroll = pointer
line-size = 2
#override-redirect = true
enable-ipc = true
offset-y = -2
offset-x = -2
[bar/barbase2]
monitor = eDP
offset-y = -2
;width = 100%
height = 29
fixed-center = false
width = 100%
height = 25
radius = 0
fixed-center = true
border-size = 0
border-color = ${colors.background}
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3
line-color = #f00
border-size = 0
border-color = #00000000
padding-left = 0
padding-right = 2
module-margin-left = 1
module-margin-right = 2
font-0 = Ubuntu:pixelsize=10;1
font-1 = Source Han Sans JP:pixelsize=10;1
font-2 = siji:pixelsize=10;1
padding-right = 1
module-margin-left = 0
module-margin-right = 0
font-0 = "JetBrainsMono Nerd Font:size=15;5"
font-1 = "SauceCodePro Nerd Font Mono:size=20;5"
font-2 = "Material Icons:pixelsize=20;5"
font-3 = "Sinji:pixelsize=15;5"
font-4 = "Togalite medium:pixelsize=11;2"
font-5 = "SauceCodePro Nerd Font Mono:size=16;5"
font-6 = "JetBrainsMono Nerd Font Mono:size=12;4"
font-7 = "JetBrainsMono Nerd Font:pixelsize=12;4"
font-8 = "Source Han Sans JP:pixelsize=14;2"
; MODULES SETUP
modules-left = ewmh
modules-center =
modules-right = filesystem pulseaudio xkeyboard memory cpu wlan eth battery date powermenu
tray-position = right
tray-padding = 2
;modules-center = left1 spotify-artist spotify-track left2
modules-right = right1 volume sep1 memory sep1 pacman-updates sep1 cpu date right2
cursor-click = pointer
cursor-scroll = ns-resize
cursor-scroll = pointer
[module/ewmh]
type = internal/xworkspaces
pin-workspaces = false
enable-click = true
enable-scroll = false
icon-0 = 1;一
icon-1 = 2;二
icon-2 = 3;三
icon-3 = 4;四
icon-4 = 5;五
icon-5 = 6;六
icon-6 = 7;七
icon-7 = 8;八
icon-8 = 9;九
format = <label-state>
label-active = %icon%
label-active-foreground = ${colors.green}
label-active-background = #6e5991
label-active-padding = 1
label-occupied = %icon%
label-occupied-foreground = ${colors.blue}
label-occupied-background = #363949
label-occupied-padding = 1
label-urgent = %icon%
label-urgent-foreground = ${colors.red}
label-urgent-underline = #0000ff
label-urgent-padding = 1
label-empty = %icon%
label-empty-foreground = ${colors.fg}
label-empty-underline = ${colors.cyan}
label-empty-padding = 1
line-size = 2
[module/xwindow]
type = internal/xwindow
label = %title:0:30:...%
#override-redirect = true
enable-ipc = true
[module/xkeyboard]
type = internal/xkeyboard
blacklist-0 = num lock
offset-y = -2
offset-x = -2
format-prefix = " "
format-prefix-foreground = ${colors.foreground-alt}
format-prefix-underline = ${colors.secondary}
label-layout = %layout%
label-layout-underline = ${colors.secondary}
label-indicator-padding = 2
label-indicator-margin = 1
label-indicator-background = ${colors.secondary}
label-indicator-underline = ${colors.secondary}
[module/filesystem]
type = internal/fs
interval = 25
mount-0 = /home
label-mounted = %{F#0a81f5}%mountpoint%%{F-}: %percentage_used%%
label-unmounted = %mountpoint% not mounted
label-unmounted-foreground = ${colors.foreground-alt}
[module/bspwm]
type = internal/bspwm
label-focused = %index%
label-focused-background = ${colors.background-alt}
label-focused-underline= ${colors.primary}
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
; Separator in between workspaces
;separator = %{F#4C566A}|%{F-}
; label-separator = |
[module/i3]
type = internal/i3
format = <label-state> <label-mode>
index-sort = true
wrapping-scroll = false
; Only show workspaces on the same output as the bar
;pin-workspaces = true
label-mode-padding = 2
label-mode-foreground = #000
label-mode-background = ${colors.primary}
; focused = Active workspace on focused monitor
label-focused = %index%
label-focused-background = ${module/bspwm.label-focused-background}
label-focused-underline = ${module/bspwm.label-focused-underline}
label-focused-padding = ${module/bspwm.label-focused-padding}
; unfocused = Inactive workspace on any monitor
label-unfocused = %index%
label-unfocused-padding = ${module/bspwm.label-occupied-padding}
; visible = Active workspace on unfocused monitor
label-visible = %index%
label-visible-background = ${self.label-focused-background}
label-visible-underline = ${self.label-focused-underline}
label-visible-padding = ${self.label-focused-padding}
; urgent = Workspace with urgency hint set
label-urgent = %index%
label-urgent-background = ${module/bspwm.label-urgent-background}
label-urgent-padding = ${module/bspwm.label-urgent-padding}
; Separator in between workspaces
; label-separator = |
[module/mpd]
type = internal/mpd
format-online = <label-song> <icon-prev> <icon-stop> <toggle> <icon-next>
icon-prev = 
icon-stop = 
icon-play = 
icon-pause = 
icon-next = 
label-song-maxlen = 25
label-song-ellipsis = true
[module/xbacklight]
type = internal/xbacklight
format = <label> <bar>
label = BL
bar-width = 10
bar-indicator = |
bar-indicator-foreground = #fff
bar-indicator-font = 2
bar-fill = ─
bar-fill-font = 2
bar-fill-foreground = #9f78e1
bar-empty = ─
bar-empty-font = 2
bar-empty-foreground = ${colors.foreground-alt}
[module/backlight-acpi]
inherit = module/xbacklight
type = internal/backlight
card = intel_backlight
[module/cpu]
type = internal/cpu
interval = 2
format-prefix = " "
format-prefix-foreground = ${colors.foreground-alt}
format-underline = #f90000
label = %percentage:2%%
[module/memory]
type = internal/memory
interval = 2
format-prefix = " "
format-prefix-foreground = ${colors.foreground-alt}
format-underline = #4bffdc
label = %percentage_used%%
[module/wlan]
type = internal/network
interface = wlp2s0
interval = 3.0
format-connected = <ramp-signal> <label-connected>
format-connected-underline = #9f78e1
label-connected = %essid%
format-disconnected =
;format-disconnected = <label-disconnected>
;format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected
;label-disconnected-foreground = ${colors.foreground-alt}
ramp-signal-0 = 
ramp-signal-1 = 
ramp-signal-2 = 
ramp-signal-3 = 
ramp-signal-4 = 
ramp-signal-foreground = ${colors.foreground-alt}
[module/eth]
type = internal/network
interface = enp3s0
interval = 3.0
format-connected-underline = #55aa55
format-connected-prefix = " "
format-connected-prefix-foreground = ${colors.foreground-alt}
label-connected = %local_ip%
format-disconnected =
;format-disconnected = <label-disconnected>
;format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected
;label-disconnected-foreground = ${colors.foreground-alt}
[module/date]
type = internal/date
date =  %%{F#fff}%m/%d/%Y%%{F-} %%{F#fff}%I:%M %p%{F-}
date-alt = %%{F#fff}%A, %B %d, %Y %%{F#fff}%I:%M:%{F#666}%%{F#fba922}%S%%{F-} %p
;interval = 5
;date =
;date-alt = " %Y-%m-%d"
;time = %H:%M
;time-alt = %H:%M:%S
;format-prefix = 
;format-prefix-foreground = ${colors.foreground-alt}
;format-underline = #0a6cf5
;label = %date% %time%
[module/pulseaudio]
type = internal/pulseaudio
format-volume = <label-volume> <bar-volume>
label-volume = VOL %percentage%%
label-volume-foreground = ${root.foreground}
label-muted = 🔇 muted
label-muted-foreground = #666
bar-volume-width = 10
bar-volume-foreground-0 = #55aa55
bar-volume-foreground-1 = #55aa55
bar-volume-foreground-2 = #55aa55
bar-volume-foreground-3 = #55aa55
bar-volume-foreground-4 = #55aa55
bar-volume-foreground-5 = #f5a70a
bar-volume-foreground-6 = #ff5555
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 2
bar-volume-fill = ─
bar-volume-fill-font = 2
bar-volume-empty = ─
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.foreground-alt}
interval = 1
[module/alsa]
type = internal/alsa
format-volume = <label-volume> <bar-volume>
label-volume = VOL
label-volume-foreground = ${root.foreground}
format-muted-prefix = " "
format-muted-foreground = ${colors.foreground-alt}
label-muted = muted
bar-volume-width = 10
bar-volume-foreground-0 = #55aa55
bar-volume-foreground-1 = #55aa55
bar-volume-foreground-2 = #55aa55
bar-volume-foreground-3 = #55aa55
bar-volume-foreground-4 = #55aa55
bar-volume-foreground-5 = #f5a70a
bar-volume-foreground-6 = #ff5555
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 2
bar-volume-fill = ─
bar-volume-fill-font = 2
bar-volume-empty = ─
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.foreground-alt}
[module/battery]
type = internal/battery
battery = BAT0
adapter = AC
full-at = 98
format-charging = <animation-charging> <label-charging>
format-charging-underline = #ffb52a
format-discharging = <animation-discharging> <label-discharging>
format-discharging-underline = ${self.format-charging-underline}
format-full-prefix = " "
format-full-prefix-foreground = ${colors.foreground-alt}
format-full-underline = ${self.format-charging-underline}
ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-foreground = ${colors.foreground-alt}
animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-foreground = ${colors.foreground-alt}
animation-charging-framerate = 750
animation-discharging-0 = 
animation-discharging-1 = 
animation-discharging-2 = 
animation-discharging-foreground = ${colors.foreground-alt}
animation-discharging-framerate = 750
[module/temperature]
type = internal/temperature
thermal-zone = 0
warn-temperature = 60
format = <ramp> <label>
format-underline = #f50a4d
format-warn = <ramp> <label-warn>
format-warn-underline = ${self.format-underline}
label = %temperature-c%
label-warn = %temperature-c%
label-warn-foreground = ${colors.secondary}
ramp-0 = 
ramp-1 = 
ramp-2 = 
ramp-foreground = ${colors.foreground-alt}
[module/powermenu]
type = custom/menu
expand-right = true
format-spacing = 1
label-open = 
label-open-foreground = ${colors.foreground}
label-close =  cancel
label-close-foreground = ${colors.forground}
label-separator = |
label-separator-foreground = ${colors.foreground-alt}
menu-0-0 = reboot
menu-0-0-exec = menu-open-1
menu-0-1 = power off
menu-0-1-exec = menu-open-2
menu-1-0 = cancel
menu-1-0-exec = menu-open-0
menu-1-1 = reboot
menu-1-1-exec = sudo reboot
menu-2-0 = power off
menu-2-0-exec = sudo poweroff
menu-2-1 = cancel
menu-2-1-exec = menu-open-0
[settings]
include-file = ~/.config/polybar/modules/modules.ini
include-file = ~/.config/polybar/colors/colors.ini
screenchange-reload = true
;compositing-background = xor
;compositing-background = screen
;compositing-foreground = source
;compositing-border = over
;pseudo-transparency = false
pseudo-transparency = false
;[global/wm]
;margin-top = 5
;margin-bottom = 5
; vim:ft=dosini
[global/wm]
margin-bottom = 0
margin-top = 0

View File

@@ -0,0 +1,457 @@
;==========================================================
;
;
; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗
; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝
; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗
; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║
; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
;
;
; To learn more about how to configure Polybar
; go to https://github.com/jaagr/polybar
;
; The README contains a lot of information
;
;==========================================================
[colors]
background = #282a36
foreground = #f8f8f2
background-alt = #99444444
foreground-alt = #f8f8f2
primary = #6e5991
secondary = #363949
alert = #bd2c40
[bar/barbase1]
monitor = HDMI-A-0
offset-y = -2
;width = 100%
height = 29
fixed-center = false
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3
line-color = #f00
border-size = 0
border-color = #00000000
padding-left = 0
padding-right = 2
module-margin-left = 1
module-margin-right = 2
font-0 = Ubuntu:pixelsize=10;1
font-1 = Source Han Sans JP:pixelsize=10;1
font-2 = siji:pixelsize=10;1
modules-left = ewmh
modules-center =
modules-right = filesystem pulseaudio xkeyboard memory cpu wlan eth battery date powermenu
tray-position = right
tray-padding = 2
cursor-click = pointer
cursor-scroll = ns-resize
[bar/barbase2]
monitor = eDP
offset-y = -2
;width = 100%
height = 29
fixed-center = false
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3
line-color = #f00
border-size = 0
border-color = #00000000
padding-left = 0
padding-right = 2
module-margin-left = 1
module-margin-right = 2
font-0 = Ubuntu:pixelsize=10;1
font-1 = Source Han Sans JP:pixelsize=10;1
font-2 = siji:pixelsize=10;1
modules-left = ewmh
modules-center =
modules-right = filesystem pulseaudio xkeyboard memory cpu wlan eth battery date powermenu
tray-position = right
tray-padding = 2
cursor-click = pointer
cursor-scroll = ns-resize
[module/ewmh]
type = internal/xworkspaces
pin-workspaces = false
enable-click = true
enable-scroll = false
icon-0 = 1;一
icon-1 = 2;二
icon-2 = 3;三
icon-3 = 4;四
icon-4 = 5;五
icon-5 = 6;六
icon-6 = 7;七
icon-7 = 8;八
icon-8 = 9;九
format = <label-state>
label-active = %icon%
label-active-foreground = ${colors.green}
label-active-background = #6e5991
label-active-padding = 1
label-occupied = %icon%
label-occupied-foreground = ${colors.blue}
label-occupied-background = #363949
label-occupied-padding = 1
label-urgent = %icon%
label-urgent-foreground = ${colors.red}
label-urgent-underline = #0000ff
label-urgent-padding = 1
label-empty = %icon%
label-empty-foreground = ${colors.fg}
label-empty-underline = ${colors.cyan}
label-empty-padding = 1
[module/xwindow]
type = internal/xwindow
label = %title:0:30:...%
[module/xkeyboard]
type = internal/xkeyboard
blacklist-0 = num lock
format-prefix = " "
format-prefix-foreground = ${colors.foreground-alt}
format-prefix-underline = ${colors.secondary}
label-layout = %layout%
label-layout-underline = ${colors.secondary}
label-indicator-padding = 2
label-indicator-margin = 1
label-indicator-background = ${colors.secondary}
label-indicator-underline = ${colors.secondary}
[module/filesystem]
type = internal/fs
interval = 25
mount-0 = /home
label-mounted = %{F#0a81f5}%mountpoint%%{F-}: %percentage_used%%
label-unmounted = %mountpoint% not mounted
label-unmounted-foreground = ${colors.foreground-alt}
[module/bspwm]
type = internal/bspwm
label-focused = %index%
label-focused-background = ${colors.background-alt}
label-focused-underline= ${colors.primary}
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
; Separator in between workspaces
; label-separator = |
[module/i3]
type = internal/i3
format = <label-state> <label-mode>
index-sort = true
wrapping-scroll = false
; Only show workspaces on the same output as the bar
;pin-workspaces = true
label-mode-padding = 2
label-mode-foreground = #000
label-mode-background = ${colors.primary}
; focused = Active workspace on focused monitor
label-focused = %index%
label-focused-background = ${module/bspwm.label-focused-background}
label-focused-underline = ${module/bspwm.label-focused-underline}
label-focused-padding = ${module/bspwm.label-focused-padding}
; unfocused = Inactive workspace on any monitor
label-unfocused = %index%
label-unfocused-padding = ${module/bspwm.label-occupied-padding}
; visible = Active workspace on unfocused monitor
label-visible = %index%
label-visible-background = ${self.label-focused-background}
label-visible-underline = ${self.label-focused-underline}
label-visible-padding = ${self.label-focused-padding}
; urgent = Workspace with urgency hint set
label-urgent = %index%
label-urgent-background = ${module/bspwm.label-urgent-background}
label-urgent-padding = ${module/bspwm.label-urgent-padding}
; Separator in between workspaces
; label-separator = |
[module/mpd]
type = internal/mpd
format-online = <label-song> <icon-prev> <icon-stop> <toggle> <icon-next>
icon-prev = 
icon-stop = 
icon-play = 
icon-pause = 
icon-next = 
label-song-maxlen = 25
label-song-ellipsis = true
[module/xbacklight]
type = internal/xbacklight
format = <label> <bar>
label = BL
bar-width = 10
bar-indicator = |
bar-indicator-foreground = #fff
bar-indicator-font = 2
bar-fill = ─
bar-fill-font = 2
bar-fill-foreground = #9f78e1
bar-empty = ─
bar-empty-font = 2
bar-empty-foreground = ${colors.foreground-alt}
[module/backlight-acpi]
inherit = module/xbacklight
type = internal/backlight
card = intel_backlight
[module/cpu]
type = internal/cpu
interval = 2
format-prefix = " "
format-prefix-foreground = ${colors.foreground-alt}
format-underline = #f90000
label = %percentage:2%%
[module/memory]
type = internal/memory
interval = 2
format-prefix = " "
format-prefix-foreground = ${colors.foreground-alt}
format-underline = #4bffdc
label = %percentage_used%%
[module/wlan]
type = internal/network
interface = wlp2s0
interval = 3.0
format-connected = <ramp-signal> <label-connected>
format-connected-underline = #9f78e1
label-connected = %essid%
format-disconnected =
;format-disconnected = <label-disconnected>
;format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected
;label-disconnected-foreground = ${colors.foreground-alt}
ramp-signal-0 = 
ramp-signal-1 = 
ramp-signal-2 = 
ramp-signal-3 = 
ramp-signal-4 = 
ramp-signal-foreground = ${colors.foreground-alt}
[module/eth]
type = internal/network
interface = enp3s0
interval = 3.0
format-connected-underline = #55aa55
format-connected-prefix = " "
format-connected-prefix-foreground = ${colors.foreground-alt}
label-connected = %local_ip%
format-disconnected =
;format-disconnected = <label-disconnected>
;format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected
;label-disconnected-foreground = ${colors.foreground-alt}
[module/date]
type = internal/date
date =  %%{F#fff}%m/%d/%Y%%{F-} %%{F#fff}%I:%M %p%{F-}
date-alt = %%{F#fff}%A, %B %d, %Y %%{F#fff}%I:%M:%{F#666}%%{F#fba922}%S%%{F-} %p
;interval = 5
;date =
;date-alt = " %Y-%m-%d"
;time = %H:%M
;time-alt = %H:%M:%S
;format-prefix = 
;format-prefix-foreground = ${colors.foreground-alt}
;format-underline = #0a6cf5
;label = %date% %time%
[module/pulseaudio]
type = internal/pulseaudio
format-volume = <label-volume> <bar-volume>
label-volume = VOL %percentage%%
label-volume-foreground = ${root.foreground}
label-muted = 🔇 muted
label-muted-foreground = #666
bar-volume-width = 10
bar-volume-foreground-0 = #55aa55
bar-volume-foreground-1 = #55aa55
bar-volume-foreground-2 = #55aa55
bar-volume-foreground-3 = #55aa55
bar-volume-foreground-4 = #55aa55
bar-volume-foreground-5 = #f5a70a
bar-volume-foreground-6 = #ff5555
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 2
bar-volume-fill = ─
bar-volume-fill-font = 2
bar-volume-empty = ─
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.foreground-alt}
interval = 1
[module/alsa]
type = internal/alsa
format-volume = <label-volume> <bar-volume>
label-volume = VOL
label-volume-foreground = ${root.foreground}
format-muted-prefix = " "
format-muted-foreground = ${colors.foreground-alt}
label-muted = muted
bar-volume-width = 10
bar-volume-foreground-0 = #55aa55
bar-volume-foreground-1 = #55aa55
bar-volume-foreground-2 = #55aa55
bar-volume-foreground-3 = #55aa55
bar-volume-foreground-4 = #55aa55
bar-volume-foreground-5 = #f5a70a
bar-volume-foreground-6 = #ff5555
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 2
bar-volume-fill = ─
bar-volume-fill-font = 2
bar-volume-empty = ─
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.foreground-alt}
[module/battery]
type = internal/battery
battery = BAT0
adapter = AC
full-at = 98
format-charging = <animation-charging> <label-charging>
format-charging-underline = #ffb52a
format-discharging = <animation-discharging> <label-discharging>
format-discharging-underline = ${self.format-charging-underline}
format-full-prefix = " "
format-full-prefix-foreground = ${colors.foreground-alt}
format-full-underline = ${self.format-charging-underline}
ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-foreground = ${colors.foreground-alt}
animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-foreground = ${colors.foreground-alt}
animation-charging-framerate = 750
animation-discharging-0 = 
animation-discharging-1 = 
animation-discharging-2 = 
animation-discharging-foreground = ${colors.foreground-alt}
animation-discharging-framerate = 750
[module/temperature]
type = internal/temperature
thermal-zone = 0
warn-temperature = 60
format = <ramp> <label>
format-underline = #f50a4d
format-warn = <ramp> <label-warn>
format-warn-underline = ${self.format-underline}
label = %temperature-c%
label-warn = %temperature-c%
label-warn-foreground = ${colors.secondary}
ramp-0 = 
ramp-1 = 
ramp-2 = 
ramp-foreground = ${colors.foreground-alt}
[module/powermenu]
type = custom/menu
expand-right = true
format-spacing = 1
label-open = 
label-open-foreground = ${colors.foreground}
label-close =  cancel
label-close-foreground = ${colors.forground}
label-separator = |
label-separator-foreground = ${colors.foreground-alt}
menu-0-0 = reboot
menu-0-0-exec = menu-open-1
menu-0-1 = power off
menu-0-1-exec = menu-open-2
menu-1-0 = cancel
menu-1-0-exec = menu-open-0
menu-1-1 = reboot
menu-1-1-exec = sudo reboot
menu-2-0 = power off
menu-2-0-exec = sudo poweroff
menu-2-1 = cancel
menu-2-1-exec = menu-open-0
[settings]
screenchange-reload = true
;compositing-background = xor
;compositing-background = screen
;compositing-foreground = source
;compositing-border = over
;pseudo-transparency = false
;[global/wm]
;margin-top = 5
;margin-bottom = 5
; vim:ft=dosini

View File

@@ -0,0 +1,4 @@
#!/bin/bash
killall polybar
polybar -c $HOME/.config/bspwm/polybar/config.ini mainbar &

View File

@@ -0,0 +1,586 @@
[module/layout]
type = custom/script
exec = cat $HOME/.config/bspwm/scripts/current_layout
click-left = $HOME/.config/bspwm/scripts/switch_layouts
interval = 0
format = <label>
label = "%output%"
format-foreground = ${colors.blue}
format-background = ${colors.black}
format-padding = 0
[module/spotify-track]
type = custom/script
interval = 1
exec = $HOME/.config/bspwm/polybar/scripts/spotify.py -f '{song}' | awk '{print toupper($0)}'
format = <label>
format-padding = 0
format-foreground = ${colors.cyan}
format-background = ${colors.black}
label = %output%
label-maxlen = 45
click-left = playerctl -p spotify play-pause
scroll-up = playerctl -p spotify next
scroll-down = playerctl -p spotify previous
[module/spotify-artist]
type = custom/script
interval = 1
exec = $HOME/.config/bspwm/polybar/scripts/spotify.py -f '{artist} ' | awk '{print toupper($0)}'
format = <label>
format-padding = 0
format-foreground = ${colors.pink}
format-background = ${colors.black}
label = %output%
label-maxlen = 45
click-left = playerctl -p spotify play-pause
scroll-up = playerctl -p spotify next
scroll-down = playerctl -p spotify previous
[module/temperature]
type = internal/temperature
; Seconds to sleep between updates
; Default: 1
interval = 0.5
; Thermal zone to use
; To list all the zone types, run
; $ for i in /sys/class/thermal/thermal_zone*; do echo "$i: $(<$i/type)"; done
; Default: 0
thermal-zone = 0
; Full path of temperature sysfs path
; Use `sensors` to find preferred temperature source, then run
; $ for i in /sys/class/hwmon/hwmon*/temp*_input; do echo "$(<$(dirname $i)/name): $(cat ${i%_*}_label 2>/dev/null || echo $(basename ${i%_*})) $(readlink -f $i)"; done
; to find path to desired file
; Default reverts to thermal zone setting
hwmon-path = /sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon1/temp1_input
label-background = ${colors.black}
label-foreground = ${colors.blue}
[module/sep]
type = custom/text
content-foreground = ${colors.background}
content-background = ${colors.background}
content = " "
content-font = 2
[module/sep1]
type = custom/text
content-foreground = ${colors.black}
content-background = ${colors.black}
content = " "
content-font = 2
[module/left1]
type = custom/text
content-foreground = ${colors.black}
content = ""
offset-y = -5
content-font = 2
[module/left2]
type = custom/text
content-foreground = ${colors.black}
content = ""
content-font = 2
[module/medium1]
type = custom/text
content-foreground = ${colors.black}
content = " "
content-font = 2
[module/medium2]
type = custom/text
content-foreground = ${colors.black}
content = ""
content-font = 2
[module/right1]
type = custom/text
content-foreground = ${colors.black}
content = ""
content-font = 2
[module/right2]
type = custom/text
content-foreground = ${colors.black}
content = ""
content-font = 2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/appmenu]
type = custom/text
content-foreground = ${colors.blue}
content-background = ${colors.black}
content = "異"
content-font = 2
click-left = exec $HOME/.config/bspwm/rofi/launch.sh
[module/term]
type = custom/text
content-foreground = ${colors.red}
content-background = ${colors.black}
content = " "
click-left = exec kitty
content-font = 6
[module/thunar]
type = custom/text
content-foreground = ${colors.pink}
content-background = ${colors.black}
content = " "
click-left = exec pcmanfm
content-font = 6
[module/firefox]
type = custom/text
content-foreground = ${colors.orange}
content-background = ${colors.black}
content = " "
click-left = exec firefox
content-font = 6
[module/discord]
type = custom/text
content-foreground = ${colors.blue}
content-background = ${colors.black}
content = "ﭮ "
click-left = exec discord
content-font = 6
[module/launch-spotify]
type = custom/text
content-foreground = ${colors.green}
content-background = ${colors.black}
content = " "
click-left = exec spotify
content-font = 6
[module/dot]
type = custom/text
content =
content-foreground = ${colors.black}
content-background = ${colors.background}
content-font = 6
[module/dot-alt]
inherit = module/dot
content-foreground = ${colors.foreground}
[module/dot-alt2]
inherit = module/dot-alt
content-background = ${colors.black}
[module/ewmh]
type = internal/xworkspaces
pin-workspaces = false
enable-click = true
enable-scroll = false
icon-0 = 1;一
icon-1 = 2;二
icon-2 = 3;三
icon-3 = 4;四
icon-4 = 5;五
icon-5 = 6;六
icon-6 = 7;七
icon-7 = 8;八
icon-8 = 9;九
format = <label-state>
label-active = %icon%
label-active-foreground = ${colors.yellow}
label-active-background = #bd93f9
label-active-padding = 1
label-occupied = %icon%
label-occupied-foreground = ${colors.blue}
label-occupied-background = ${colors.black}
label-occupied-padding = 1
label-urgent = %icon%
label-urgent-foreground = ${colors.red}
label-urgent-padding = 1
label-empty = %icon%
label-empty-foreground = ${colors.fg}
label-empty-padding = 1
;[module/bspwm]
;type = internal/bspwm
;ws-icon-0 = 1;%{F#FAE3B0}
;ascii_distro="arcolinux_small"
;ws-icon-1 = 2;%{F#96CDFB}
;ws-icon-2 = 3;%{F#F28FAD}
;ws-icon-3 = 4;%{F#ABE9B3}
;ws-icon-4 = 5;%{F#96CDFB}
;ws-icon-5 = 6;%{F#FAE3B0}
;ws-icon-6 = 7;%{F#ABE9B3}磊
;
;label-focused = 
;label-focused-background = ${colors.black}
;#label-focused-underline= ${colors.cyan}
;label-focused-foreground = ${colors.yellow}
;#label-focused-underline = ${colors.primary}
;label-focused-padding = 1
;
;label-occupied = 
;label-occupied-background = ${colors.black}
;label-occupied-foreground = ${colors.blue}
;#label-occupied-underline = ${colors.secondary}
;label-occupied-padding = 1
;
;label-urgent = %icon%
;label-urgent-background = ${colors.black}
;label-urgent-foreground = ${colors.orange}
;label-urgent-underline = ${colors.red}
;label-urgent-padding = 1
;
;label-empty = 
;label-empty-background = ${colors.black}
;label-empty-foreground = ${colors.white}
;label-empty-padding = 1
;
;
;; Separator in between workspaces
;label-separator =
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/i3]
type = internal/i3
format = <label-state> <label-mode>
index-sort = true
wrapping-scroll = false
; Only show workspaces on the same output as the bar
;pin-workspaces = true
label-mode-padding = 2
label-mode-foreground =
label-mode-background = ${colors.primary}
; focused = Active workspace on focused monitor
label-focused = %index%
label-focused-background = ${module/bspwm.label-focused-background}
label-focused-underline = ${module/bspwm.label-focused-underline}
label-focused-padding = ${module/bspwm.label-focused-padding}
; unfocused = Inactive workspace on any monitor
label-unfocused = %index%
label-unfocused-padding = ${module/bspwm.label-occupied-padding}
; visible = Active workspace on unfocused monitor
label-visible = %index%
label-visible-background = ${self.label-focused-background}
label-visible-underline = ${self.label-focused-underline}
label-visible-padding = ${self.label-focused-padding}
; urgent = Workspace with urgency hint set
label-urgent = %index%
label-urgent-background = ${module/bspwm.label-urgent-background}
label-urgent-padding = ${module/bspwm.label-urgent-padding}
; Separator in between workspaces
; label-separator = |
;;;;;;;;;;;;;;;;;;;;;;;;
;; Openbox Workspaces ;;
;;;;;;;;;;;;;;;;;;;;;;;;
[module/workspaces]
type = internal/xworkspaces
pin-workspaces = false
enable-click = true
enable-scroll = true
format-padding = 0
format = <label-state>
label-active = %name%
label-active-padding = 2
label-active-foreground = ${colors.background}
label-active-background = ${colors.pink}
label-active-underline = ${colors.background}
label-occupied = %name%
label-occupied-padding = 2
label-occupied-underline = ${colors.foreground}
label-occupied-background = ${colors.background}
label-urgent = %name%
label-urgent-padding = 2
label-urgent-foreground = ${colors.foreground}
label-urgent-background = ${colors.magenta}
label-urgent-underline = ${colors.background}
label-empty = %name%
label-empty-padding = 2
label-empty-foreground = ${colors.foreground}
label-empty-background = ${colors.background}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/notification-center]
type = custom/script
exec = echo 
interval = 100
label = " %output% "
;format-background = ${colors.white}
format-foreground = ${colors.white}
click-left = $HOME/.scripts/rofi_notif_center.sh
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
[module/kernel-name]
type = custom/script
exec = uname -r
interval = 10000
label = "  %output% "
format-foreground = ${colors.white}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/filesystem]
type = internal/fs
; Mountpoints to display
mount-0 = /
; Seconds to sleep between updates
; Default: 30
interval = 10
; Display fixed precision values
; Default: false
fixed-values = true
; Spacing between entries
; Default: 2
spacing = 4
; Available tags:
; <label-mounted> (default)
; <bar-free>
; <bar-used>
; <ramp-capacity>
format-mounted = <label-mounted>
; Available tags:
; <label-unmounted> (default)
format-unmounted = <label-unmounted>
; Available tokens:
; %mountpoint%
; %type%
; %fsname%
; %percentage_free%
; %percentage_used%
; %total%
; %free%
; %used%
; Default: %mountpoint% %percentage_free%%
label-mounted = " %percentage_used%%"
; Available tokens:
; %mountpoint%
; Default: %mountpoint% is not mounted
label-unmounted = %mountpoint%: not mounted
label-unmounted-foreground = #55
label-unmounted-background = ${colors.black}
label-mounted-background = ${colors.black}
label-mounted-foreground = ${colors.magenta}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/pacman-updates]
type = custom/script
exec = checkupdates 2>/dev/null | wc -l || echo "0"
interval = 1000
label = " %output%"
format-foreground = ${colors.green}
format-foreground-error = ${colors.red}
format-background = ${colors.black}
click-left = alacritty -e $SHELL -c 'paru'
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/windowtitle]
type = internal/xwindow
format = <label>
format-background = ${colors.black}
format-foreground = ${colors.blue}
format-padding = 1
label = " %title%"
label-maxlen = 34
label-empty = "  Desktop"
label-separator = " "
label-empty-foreground = ${colors.blue}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/volume]
type = internal/pulseaudio
format-volume = " <ramp-volume><label-volume>"
ramp-volume-0 =" "
ramp-volume-0-foreground = ${colors.green}
ramp-volume-1 ="墳 "
ramp-volume-foreground = ${colors.yellow}
ramp-volume-2 ="墳 "
ramp-volume-2-foreground = ${colors.red}
format-volume-background = ${colors.black}
format-volume-padding = 0
format-muted = <label-muted>
format-muted-background = ${colors.black}
format-muted-foreground = ${colors.white}
label-muted =" Muted"
label-volume-foreground = ${colors.white}
click-right = pavucontrol
label-volume = %percentage%%
bar-volume-width = 10
bar-volume-gradient = false
bar-volume-indicator =
bar-volume-indicator-font = 8
bar-volume-indicator-foreground = ${colors.blue}
bar-volume-fill =
bar-volume-fill-font = 8
bar-volume-foreground-0 = ${colors.blue}
bar-volume-foreground-1 = ${colors.blue}
bar-volume-foreground-2 = ${colors.blue}
bar-volume-foreground-3 = ${colors.blue}
bar-volume-foreground-4 = ${colors.blue}
bar-volume-empty =
bar-volume-empty-font = 8
bar-volume-empty-foreground = ${colors.black}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/battery]
type = internal/battery
battery = BAT0
adapter = ADP1
full-at = 100
format-charging = <label-charging>
format-charging-prefix = ""
format-charging-prefix-font = 2
label-charging = "%percentage%%"
format-discharging = <label-discharging>
label-discharging = "%percentage%%"
format-discharging-prefix = ""
format-discharging-prefix-font = 2
format-discharging-background = ${colors.black}
format-discharging-foreground = ${colors.yellow}
format-charging-background = ${colors.black}
format-charging-foreground = ${colors.yellow}
label-full = " %percentage%%"
format-full-background = ${colors.black}
format-full-foreground = ${colors.green}
format-full-prefix-font = 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/network]
type = internal/network
interface = wlp1s0
format-connected = <label-connected>
format-connected-prefix = ""
format-connected-prefix-font = 1
label-connected = " %essid%"
label-connected-font = 1
format-disconnected = <label-disconnected>
format-disconnected-prefix =
format-disconnected-prefix-font = 1
label-disconnected = " Disconnected"
label-disconnected-font = 1
format-connected-background = ${colors.background}
format-connected-foreground = ${colors.cyan}
format-disconnected-background = ${colors.background}
format-disconnected-foreground = ${colors.red}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/memory]
type = internal/memory
; Seconds to sleep between updates
interval = 3
label = " %percentage_used:2%%"
format-prefix-padding = 2
format-prefix-font = 2
format-prefix-foreground = #ffffff
format-background = ${colors.black}
format-foreground = ${colors.red}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/wired-network]
type = internal/network
interface = eno1
interval = 3.0
accumulate-stats = true
unknown-as-up = true
format-connected = <label-connected>
format-disconnected = <label-disconnected>
label-connected = " %downspeed%"
label-connected-foreground = ${colors.cyan}
label-connected-background = ${colors.black}
label-disconnected = ""
label-disconnected-foreground = ${colors.cyan}
label-disconnected-background = ${colors.black}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/cpu]
type = internal/cpu
interval = 1
format = <label>
label = " %percentage%%"
format-background = ${colors.black}
format-foreground = ${colors.orange}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/date]
type = internal/date
interval = 1
date =
date-alt = "﨟 %A, %b %d -"
time-alt = " %H:%M "
time = " %I:%M %p "
;format-prefix = ""
format-prefix-padding = 1
format-prefix-font = 1
format-prefix-foreground = #ffffff
format-background = ${colors.black}
format-foreground = ${colors.blue}
label = %date% %time%
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/powermenu]
type = custom/text
content = ""
content-font = 2
content-background = ${colors.black}
content-foreground = ${colors.red}
click-left = $HOME/.config/bspwm/rofi/theme.sh

View File

@@ -0,0 +1,52 @@
#!/bin/bash
# The name of polybar bar which houses the main spotify module and the control modules.
PARENT_BAR="example"
PARENT_BAR_PID=$(pgrep -a "polybar" | grep "$PARENT_BAR" | cut -d" " -f1)
# Set the source audio player here.
# Players supporting the MPRIS spec are supported.
# Examples: spotify, vlc, chrome, mpv and others.
# Use `playerctld` to always detect the latest player.
# See more here: https://github.com/altdesktop/playerctl/#selecting-players-to-control
PLAYER="playerctld"
# Format of the information displayed
# Eg. {{ artist }} - {{ album }} - {{ title }}
# See more attributes here: https://github.com/altdesktop/playerctl/#printing-properties-and-metadata
FORMAT="{{ title }} - {{ artist }}"
# Sends $2 as message to all polybar PIDs that are part of $1
update_hooks() {
while IFS= read -r id
do
polybar-msg -p "$id" hook spotify-play-pause $2 1>/dev/null 2>&1
done < <(echo "$1")
}
PLAYERCTL_STATUS=$(playerctl --player=$PLAYER status 2>/dev/null)
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]; then
STATUS=$PLAYERCTL_STATUS
else
STATUS="No player is running"
fi
if [ "$1" == "--status" ]; then
echo "$STATUS"
else
if [ "$STATUS" = "Stopped" ]; then
echo "No music is playing"
elif [ "$STATUS" = "Paused" ]; then
update_hooks "$PARENT_BAR_PID" 2
playerctl --player=$PLAYER metadata --format "$FORMAT"
elif [ "$STATUS" = "No player is running" ]; then
echo "$STATUS"
else
update_hooks "$PARENT_BAR_PID" 1
playerctl --player=$PLAYER metadata --format "$FORMAT"
fi
fi

View File

@@ -0,0 +1,76 @@
#!/bin/env python3
import argparse
import os
import signal
import subprocess
import sys
import tempfile
if len(sys.argv) > 1 and sys.argv[1] == '--subproc':
ramp_list = [' ', '', '', '', '', '', '', '', '']
ramp_list.extend(
f'%{{F#{color.strip(" #")}}}█%{{F-}}'
for color in sys.argv[2].split(',')
if color
)
while True:
cava_input = input().strip().split()
cava_input = [int(i) for i in cava_input]
output = ''
for bar in cava_input:
if bar < len(ramp_list):
output += ramp_list[bar]
else:
output += ramp_list[-1]
print(output)
parser = argparse.ArgumentParser()
parser.add_argument('-f', '--framerate', type=int, default=60,
help='Framerate to be used by cava, default is 60')
parser.add_argument('-b', '--bars', type=int, default=8,
help='Amount of bars, default is 8')
parser.add_argument('-e', '--extra_colors', default='fdd,fcc,fbb,faa',
help='Color gradient used on higher values, separated by commas, default is')
parser.add_argument('-c', '--channels', choices=['stereo', 'left', 'right', 'average'],
help='Audio channels to be used, defaults to stereo')
opts = parser.parse_args()
conf_channels = ''
if opts.channels != 'stereo':
conf_channels = (
'channels=mono\n'
f'mono_option={opts.channels}'
)
conf_ascii_max_range = 12 + len([i for i in opts.extra_colors.split(',') if i])
cava_conf = tempfile.mkstemp('','polybar-cava-conf.')[1]
with open(cava_conf, 'w') as cava_conf_file:
cava_conf_file.write(
'[general]\n'
f'framerate={opts.framerate}\n'
f'bars={opts.bars}\n'
'[output]\n'
'method=raw\n'
'data_format=ascii\n'
f'ascii_max_range={conf_ascii_max_range}\n'
'bar_delimiter=32'
+ conf_channels
)
cava_proc = subprocess.Popen(['cava', '-p', cava_conf], stdout=subprocess.PIPE)
self_proc = subprocess.Popen(['python3', __file__, '--subproc', opts.extra_colors], stdin=cava_proc.stdout)
def cleanup(sig, frame):
os.remove(cava_conf)
cava_proc.kill()
self_proc.kill()
sys.exit(0)
signal.signal(signal.SIGTERM, cleanup)
signal.signal(signal.SIGINT, cleanup)
self_proc.wait()

View File

@@ -0,0 +1,12 @@
#!/bin/bash
# see man zscroll for documentation of the following parameters
zscroll -l 30 \
--delay 0.1 \
--scroll-padding "  " \
--match-command "`dirname $0`/get_spotify_status.sh --status" \
--match-text "Playing" "--scroll 1" \
--match-text "Paused" "--scroll 0" \
--update-check true "`dirname $0`/get_spotify_status.sh" &
wait

View File

@@ -0,0 +1,149 @@
#!/usr/bin/env python3
#!/usr/bin/env python
import sys
import dbus
import argparse
parser = argparse.ArgumentParser()
parser.add_argument(
'-t',
'--trunclen',
type=int,
metavar='trunclen'
)
parser.add_argument(
'-f',
'--format',
type=str,
metavar='custom format',
dest='custom_format'
)
parser.add_argument(
'-p',
'--playpause',
type=str,
metavar='play-pause indicator',
dest='play_pause'
)
parser.add_argument(
'--font',
type=str,
metavar='the index of the font to use for the main label',
dest='font'
)
parser.add_argument(
'--playpause-font',
type=str,
metavar='the index of the font to use to display the playpause indicator',
dest='play_pause_font'
)
parser.add_argument(
'-q',
'--quiet',
action='store_true',
help="if set, don't show any output when the current song is paused",
dest='quiet',
)
args = parser.parse_args()
def fix_string(string):
# corrects encoding for the python version used
if sys.version_info.major == 3:
return string
else:
return string.encode('utf-8')
def truncate(name, trunclen):
if len(name) > trunclen:
name = name[:trunclen]
name += '...'
if ('(' in name) and (')' not in name):
name += ')'
return name
# Default parameters
output = fix_string(u'{artist} ~ {song}')
trunclen = 35
play_pause = fix_string(u'\u25B6,\u23F8') # first character is play, second is paused
label_with_font = '%{{T{font}}}{label}%{{T-}}'
font = args.font
play_pause_font = args.play_pause_font
quiet = args.quiet
# parameters can be overwritten by args
if args.trunclen is not None:
trunclen = args.trunclen
if args.custom_format is not None:
output = args.custom_format
if args.play_pause is not None:
play_pause = args.play_pause
try:
session_bus = dbus.SessionBus()
spotify_bus = session_bus.get_object(
'org.mpris.MediaPlayer2.spotify',
'/org/mpris/MediaPlayer2'
)
spotify_properties = dbus.Interface(
spotify_bus,
'org.freedesktop.DBus.Properties'
)
metadata = spotify_properties.Get('org.mpris.MediaPlayer2.Player', 'Metadata')
status = spotify_properties.Get('org.mpris.MediaPlayer2.Player', 'PlaybackStatus')
# Handle play/pause label
play_pause = play_pause.split(',')
if status == 'Playing':
play_pause = play_pause[0]
elif status == 'Paused':
play_pause = play_pause[1]
else:
play_pause = str()
if play_pause_font:
play_pause = label_with_font.format(font=play_pause_font, label=play_pause)
# Handle main label
artist = fix_string(metadata['xesam:artist'][0]) if metadata['xesam:artist'] else ''
song = fix_string(metadata['xesam:title']) if metadata['xesam:title'] else ''
# song = metadata['xesam:title']
album = fix_string(metadata['xesam:album']) if metadata['xesam:album'] else ''
if (quiet and status == 'Paused') or (not artist and not song and not album):
print('')
elif (song == 'Spotify') or (song == 'Advertisement'):
print(truncate(output.format(artist="Spotify",
song="Advertisement",
play_pause=play_pause,
album=""), trunclen + 4))
else:
if font:
artist = label_with_font.format(font=font, label=artist)
song = label_with_font.format(font=font, label=song)
album = label_with_font.format(font=font, label=album)
# Add 4 to trunclen to account for status symbol, spaces, and other padding characters
print(truncate(output.format(artist=artist,
song=song,
play_pause=play_pause,
album=album), trunclen + 4))
except Exception as e:
if isinstance(e, dbus.exceptions.DBusException):
print('')
else:
print(e)