eww: Show current keyboard layout
This commit is contained in:
@ -163,6 +163,15 @@ scale trough {
|
|||||||
background: $lowlight2;
|
background: $lowlight2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.toggleable {
|
||||||
|
transition: border 0.5s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toggleable.on {
|
||||||
|
border-left: solid 2px green;
|
||||||
|
border-right: solid 2px green;
|
||||||
|
}
|
||||||
|
|
||||||
.clickable {
|
.clickable {
|
||||||
transition: background-color 0.2s;
|
transition: background-color 0.2s;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -175,17 +175,15 @@
|
|||||||
: "wmutils xwayland start && ${EWW_CMD} update xwayland_on=true"
|
: "wmutils xwayland start && ${EWW_CMD} update xwayland_on=true"
|
||||||
}
|
}
|
||||||
:hexpand true
|
:hexpand true
|
||||||
:class "thingy clickable"
|
:class {"thingy clickable toggleable" + (xwayland_on ? " on" : "")}
|
||||||
(label :text {
|
(label :text "XWL")
|
||||||
xwayland_on ? "Xwa" : "Way"
|
|
||||||
})
|
|
||||||
))
|
))
|
||||||
|
|
||||||
(defwidget kb_layout []
|
(defwidget kb_layout []
|
||||||
(button :onclick "niri msg action switch-layout next"
|
(button :onclick "wmutils next-keyboard-layout"
|
||||||
:hexpand true
|
:hexpand true
|
||||||
:class "thingy clickable"
|
:class "thingy clickable"
|
||||||
(label :text "KBL")
|
(label :text keyboard_layout)
|
||||||
))
|
))
|
||||||
|
|
||||||
(defwidget date []
|
(defwidget date []
|
||||||
@ -254,6 +252,8 @@
|
|||||||
(defpoll current_month :interval "60s" "date +%b")
|
(defpoll current_month :interval "60s" "date +%b")
|
||||||
(defpoll current_temp :interval "5s" "cat /sys/class/thermal/thermal_zone*/temp")
|
(defpoll current_temp :interval "5s" "cat /sys/class/thermal/thermal_zone*/temp")
|
||||||
|
|
||||||
|
(defpoll keyboard_layout :interval "5s" "wmutils keyboard-layout --short")
|
||||||
|
|
||||||
(defpoll xwayland_on :interval "5s" "wmutils xwayland is-running")
|
(defpoll xwayland_on :interval "5s" "wmutils xwayland is-running")
|
||||||
|
|
||||||
(defvar vpn_status "{'icon': '-', 'class': 'disconnected'}" )
|
(defvar vpn_status "{'icon': '-', 'class': 'disconnected'}" )
|
||||||
|
|||||||
Reference in New Issue
Block a user