Add battery ramps and detailed clocks

Like the wlan strength icons, the clocks and battery ramps draw multiple
glyphs at the same location to create multi-coloured icons. For them to
show up, you need my Bar Material Supplement font, which isn't published
yet because I haven't decided on a license nor on a way to host it.
This commit is contained in:
M1dgard 2018-05-20 23:37:43 +02:00
parent 717b208a94
commit 385ea67efd
Signed by untrusted user who does not match committer: midgard
GPG key ID: 511C112F1331BBB4
2 changed files with 74 additions and 31 deletions

View file

@ -19,13 +19,14 @@ try:
exit(1)
faces = "🕛🕧🕐🕜🕑🕝🕒🕞🕓🕟🕔🕠🕕🕡🕖🕢🕗🕣🕘🕤🕙🕥🕚🕦🕛"
hourhands = ""
minutehands = ""
def face_for(t):
minute = (t.minute + 15) // 30
hour = (t.hour + 0 if minute < 45 else 1) % 12
minute = minutehands[ t.minute // 5 ]
hour = hourhands [ t.hour % 12 ]
return faces[2*hour + minute]
return "%{F000}%{O-24}" + hour + "%{O-24}" + minute
def color_for(t):
@ -47,15 +48,24 @@ try:
leftnow = utcnow.astimezone(tzleft )
rightnow = utcnow.astimezone(tzright)
print(
"%{T2}%{F#" + color_for(leftnow) + "}" +
localnow.strftime("%A") +
" " +
"%{T8}%{F#" + color_for(leftnow) + "}" +
face_for(leftnow) +
"%{F}%{T-}" +
localnow.strftime("%A %%{T4}%%{F"+color_for(localnow)+"}%H:%M%%{F}%%{T-} %d %b") +
" %{F"+color_for(localnow)+"}" +
# "%{T4}" + localnow.strftime("%H:%M") + "%{T-}" +
"%{T8}" + face_for(localnow) + "%{T-}" +
"%{F} " +
" %{T2}%{F#" + color_for(rightnow) + "}" +
"%{T8}%{F#" + color_for(rightnow) + "}" +
face_for(rightnow) +
"%{F}%{T-}",
"%{F}%{T-}" +
" " +
localnow.strftime("%d %b"),
flush = True
)

View file

@ -47,9 +47,10 @@ font-3 = "Fira Sans:size=12;2"
font-4 = "Fira Mono:size=7;0"
; Specialised icons
font-5 = "Weather Icons:size=10;1"
font-6 = "Material Wifi Signal strength:pixelsize=14;2"
font-6 = "Bar Material Supplements:pixelsize=14;1"
font-7 = "Bar Material Supplements:pixelsize=19;4"
; MPD song position
font-7 = "Fira Mono:size=7;-1"
font-8 = "Fira Mono:size=7;-1"
cursor-click = pointer
cursor-scroll = ns-resize
@ -98,7 +99,7 @@ label-indicator-background = ${colors.secondary}
[module/filesystem]
type = internal/fs
interval = 25
interval = 24
mount-0 = /
@ -224,7 +225,7 @@ card = intel_backlight
[module/cpu]
type = internal/cpu
interval = 2
interval = 3
;format-prefix = " "
format = <ramp-coreload>%{O-20}
format-foreground = ${colors.foreground-alt}
@ -256,7 +257,7 @@ ramp-coreload-7-foreground = ${colors.foreground-alert}
[module/memory]
type = internal/memory
interval = 2
interval = 3
format = "<label>"
label = "%{F#777}%{F}%percentage_used:3%%%{O-20}"
@ -265,6 +266,8 @@ type = internal/temperature
thermal-zone = 0
warn-temperature = 80
interval = 3
;format = <ramp> <label>
format = %{F#888}%{F} <label>
format-warn = %{T3}%{T-} <label-warn>
@ -281,7 +284,7 @@ ramp-foreground = ${colors.foreground-alt}
[module/wlan]
type = internal/network
interface = wlp5s0
interval = 3.0
interval = 3
; %{T7} select font 7
; %{F#333} use a dark foreground colour
@ -309,7 +312,7 @@ ramp-signal-foreground = ${colors.foreground}
[module/eth]
type = internal/network
interface = enp4s0
interval = 3.0
interval = 3
;format-connected-prefix = " "
;format-connected-prefix-foreground = ${colors.foreground}
@ -366,27 +369,57 @@ type = internal/battery
battery = BAT0
adapter = AC
full-at = 98
interval = 5
; FIXME
;format-charging = <animation-charging> <label-charging>
format-charging = <label-charging>
format-charging = %{T7}%{F555}%{O-18}%{FED9}<ramp-capacity>%{O-17}%{F000}%{F}%{T-}%{O2}<label-charging>
label-charging = %percentage%%
;format-discharging = <ramp-capacity> <label-discharging>
format-discharging = <label-discharging>
format-discharging = %{F555}%{O-18}%{F}<ramp-capacity>%{O2}<label-discharging>
label-discharging = %percentage%%
;format-full-prefix = " "
format-full-prefix = ""
format-full-prefix = ""
format-full-prefix-foreground = ${colors.foreground-alt}
ramp-capacity-0 =
ramp-capacity-1 =
ramp-capacity-2 =
ramp-capacity-foreground = ${colors.foreground-alt}
; <5
ramp-capacity-0 = %{FF55}
; 5
ramp-capacity-1 = %{FF55}
; 10
ramp-capacity-2 = %{FF55}
ramp-capacity-3 = %{FF55}
; 20
ramp-capacity-4 =
ramp-capacity-5 =
; 30
ramp-capacity-6 =
ramp-capacity-7 =
; 40
ramp-capacity-8 =
ramp-capacity-9 =
; 50
ramp-capacity-10 =
ramp-capacity-11 =
; 60
ramp-capacity-12 =
ramp-capacity-13 =
; 70
ramp-capacity-14 =
ramp-capacity-15 =
; 80
ramp-capacity-16 =
ramp-capacity-17 =
; 90
ramp-capacity-18 =
ramp-capacity-19 =
; 95
ramp-capacity-20 =
; full
ramp-capacity-21 =
animation-charging-0 =
animation-charging-1 =
animation-charging-2 =
animation-charging-foreground = ${colors.foreground-alt}
animation-charging-0 =
animation-charging-1 =
animation-charging-2 =
animation-charging-3 =
animation-charging-framerate = 750
[module/powermenu]