Skip to content

Commit

Permalink
polybar: add temp
Browse files Browse the repository at this point in the history
  • Loading branch information
SqrtMinusOne committed Jan 18, 2024
1 parent fa4a3d4 commit 23e102d
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 17 deletions.
33 changes: 23 additions & 10 deletions .config/polybar/config
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,9 @@ gright = 
; Glyph settings:1 ends here

; [[file:../../Desktop.org::*Generating glyphs][Generating glyphs:3]]
[module/glyph-light-cyan--cyan]
[module/glyph-light-cyan--light-cyan]
type = custom/text
content-background = ${colors.light-cyan}
content-foreground = ${colors.cyan}
content = ${glyph.gright}
content-font = 5

[module/glyph-magenta--light-cyan]
type = custom/text
content-background = ${colors.magenta}
content-foreground = ${colors.light-cyan}
content = ${glyph.gright}
content-font = 5
Expand Down Expand Up @@ -97,13 +90,20 @@ content-foreground = ${colors.light-green}
content = ${glyph.gright}
content-font = 5

[module/glyph-magenta--cyan]
[module/glyph-light-cyan--cyan]
type = custom/text
content-background = ${colors.magenta}
content-background = ${colors.light-cyan}
content-foreground = ${colors.cyan}
content = ${glyph.gright}
content-font = 5

[module/glyph-magenta--light-cyan]
type = custom/text
content-background = ${colors.magenta}
content-foreground = ${colors.light-cyan}
content = ${glyph.gright}
content-font = 5

[module/glyph-light-magenta--magenta]
type = custom/text
content-background = ${colors.light-magenta}
Expand Down Expand Up @@ -421,6 +421,19 @@ ramp-capacity-3 = 
ramp-capacity-4 = 
; battery:1 ends here

; [[file:../../Desktop.org::*temperature][temperature:1]]
[module/temperature]
type = internal/temperature
interval = 10

format = <label>
format-foreground = ${colors.foreground}
format-background = ${colors.light-cyan}
format-warn =  <label-warn>
format-warn-foreground = ${colors.foreground}
format-warn-background = ${colors.light-cyan}
; temperature:1 ends here

; [[file:../../Desktop.org::*weather][weather:2]]
[module/weather]
type = custom/script
Expand Down
14 changes: 14 additions & 0 deletions Desktop.org
Original file line number Diff line number Diff line change
Expand Up @@ -1926,6 +1926,7 @@ As we want to interweave polybar modules with these glyphs in the right order an
|-------+-------------+---------------+-------|
| 1 | pulseaudio | light-magenta | + |
| 2 | mpd | magenta | + |
| 15 | temperature | light-cyan | + |
| 9 | battery | light-cyan | + |
| 3 | cpu | cyan | + |
| 4 | ram-memory | light-green | + |
Expand Down Expand Up @@ -2650,6 +2651,19 @@ ramp-capacity-3 = 
ramp-capacity-4 = 
#+end_src

*** temperature
#+begin_src conf-windows :noweb yes
[module/temperature]
type = internal/temperature
interval = 10

format = <label>
format-foreground = ${colors.foreground}
format-background = <<get-polybar-bg(module="battery")>>
format-warn =  <label-warn>
format-warn-foreground = ${colors.foreground}
format-warn-background = <<get-polybar-bg(module="battery")>>
#+end_src
*** weather
Gets current weather from [[http://wttr.in/][wttr.in]]
#+begin_src bash :tangle ./bin/polybar/weather.sh
Expand Down
14 changes: 7 additions & 7 deletions bin/polybar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ declare -A BAR_HEIGHT=(
["DP-1"]="29"
)
declare -A BLOCKS=(
["eDP"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--light-cyan battery glyph-light-cyan--cyan cpu glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
["eDP-1"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--light-cyan battery glyph-light-cyan--cyan cpu glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
["DVI-D-0"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--cyan cpu glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
["HDMI-A-0"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--cyan cpu glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
["HDMI-1"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--light-cyan battery glyph-light-cyan--cyan cpu glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
["HDMI-0"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--cyan cpu glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
["DP-1"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--cyan cpu glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
["eDP"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--light-cyan temperature glyph-light-cyan--light-cyan battery glyph-light-cyan--cyan cpu glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
["eDP-1"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--light-cyan temperature glyph-light-cyan--light-cyan battery glyph-light-cyan--cyan cpu glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
["DVI-D-0"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--light-cyan temperature glyph-light-cyan--cyan cpu glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
["HDMI-A-0"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--light-cyan temperature glyph-light-cyan--cyan cpu glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
["HDMI-1"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--light-cyan temperature glyph-light-cyan--light-cyan battery glyph-light-cyan--cyan cpu glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
["HDMI-0"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--light-cyan temperature glyph-light-cyan--cyan cpu glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
["DP-1"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--light-cyan temperature glyph-light-cyan--cyan cpu glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
)

# Geolocation for some modules
Expand Down

0 comments on commit 23e102d

Please sign in to comment.