Update for waybar
This commit is contained in:
@ -38,6 +38,9 @@ PID can be a string or a number."
|
||||
(setq args (nconc (list "-c" cfg-dir) args)))
|
||||
(apply 'call-process "eww" nil 0 nil args)))
|
||||
|
||||
(defun update-waybar ()
|
||||
(call-process "pkill" nil 0 nil "-RTMIN+1" "waybar"))
|
||||
|
||||
(cl-defun has-focused-window-p (&optional (server "server"))
|
||||
"Return non-nil if SERVER has at least one focused window.
|
||||
SERVER defaults to \"server\"."
|
||||
@ -50,7 +53,8 @@ SERVER defaults to \"server\"."
|
||||
"org.fcitx.Fcitx.Controller1" "Toggle")
|
||||
(let ((state (dbus-call-method :session "org.fcitx.Fcitx5" "/controller"
|
||||
"org.fcitx.Fcitx.Controller1" "State")))
|
||||
(set-eww-fcitx-state state)))
|
||||
(set-eww-fcitx-state state)
|
||||
(update-waybar)))
|
||||
|
||||
;; Local Variables:
|
||||
;; flycheck-disabled-checkers: (emacs-lisp-checkdoc)
|
||||
|
@ -1,4 +1,11 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
let greather_than_zero=0
|
||||
if [[ "${1}" == '-g' ]]; then
|
||||
greather_than_zero=1
|
||||
fi
|
||||
|
||||
lines=(${(f)"$(mu find '(maildir:/protonmail/Inbox or maildir:/ucsc-gmail/Inbox) AND flag:unread' 2>/dev/null)"})
|
||||
printf '%d' "${#lines}"
|
||||
if [[ ${#lines} > 0 ]] || ! (( greather_than_zero )); then
|
||||
printf '%d' "${#lines}"
|
||||
fi
|
||||
|
@ -1,5 +1,10 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
let bluetooth=1
|
||||
if [[ "${1}" == '--no-bluetooth' ]] || [[ "${1}" == '-n' ]]; then
|
||||
bluetooth=0
|
||||
fi
|
||||
|
||||
if [[ "$(uname)" = 'Linux' ]]; then
|
||||
local active_networks="$(nmcli --fields type c s --active)"
|
||||
local output=''
|
||||
@ -7,7 +12,9 @@ if [[ "$(uname)" = 'Linux' ]]; then
|
||||
[[ "${active_networks}" = *'ethernet'* ]] && output="${output}"
|
||||
[[ "${active_networks}" = *'wireguard'* ]] && output="${output} "
|
||||
(( ${#output} == 0 )) && output=''
|
||||
bluetoothctl show | grep 'Powered: yes' >/dev/null && output="${output} "
|
||||
if (( bluetooth )); then
|
||||
bluetoothctl show | grep 'Powered: yes' >/dev/null && output="${output} "
|
||||
fi
|
||||
printf '%s\n' "${output}"
|
||||
else
|
||||
echo "${0}: error: unknown os: \"$(uname)\"" >&2
|
||||
|
Reference in New Issue
Block a user