[polybar] Getting tired of the timezones
This commit is contained in:
parent
5b71427ac5
commit
15c095dd69
2 changed files with 17 additions and 16 deletions
|
@ -7,16 +7,16 @@ import pytz
|
|||
|
||||
|
||||
try:
|
||||
if len(sys.argv) < 3:
|
||||
print("Usage: {scriptname} timezone_left timezone_right".format(scriptname=sys.argv[0]), file=sys.stderr)
|
||||
exit(1)
|
||||
# if len(sys.argv) < 3:
|
||||
# print("Usage: {scriptname} timezone_left timezone_right".format(scriptname=sys.argv[0]), file=sys.stderr)
|
||||
# exit(1)
|
||||
|
||||
try:
|
||||
tzleft = pytz.timezone(sys.argv[1])
|
||||
tzright = pytz.timezone(sys.argv[2])
|
||||
except pytz.exceptions.UnknownTimeZoneError as e:
|
||||
print('Unknown time zone "{}"'.format(e.args[0]), file=sys.stderr)
|
||||
exit(1)
|
||||
# try:
|
||||
# tzleft = pytz.timezone(sys.argv[1])
|
||||
# tzright = pytz.timezone(sys.argv[2])
|
||||
# except pytz.exceptions.UnknownTimeZoneError as e:
|
||||
# print('Unknown time zone "{}"'.format(e.args[0]), file=sys.stderr)
|
||||
# exit(1)
|
||||
|
||||
|
||||
hourhands = ""
|
||||
|
@ -45,8 +45,8 @@ try:
|
|||
while True:
|
||||
utcnow = datetime.now(tz=pytz.utc)
|
||||
localnow = datetime.now()
|
||||
leftnow = utcnow.astimezone(tzleft )
|
||||
rightnow = utcnow.astimezone(tzright)
|
||||
# leftnow = utcnow.astimezone(tzleft )
|
||||
# rightnow = utcnow.astimezone(tzright)
|
||||
|
||||
localcolor = color_for(localnow)
|
||||
|
||||
|
@ -54,14 +54,14 @@ try:
|
|||
localnow.strftime("%A") +
|
||||
" " +
|
||||
|
||||
face_for(leftnow) +
|
||||
# face_for(leftnow) +
|
||||
|
||||
" %{T4}" + localcolor + localnow.strftime("%H") +
|
||||
"%{O2}%{T8}" + face_for(localnow) +
|
||||
"%{O2}%{T4}" + localcolor + localnow.strftime("%M") + "%{T-}" +
|
||||
" " +
|
||||
|
||||
face_for(rightnow) +
|
||||
# face_for(rightnow) + " " +
|
||||
|
||||
" " +
|
||||
localnow.strftime("%d %b"),
|
||||
|
|
|
@ -338,7 +338,8 @@ label-connected = "%{O-32}"
|
|||
type = custom/script
|
||||
tail = true
|
||||
|
||||
exec = ~/.config/polybar/clock.py America/Detroit Asia/Seoul
|
||||
exec = ~/.config/polybar/clock.py
|
||||
;America/Detroit Asia/Seoul
|
||||
|
||||
[module/volume]
|
||||
type = internal/pulseaudio
|
||||
|
|
Loading…
Reference in a new issue