From db9e04378d888b1fbcd080a106d9b095fde94403 Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Sat, 27 Apr 2024 14:23:43 -0700 Subject: [PATCH] Add eww-toggle-systray --- eww-fcitx5-toggle | 5 ++++- eww-toggle-systray | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100755 eww-toggle-systray diff --git a/eww-fcitx5-toggle b/eww-fcitx5-toggle index 2364176..b31dc2b 100755 --- a/eww-fcitx5-toggle +++ b/eww-fcitx5-toggle @@ -1,3 +1,6 @@ #!/bin/sh +if [ "${#}" -gt 0 ]; then + config_flags="-c ${1}" +fi fcitx5-remote -t -eww update fcitx5-state="$(fcitx5-remote)" +eww ${config_flags} update fcitx5-state="$(fcitx5-remote)" diff --git a/eww-toggle-systray b/eww-toggle-systray new file mode 100755 index 0000000..5ca6156 --- /dev/null +++ b/eww-toggle-systray @@ -0,0 +1,18 @@ +#!/usr/bin/env zsh + +local config_flags=() +if ((${#} >= 1)); then + config_flags+=("-c" "${1}") +fi + +local value="$(eww ${config_flags} get show-systray)" +case "${value}" in + 'false') + value='true' + ;; + *) + value='false' + ;; +esac + +eww ${config_flags} update show-systray="${value}"