Add i3info to polybar

Signed-off-by: Severin Kaderli <severin@kaderli.dev>
This commit is contained in:
Severin Kaderli 2020-02-04 19:46:46 +01:00
parent b2e45c8af1
commit 4f6c7a9746
Signed by: severinkaderli
GPG key ID: F419F8835B72F0C4
2 changed files with 32 additions and 6 deletions

View file

@ -42,7 +42,7 @@ foreground = ${settings.foreground-color}
padding-right = 2
module-margin = 2
modules-left = i3
modules-left = i3 i3info
modules-center =
modules-right = update battery battery2 volume backlight vpn wlan ethernet date power
tray-position = none
@ -76,10 +76,7 @@ enable-click = true
enable-scroll = true
wrapping-scroll = false
format = <label-state> <label-mode>
label-mode = [ %mode% ]
label-mode-padding = ${settings.padding}
format = <label-state>
label-focused = %name%
label-focused-foreground = ${settings.background-color}
@ -123,6 +120,18 @@ interval = 60
click-left = xdg-open "https://www.archlinux.org/"
###############################################################################
# i3 info #
###############################################################################
[module/i3info]
type = custom/script
exec = ${XDG_CONFIG_HOME}/polybar/scripts/i3info.py
format = <label>
label = %output%
interval = 1
###############################################################################
# Battery indicator #

View file

@ -0,0 +1,17 @@
#!/usr/bin/env python3
import i3ipc
i3 = i3ipc.Connection()
splitv_text = '[ V ]'
splith_text = '[ H ]'
split_none = ''
parent = i3.get_tree().find_focused().parent
# if parent.layout == 'splitv':
# print(splitv_text)
# elif parent.layout == 'splith':
# print(splith_text)
# else:
# print(split_none)
print("")