Add i3info to polybar
Signed-off-by: Severin Kaderli <severin@kaderli.dev>
This commit is contained in:
parent
b2e45c8af1
commit
4f6c7a9746
2 changed files with 32 additions and 6 deletions
|
@ -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 #
|
||||
|
|
17
system/.config/polybar/scripts/i3info.py
Executable file
17
system/.config/polybar/scripts/i3info.py
Executable 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("")
|
Loading…
Add table
Add a link
Reference in a new issue