From bc8e5d8c78c6997eca3258b7c4c20c727e7f0063 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 25 May 2025 14:26:32 +0200 Subject: worktime-ui --- accounts/gkleen@sif/default.nix | 2 +- accounts/gkleen@sif/niri/default.nix | 30 ++++++++++++++++++++---------- 2 files changed, 21 insertions(+), 11 deletions(-) (limited to 'accounts/gkleen@sif') diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix index ac520249..041ffa9e 100644 --- a/accounts/gkleen@sif/default.nix +++ b/accounts/gkleen@sif/default.nix @@ -344,7 +344,7 @@ in { font = "Fira Sans"; }; colors = { - background = "000000aa"; + background = "000000cc"; text = "cdd6f4ff"; match = "94e2d5ff"; selection = "585b70ff"; diff --git a/accounts/gkleen@sif/niri/default.nix b/accounts/gkleen@sif/niri/default.nix index bc4e24c8..9bd6eafd 100644 --- a/accounts/gkleen@sif/niri/default.nix +++ b/accounts/gkleen@sif/niri/default.nix @@ -134,7 +134,7 @@ let windows_json="$(niri msg -j windows)" active_workspace="$(jq -r '.[] | select(.is_focused) | .workspace_id' <<<"$windows_json")" - window_ix="$(gojq -r --arg active_workspace "$active_workspace" '.[] | select('"$window_select"') | "\(.title)\u0000icon\u001f\(.app_id)"' <<<"$windows_json" | fuzzel --log-level=warning --dmenu --index)" + window_ix="$(gojq -r --arg active_workspace "$active_workspace" '.[] | select('"$window_select"') | "\(.title)\u0000icon\u001f\(.app_id)"' <<<"$windows_json" | fuzzel --width=60 --log-level=warning --dmenu --index)" # shellcheck disable=SC2016 window_json="$(gojq -rc --arg active_workspace "$active_workspace" --arg window_ix "$window_ix" 'map(select('"$window_select"')) | .[($window_ix | tonumber)]' <<<"$windows_json")" @@ -449,7 +449,7 @@ in { { title = "^Access Request.*"; } { title = ".*Passkey credentials$"; } ]; - windowRuleExtra = [ + windowRuleExtra = with kdl; [ (kdl.leaf "open-focused" false) ]; key = "Mod+Control+P"; @@ -477,6 +477,20 @@ in { app-id = "com.github.wwmm.easyeffects"; spawn = [ "easyeffects" ]; } + { name = "time"; + key = "Mod+Control+K"; + app-id = "chrome-kimai.yggdrasil.li__-Default"; + spawn = [ (toString (pkgs.resholve.writeScript "kimai" { + interpreter = pkgs.runtimeShell; + inputs = [ pkgs.dex ]; + execer = [ "cannot:${lib.getExe pkgs.dex}" ]; + } '' + exec dex $HOME/.local/state/nix/profile/share/applications/kimai.desktop + '')) ]; + windowRuleExtra = with kdl; [ + (leaf "block-out-from" "screencast") + ]; + } ]; programs.niri.config = let @@ -682,12 +696,6 @@ in { (leaf "match" { app-id = "^chrome-web\.openrainbow\.com__-Default$"; }) (leaf "open-on-workspace" "comm") ]) - (plain "window-rule" [ - (leaf "match" { app-id = "^chrome-kimai\.yggdrasil\.li__-Default$"; }) - (leaf "open-on-workspace" "comm") - (leaf "open-fullscreen" false) - (plain "default-column-width" [(leaf "proportion" (2. / 3.))]) - ]) (plain "window-rule" [ (leaf "match" { app-id = "^firefox$"; }) (leaf "open-on-workspace" "web") @@ -803,7 +811,7 @@ in { done < <(export LC_ALL=C.UTF-8; echo; find "$RESULTS_DIR" -type f -printf $'%T@ %p\n' | sort -n | cut -d' ' -f2- | xargs -r cat) $FOUND || echo } - FUZZEL_RES=$(prev | fuzzel --dmenu --prompt "qalc> ") || exit $? + FUZZEL_RES=$(prev | fuzzel --dmenu --prompt "qalc> " --width=60) || exit $? if [[ "$FUZZEL_RES" =~ .*\ =\ .* ]]; then QALC_RES="$FUZZEL_RES" QALC_RET=0 @@ -832,7 +840,7 @@ in { name = "emoji-fuzzel"; runtimeInputs = with pkgs; [ config.programs.fuzzel.package wtype wl-clipboard-rs ]; text = '' - FUZZEL_RES=$(fuzzel --dmenu --prompt "emoji> " <"$HOME"/.local/share/emoji-data/list.txt) || exit $? + FUZZEL_RES=$(fuzzel --dmenu --prompt "emoji> " --cache "$HOME"/.cache/fuzzel-emoji --width=60 <"$HOME"/.local/share/emoji-data/list.txt) || exit $? [[ -n "$FUZZEL_RES" ]] || exit 1 wl-copy "$(cut -d ':' -f 1 <<<"$FUZZEL_RES" | tr -d '\n')" && wtype -k XF86Paste ''; @@ -973,6 +981,8 @@ in { "Mod+D".action = with-urgent-window-action "{\"Action\":{\"FocusWindow\":{\"id\": .id}}}"; "Mod+Shift+D".action = with-focused-window-action "{\"Action\":{\"UnsetUrgent\":{\"id\": .id}}}"; + + "Mod+K".action = spawn (lib.getExe' pkgs.worktime "worktime-ui"); })) (map ({ name, selector, spawn, key, ...}: if key != null && selector != null && spawn != null then bind key { action = focus-or-spawn-action selector name spawn; } else null) cfg.scratchspaces) (map ({ name, moveKey, ...}: if moveKey != null then bind moveKey { action = kdl.magic-leaf "move-column-to-workspace" name; } else null) cfg.scratchspaces) -- cgit v1.2.3