os/+arch (polybar): polish + tweaks + add eth module
This commit is contained in:
parent
ff014c91b3
commit
ccbb415d3f
|
@ -50,7 +50,7 @@ font-2 = FontAwesome:fontformat=truetype:size=11;1
|
|||
|
||||
modules-left = bspwm
|
||||
modules-center = date
|
||||
modules-right = pkg mail volume redshift
|
||||
modules-right = eth pkg mail volume redshift
|
||||
|
||||
enable-ipc = true
|
||||
|
||||
|
@ -239,11 +239,11 @@ ramp-signal-foreground = ${colors.foreground-alt}
|
|||
|
||||
[module/eth]
|
||||
type = internal/network
|
||||
interface = enp0s31f6
|
||||
interface = ${env:ETH:enp0s31f6}
|
||||
interval = 3.0
|
||||
|
||||
format-connected-underline = #55aa55
|
||||
format-connected-prefix = " "
|
||||
; format-connected-underline = #55aa55
|
||||
; format-connected-prefix = " "
|
||||
format-connected-foreground-foreground = ${colors.foreground-alt}
|
||||
label-connected = %local_ip%
|
||||
|
||||
|
@ -275,9 +275,9 @@ format-volume = <ramp-volume>
|
|||
; label-volume = " "
|
||||
label-volume-foreground = ${root.foreground}
|
||||
|
||||
format-muted-prefix = " "
|
||||
; format-muted-prefix = " "
|
||||
format-muted-foreground = ${colors.foreground-alt}
|
||||
; label-muted = sound muted
|
||||
label-muted =
|
||||
|
||||
bar-volume-width = 10
|
||||
bar-volume-foreground-0 = #55aa55
|
||||
|
|
|
@ -15,6 +15,7 @@ n = 0
|
|||
if os.path.isfile(CONFIG_FILE):
|
||||
with open(CONFIG_FILE) as fp:
|
||||
for line in fp:
|
||||
if line:
|
||||
addr, pwd = line.strip().split(",")
|
||||
obj = imaplib.IMAP4_SSL('imap.gmail.com', 993)
|
||||
obj.login(addr, pwd)
|
||||
|
@ -22,7 +23,8 @@ if os.path.isfile(CONFIG_FILE):
|
|||
n += len(obj.search(None, 'UnSeen')[1][0].split())
|
||||
obj.close()
|
||||
obj.logout()
|
||||
print("%{{F#{}}}{} {}".format(COLOR_HL if n > 0 else COLOR_NONE, ICON, n))
|
||||
cl = COLOR_HL if n > 0 else COLOR_NONE
|
||||
print("%{{u#{}}}%{{F#{}}}{} {}".format(cl, cl, ICON, n))
|
||||
else:
|
||||
print("%{{F#{}}}{} -".format(COLOR_ERR, ICON))
|
||||
sys.exit(1)
|
||||
|
|
Loading…
Reference in a new issue