Update X desktop info handling
- Update initial value for `xdistate` - Function for current window name
This commit is contained in:
parent
bc3a9611fa
commit
62a705ee41
@ -17,9 +17,7 @@ fn panel_center() {
|
|||||||
truncate = true
|
truncate = true
|
||||||
truncate_left = false
|
truncate_left = false
|
||||||
limit_width = config.panel_windowtitle_maxchars
|
limit_width = config.panel_windowtitle_maxchars
|
||||||
text = global("xdistate").mutate(|val|{
|
text = xdi.windowname()
|
||||||
json.parse(val).active_window.name
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
import "nbcl/vars/xdi.nbcl" as xdi
|
import "nbcl/vars/xdi.nbcl" as xdi { * }
|
||||||
|
|
||||||
Poll "time_hhmm" {
|
Poll "time_hhmm" {
|
||||||
initial = "00:00"
|
initial = "00:00"
|
||||||
|
|||||||
@ -1,9 +1,13 @@
|
|||||||
import core.json
|
import core.json
|
||||||
|
|
||||||
Listen "xdistate" {
|
Listen "xdistate" {
|
||||||
initial = "{}"
|
initial = "{\"active_window\":{\"id\":0,\"name\":\"\",\"class\":\"\"},\"workspaces\":[{\"id\":0,\"current\":true,\"windows\":[]}]}"
|
||||||
cmd = "xdi -f"
|
cmd = "/usr/local/bin/xdi -f"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Usage: xdi.windowname()
|
||||||
#let wmstate =
|
fn windowname() {
|
||||||
|
global("xdistate").mutate(|val|{
|
||||||
|
json.parse(val).active_window.name
|
||||||
|
})
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user