From 9c9acc349423e5145ba45ff4d51c12154739ed49 Mon Sep 17 00:00:00 2001 From: danny Date: Wed, 27 Aug 2025 22:38:40 +0800 Subject: [PATCH] daily configuration optimization Fix - airplay: systemd wantedBy target - fcitx5: remove redundant systemd service Remove - move scripts into configuration Style - ghostty: add more transparency to background Add - zellij --- flake.lock | 120 +- flake.nix | 21 +- helper/default.nix | 46 + home/config/nvim/lua/config/options.lua | 2 +- home/config/scripts/gamemodeStatus.sh | 22 - home/config/scripts/getIcons.sh | 24 - home/config/scripts/waybarCava.sh | 33 - home/config/scripts/wgStatus.sh | 20 - home/presets/basic.nix | 1 + home/scripts/record.nix | 87 +- home/user/hypr/bind.nix | 6 +- home/user/hypr/windowrule.nix | 10 +- home/user/internationalisation.nix | 66 +- home/user/packages.nix | 2 + home/user/waybar.nix | 1015 +++++++++-------- home/user/zellij.nix | 6 + home/user/zen-browser.nix | 1 + system/dev/dn-pre7780/default.nix | 248 ++-- system/dev/generic/boot.nix | 4 - system/dev/generic/default.nix | 7 +- system/dev/generic/disk.nix | 2 +- system/dev/generic/hardware-configuration.nix | 22 + system/modules/airplay.nix | 4 +- system/modules/tmux.nix | 28 +- 24 files changed, 941 insertions(+), 856 deletions(-) create mode 100644 helper/default.nix delete mode 100755 home/config/scripts/gamemodeStatus.sh delete mode 100755 home/config/scripts/getIcons.sh delete mode 100755 home/config/scripts/waybarCava.sh delete mode 100755 home/config/scripts/wgStatus.sh create mode 100644 home/user/zellij.nix delete mode 100644 system/dev/generic/boot.nix create mode 100644 system/dev/generic/hardware-configuration.nix diff --git a/flake.lock b/flake.lock index 98a3771..4a1d780 100644 --- a/flake.lock +++ b/flake.lock @@ -644,11 +644,11 @@ "zon2nix": "zon2nix" }, "locked": { - "lastModified": 1755815920, - "narHash": "sha256-LjARhUOGVN4uY4TSswomsyeiNDeeKf/AedP0Hc/IEtc=", + "lastModified": 1756057928, + "narHash": "sha256-JHP75eqmFxMWkdiR97qgwsP17kUS7jownP/NMDfIH1Y=", "owner": "ghostty-org", "repo": "ghostty", - "rev": "298f11166d4762741dd84fb48c8f96a09d0fb326", + "rev": "400576f0b0dcb7743c9a11cc07ba831cc29f057a", "type": "github" }, "original": { @@ -948,7 +948,7 @@ "hyprlang": "hyprlang", "hyprutils": "hyprutils", "hyprwayland-scanner": "hyprwayland-scanner", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "pre-commit-hooks": "pre-commit-hooks", "systems": "systems_5", "xdph": "xdph" @@ -1397,7 +1397,7 @@ "git-hooks": "git-hooks", "hercules-ci-effects": "hercules-ci-effects", "neovim-src": "neovim-src", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_4", "treefmt-nix": "treefmt-nix" }, "locked": { @@ -1477,7 +1477,7 @@ "inputs": { "flake-compat": "flake-compat_7", "flake-utils": "flake-utils_5", - "nixpkgs": "nixpkgs_4" + "nixpkgs": "nixpkgs_5" }, "locked": { "lastModified": 1755137329, @@ -1495,7 +1495,7 @@ }, "nix-tmodloader": { "inputs": { - "nixpkgs": "nixpkgs_5" + "nixpkgs": "nixpkgs_6" }, "locked": { "lastModified": 1734377184, @@ -1559,6 +1559,22 @@ } }, "nixpkgs_10": { + "locked": { + "lastModified": 1752596105, + "narHash": "sha256-lFNVsu/mHLq3q11MuGkMhUUoSXEdQjCHvpReaGP1S2k=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "dab3a6e781554f965bde3def0aa2fda4eb8f1708", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_11": { "locked": { "lastModified": 1727348695, "narHash": "sha256-J+PeFKSDV+pHL7ukkfpVzCOO7mBSrrpJ3svwBFABbhI=", @@ -1575,6 +1591,19 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1755972213, + "narHash": "sha256-VYK7aDAv8H1enXn1ECRHmGbeY6RqLnNwUJkOwloIsko=", + "rev": "73e96df7cff5783f45e21342a75a1540c4eddce4", + "type": "tarball", + "url": "https://releases.nixos.org/nixos/unstable-small/nixos-25.11pre850642.73e96df7cff5/nixexprs.tar.xz" + }, + "original": { + "type": "tarball", + "url": "https://channels.nixos.org/nixos-unstable-small/nixexprs.tar.xz" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1754725699, "narHash": "sha256-iAcj9T/Y+3DBy2J0N+yF9XQQQ8IEb5swLFzs23CdP88=", @@ -1590,7 +1619,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1754990257, "narHash": "sha256-eEq2wlYNF2t89PsNyEv5Sz4lSxdukZCj4SdhZBVAGpI=", @@ -1606,7 +1635,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1748929857, "narHash": "sha256-lcZQ8RhsmhsK8u7LIFsJhsLh/pzR9yZ8yqpTzyGdj+Q=", @@ -1622,22 +1651,6 @@ "type": "github" } }, - "nixpkgs_5": { - "locked": { - "lastModified": 1755027561, - "narHash": "sha256-IVft239Bc8p8Dtvf7UAACMG5P3ZV+3/aO28gXpGtMXI=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "005433b926e16227259a1843015b5b2b7f7d1fc3", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs_6": { "locked": { "lastModified": 1755027561, @@ -1655,6 +1668,22 @@ } }, "nixpkgs_7": { + "locked": { + "lastModified": 1755027561, + "narHash": "sha256-IVft239Bc8p8Dtvf7UAACMG5P3ZV+3/aO28gXpGtMXI=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "005433b926e16227259a1843015b5b2b7f7d1fc3", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_8": { "locked": { "lastModified": 1744868846, "narHash": "sha256-5RJTdUHDmj12Qsv7XOhuospjAjATNiTMElplWnJE9Hs=", @@ -1670,7 +1699,7 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_9": { "locked": { "lastModified": 1753934836, "narHash": "sha256-G06FmIBj0I5bMW1Q8hAEIl5N7IHMK7+Ta4KA+BmneDA=", @@ -1686,22 +1715,6 @@ "type": "github" } }, - "nixpkgs_9": { - "locked": { - "lastModified": 1752596105, - "narHash": "sha256-lFNVsu/mHLq3q11MuGkMhUUoSXEdQjCHvpReaGP1S2k=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "dab3a6e781554f965bde3def0aa2fda4eb8f1708", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nur": { "inputs": { "flake-parts": [ @@ -1819,7 +1832,7 @@ "nix-index-database": "nix-index-database", "nix-minecraft": "nix-minecraft", "nix-tmodloader": "nix-tmodloader", - "nixpkgs": "nixpkgs_6", + "nixpkgs": "nixpkgs_7", "sops-nix": "sops-nix", "stylix": "stylix", "swww": "swww", @@ -1913,7 +1926,7 @@ }, "sops-nix": { "inputs": { - "nixpkgs": "nixpkgs_7" + "nixpkgs": "nixpkgs_8" }, "locked": { "lastModified": 1754988908, @@ -1982,7 +1995,7 @@ "swww": { "inputs": { "flake-compat": "flake-compat_8", - "nixpkgs": "nixpkgs_8", + "nixpkgs": "nixpkgs_9", "rust-overlay": "rust-overlay_3" }, "locked": { @@ -2310,7 +2323,7 @@ "yazi": { "inputs": { "flake-utils": "flake-utils_6", - "nixpkgs": "nixpkgs_9", + "nixpkgs": "nixpkgs_10", "rust-overlay": "rust-overlay_4" }, "locked": { @@ -2329,7 +2342,7 @@ }, "zen-browser": { "inputs": { - "nixpkgs": "nixpkgs_10" + "nixpkgs": "nixpkgs_11" }, "locked": { "lastModified": 1755788000, @@ -2380,23 +2393,20 @@ "ghostty", "flake-utils" ], - "nixpkgs": [ - "ghostty", - "nixpkgs" - ] + "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1742104771, - "narHash": "sha256-LhidlyEA9MP8jGe1rEnyjGFCzLLgCdDpYeWggibayr0=", + "lastModified": 1756000480, + "narHash": "sha256-fR5pdcjO0II5MNdCzqvyokyuFkmff7/FyBAjUS6sMfA=", "owner": "jcollie", "repo": "zon2nix", - "rev": "56c159be489cc6c0e73c3930bd908ddc6fe89613", + "rev": "d9dc9ef1ab9ae45b5c9d80c6a747cc9968ee0c60", "type": "github" }, "original": { "owner": "jcollie", "repo": "zon2nix", - "rev": "56c159be489cc6c0e73c3930bd908ddc6fe89613", + "rev": "d9dc9ef1ab9ae45b5c9d80c6a747cc9968ee0c60", "type": "github" } } diff --git a/flake.nix b/flake.nix index ee05f96..291d7f7 100644 --- a/flake.nix +++ b/flake.nix @@ -22,7 +22,6 @@ }; ghostty = { - # url = "github:ghostty-org/ghostty?rev=7f9bb3c0e54f585e11259bc0c9064813d061929c"; url = "github:ghostty-org/ghostty"; inputs.nixpkgs.follows = "nixpkgs"; }; @@ -134,6 +133,8 @@ inherit (pkgs) lib; + helper = import ./helper { inherit pkgs lib; }; + # Declare COMMON modules here common-settings = { modules = [ @@ -146,6 +147,7 @@ ]; args = { inherit + helper inputs system nix-version @@ -266,6 +268,7 @@ useGlobalPkgs = true; extraSpecialArgs = { inherit + helper inputs system nix-version @@ -411,7 +414,7 @@ lib.mapAttrs' ( name: value: lib.nameValuePair name ( - nixpkgs.lib.nixosSystem ({ + nixpkgs.lib.nixosSystem { inherit system; modules = [ inputs.microvm.nixosModules.microvm @@ -469,10 +472,20 @@ ]; } ]; - }) + } ) ) vmList - ); + ) + // { + vps = nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = common-settings.args; + modules = [ + inputs.disko.nixosModules.disko + ./system/dev/generic + ]; + }; + }; packages."${system}" = { vm-1 = self.nixosConfigurations.vm-1.config.microvm.declaredRunner; diff --git a/helper/default.nix b/helper/default.nix new file mode 100644 index 0000000..cb06edf --- /dev/null +++ b/helper/default.nix @@ -0,0 +1,46 @@ +{ + pkgs, + lib, +}: +let + inherit (pkgs) writeShellScript; + inherit (lib) replaceString; + inherit (builtins) toJSON mapAttrs; +in +{ + mkToggleScript = + { + service, + start, + stop, + icon ? "", + extra ? { }, + }: + let + extraJson = replaceString "\"" "\\\"" (toJSON extra); + in + writeShellScript "${service}-toggle.sh" '' + SERVICE_NAME=${service} + EXTRA_JSON="${extraJson}" + + case $1 in toggle) + if systemctl --user is-active --quiet "$SERVICE_NAME"; then + systemctl --user stop "$SERVICE_NAME" + notify-send "${icon} ''\${SERVICE_NAME^}" "stopping" + else + systemctl --user start "$SERVICE_NAME" + notify-send "${icon} ''\${SERVICE_NAME^}" "starting" + fi + esac + + if systemctl --user is-active --quiet "$SERVICE_NAME"; then + json1=$(jq -nc --arg text "${icon} ''\${SERVICE_NAME^} starting" --arg class "${start}" \ + '{text: $text, tooltip: $text, class: $class, alt: $class}') + else + json1=$(jq -nc --arg text "${icon} ''\${SERVICE_NAME^} stopped" --arg class "${stop}" \ + '{text: $text, tooltip: $text, class: $class, alt: $class}') + fi + + jq -nc --argjson a "$json1" --argjson b "$EXTRA_JSON" '$a + $b' + ''; +} diff --git a/home/config/nvim/lua/config/options.lua b/home/config/nvim/lua/config/options.lua index 847759a..fadf791 100644 --- a/home/config/nvim/lua/config/options.lua +++ b/home/config/nvim/lua/config/options.lua @@ -56,4 +56,4 @@ vim.g.clipboard = { -- (instead of interacting with the "+" and/or "*" registers explicitly): vim.opt.clipboard = "unnamedplus" -vim.g.gruvbox_material_transparent_background = 2 +vim.opt.spelllang = { "en", "cjk" } diff --git a/home/config/scripts/gamemodeStatus.sh b/home/config/scripts/gamemodeStatus.sh deleted file mode 100755 index da164d5..0000000 --- a/home/config/scripts/gamemodeStatus.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -SERVICE="gamemode" - -if [ "$1" = "toggle" ]; then - if systemctl --user is-active --quiet "$SERVICE"; then - systemctl --user stop "$SERVICE" - notify-send "󰊗 Gamemode" "off" >/dev/null 2>&1 - else - systemctl --user start "$SERVICE" - notify-send "󰊗 Gamemode" "on" >/dev/null 2>&1 - fi - exit 0 -fi - -if ! systemctl --user is-active --quiet "$SERVICE"; then - echo "{\"text\": \"inactive\", \"tooltip\": \"gamemoded is inactive\", \"alt\": \"inactive\", \"class\": \"inactive\"}" - exit 0 -fi - -echo "{\"text\": \"active\", \"tooltip\": \"gamemoded is running\", \"alt\": \"active\", \"class\": \"active\"}" -exit 0 diff --git a/home/config/scripts/getIcons.sh b/home/config/scripts/getIcons.sh deleted file mode 100755 index 819146b..0000000 --- a/home/config/scripts/getIcons.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash - -get_icons() { - local session_name="$1" - local result="" - - local panes=($(tmux list-panes -t "$session_name" -F '#{pane_current_command}')) - - for i in "${panes[@]}"; do - case "$i" in - nvim) result+=" " ;; - zsh | *) result+=" " ;; - esac - done - - echo "$result" -} - -if (($# != 1)); then - echo "Usage: $0 " - exit 1 -fi - -get_icons "$1" diff --git a/home/config/scripts/waybarCava.sh b/home/config/scripts/waybarCava.sh deleted file mode 100755 index 3eaa109..0000000 --- a/home/config/scripts/waybarCava.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -#Taken from JaKoolit's dotfiles - -bar="▁▂▃▄▅▆▇█" -dict="s/;//g" - -bar_length=${#bar} - -for ((i = 0; i < bar_length; i++)); do - dict+=";s/$i/${bar:$i:1}/g" -done - -config_file="/tmp/bar_cava_config" -cat >"$config_file" </dev/null 2>&1; then - pkexec systemctl stop wg-quick-wg0.service - else - pkexec systemctl start wg-quick-wg0.service - fi - exit 0 -fi - -if ! ip link show "$INTERFACE" >/dev/null 2>&1; then - echo "{\"text\": \"Not Connected\", \"tooltip\": \"WireGuard is down\", \"alt\": \"disconnected\", \"class\": \"disconnected\"}" - exit 0 -fi - -echo "{\"text\": \"Connected\", \"tooltip\": \"WireGuard connected\", \"alt\": \"connected\", \"class\": \"connected\"}" -exit 0 diff --git a/home/presets/basic.nix b/home/presets/basic.nix index 07f761d..507e7de 100644 --- a/home/presets/basic.nix +++ b/home/presets/basic.nix @@ -16,5 +16,6 @@ ../user/virtualization.nix ../user/vscode.nix ../user/yazi.nix + ../user/zellij.nix ]; } diff --git a/home/scripts/record.nix b/home/scripts/record.nix index 0ed36bc..8c3d2b9 100644 --- a/home/scripts/record.nix +++ b/home/scripts/record.nix @@ -5,51 +5,60 @@ let record = pkgs.writeShellScript "toggle-wf-record" '' PID_FILE="/tmp/wf-recorder.pid" - OUTPUT_DIR="$HOME/Videos/recordings" - FILENAME="$OUTPUT_DIR/recording_$(date +%Y%m%d_%H%M%S).mp4" - SINK_DEV="$(${pkgs.pulseaudio.out}/bin/pactl get-default-sink).monitor" - declare -A recordOptions=( - [Monitor]="${pkgs.slurp}/bin/slurp -o" - [Area]="${pkgs.slurp}/bin/slurp" - ) + if [[ $1 = "toggle" ]]; then + OUTPUT_DIR="$HOME/Videos/recordings" + FILENAME="$OUTPUT_DIR/recording_$(date +%Y%m%d_%H%M%S).mp4" + SINK_DEV="$(${pkgs.pulseaudio.out}/bin/pactl get-default-sink).monitor" - if [[ -f "$PID_FILE" ]]; then - pid=$(cat "$PID_FILE") + declare -A recordOptions=( + [Monitor]="${pkgs.slurp}/bin/slurp -o" + [Area]="${pkgs.slurp}/bin/slurp" + ) - if kill "$pid" 2>/dev/null; then - rm "$PID_FILE" - echo "Stopped recording" - notify-send "󰑋 RECORD" "Recording saved to $FILENAME" + if [[ -f "$PID_FILE" ]]; then + pid=$(cat "$PID_FILE") + + if kill "$pid" 2>/dev/null; then + rm "$PID_FILE" + echo "Stopped recording" + notify-send "󰑋 RECORD" "Recording saved to $FILENAME" + else + echo "No process found, cleaning up" + notify-send "󰑋 RECORD" "Failed: No process found, cleaning up" + rm "$PID_FILE" + fi else - echo "No process found, cleaning up" - notify-send "󰑋 RECORD" "Failed: No process found, cleaning up" - rm "$PID_FILE" + # Start recording + choice=$(printf "%s\n" "''\${!recordOptions[@]}" | rofi -i -dmenu -config ~/.config/rofi/config.rasi -p "Which mode") + + if [[ -z "$choice" ]]; then + notify-send "󰑋 RECORD" "Cancelled" + exit 1 + fi + + mkdir -p "$OUTPUT_DIR" + + geometry="$(''\${recordOptions[$choice]})" + + if [[ -z "$geometry" ]]; then + notify-send "󰑋 RECORD" "Cancelled" + exit 1 + fi + + ${pkgs.wf-recorder}/bin/wf-recorder -y \ + -g "$geometry" \ + --audio="$SINK_DEV" \ + -f "$FILENAME" & + echo $! > "$PID_FILE" + echo "Started recording: $FILENAME" fi + fi + + if [ -f "$PID_FILE" ]; then + jq -nc --arg text "on" --arg class "on" '{text: $text, class: $class, alt: $class}' else - # Start recording - choice=$(printf "%s\n" "''\${!recordOptions[@]}" | rofi -i -dmenu -config ~/.config/rofi/config.rasi -p "Which mode") - - if [[ -z "$choice" ]]; then - notify-send "󰑋 RECORD" "Cancelled" - exit 1 - fi - - mkdir -p "$OUTPUT_DIR" - - geometry="$(''\${recordOptions[$choice]})" - - if [[ -z "$geometry" ]]; then - notify-send "󰑋 RECORD" "Cancelled" - exit 1 - fi - - ${pkgs.wf-recorder}/bin/wf-recorder -y \ - -g "$geometry" \ - --audio="$SINK_DEV" \ - -f "$FILENAME" & - echo $! > "$PID_FILE" - echo "Started recording: $FILENAME" + jq -nc --arg text "off" --arg class "off" '{text: $text, class: $class, alt: $class}' fi ''; in diff --git a/home/user/hypr/bind.nix b/home/user/hypr/bind.nix index 18bebc8..2a8ac18 100644 --- a/home/user/hypr/bind.nix +++ b/home/user/hypr/bind.nix @@ -13,9 +13,9 @@ let notransTag = "notrans"; browser-bin = "zen"; - prefix = if nvidia-offload-enabled then "nvidia-offload" else ""; - browser = "${prefix} ${browser-bin}"; - terminal = "ghostty"; + prefix = if nvidia-offload-enabled then "nvidia-offload " else ""; + browser = "${prefix}${browser-bin}"; + terminal = "${prefix}ghostty"; filemanager = "${terminal} -e yazi"; screenshotFolder = "--output-folder ~/Pictures/Screenshots"; diff --git a/home/user/hypr/windowrule.nix b/home/user/hypr/windowrule.nix index 03b9c00..6ea9e68 100644 --- a/home/user/hypr/windowrule.nix +++ b/home/user/hypr/windowrule.nix @@ -36,8 +36,12 @@ in "fullscreen, initialClass:^(cs2)$" + # Zen browser "opacity 0.9999 override, initialClass:^(zen)(.*)" + # Ghostty + "opacity 0.9999 override, initialClass:^(com.mitchellh.ghostty)$" + # Picture in picture windows "float, title:^(Picture-in-Picture)$" "pin, title:^(Picture-in-Picture)$" @@ -53,10 +57,6 @@ in "move ${right} 8%, class: ^(localsend_app)$" "size 20% 80%, class: ^(localsend_app)$" - # Airplay - "move ${right} 10%, class: ^(GStreamer)$" - "size 21% 80%, class: ^(GStreamer)$" - # Bluetooth "move ${right} ${top}, class: ^(blueberry.py)$" "size 25% 45%, class: ^(blueberry.py)$" @@ -72,6 +72,8 @@ in "animation slide right 20%, class: ^(localsend_app)$" # Airplay + "move ${right} 10%, class: ^(GStreamer)$" + "size 21% 80%, class: ^(GStreamer)$" "pin, class: ^(GStreamer)$" "float, class: ^(GStreamer)$" "opacity 1.0 override 1.0 override, class: ^(GStreamer)$" diff --git a/home/user/internationalisation.nix b/home/user/internationalisation.nix index a4c841a..6cf1332 100644 --- a/home/user/internationalisation.nix +++ b/home/user/internationalisation.nix @@ -12,7 +12,6 @@ let fcitx5-rime # Bopomofo rime-data ]; - in { i18n = { @@ -33,27 +32,54 @@ in MenuFont = lib.mkForce font; TrayFont = lib.mkForce font; }; + + inputMethod = { + GroupOrder."0" = "Default"; + "Groups/0" = { + Name = "Default"; + "Default Layout" = "us"; + DefaultIM = "rime"; + }; + "Groups/0/Items/0".Name = "keyboard-us"; + "Groups/0/Items/1".Name = "rime"; + "Groups/0/Items/2".Name = "mozc"; + }; + + globalOptions = { + Hotkey = { + EnumerateWithRiggerKeys = true; + EnumerateSkipFirst = false; + ModifierOnlyKeyTimeout = 250; + }; + "Hotkey/TriggerKeys" = { + "0" = "Super+space"; + }; + "Hotkey/AltTriggerKeys" = { + "0" = "Shift_L"; + }; + "Hotkey/EnumerateGroupForwardKeys" = { + "0" = "Super+space"; + }; + "Hotkey/PrevPage" = { + "0" = "Up"; + }; + "Hotkey/NextPage" = { + "0" = "Down"; + }; + Behavior = { + ActiveByDefault = false; + resetStateWhenFocusIn = "no"; + ShareInputState = "no"; + PreeditEnabledByDefault = true; + ShowInputMethodInformation = true; + ShowInputMethodInformationWhenFocusIn = false; + CompactInputMethodInformation = true; + DefaultPageSize = 5; + PreloadInputMethod = true; + }; + }; }; }; }; }; - - systemd.user.services.fcitx5 = { - Unit = { - WantedBy = [ "graphical-session.target" ]; - PartOf = [ "graphical-session.target" ]; - Description = "Fcitx5 Input Method"; - }; - Service = { - Type = "simple"; - Restart = "always"; - RestartSec = 2; - ExecStart = "${pkgs.fcitx5}/bin/fcitx5"; - Environment = [ - "GTK_IM_MODULE=" - "XMODIFIERS=@im=fcitx" - "QT_IM_MODULE=fcitx" - ]; - }; - }; } diff --git a/home/user/packages.nix b/home/user/packages.nix index d5a91f6..0d33aaa 100644 --- a/home/user/packages.nix +++ b/home/user/packages.nix @@ -31,6 +31,8 @@ settings = { unfocused-split-opacity = 0.85; desktop-notifications = false; + background-opacity = 0.1; + background-blur = false; wait-after-command = false; shell-integration = "detect"; diff --git a/home/user/waybar.nix b/home/user/waybar.nix index 67a02c3..880849e 100644 --- a/home/user/waybar.nix +++ b/home/user/waybar.nix @@ -7,11 +7,52 @@ username, lib, pkgs, + helper, ... }: let + inherit (helper) mkToggleScript; inherit (lib) optionalString; + gamemodeToggle = mkToggleScript { + service = "gamemoded"; + start = "on"; + stop = "off"; + icon = ""; + extra = { + text = "$(pgrep -c gamemode)"; + tooltip = "Running: $(pgrep -c gamemode)"; + }; + }; + + airplayToggle = mkToggleScript { + service = "uxplay"; + start = "on"; + stop = "off"; + icon = "󱖑"; + }; + + wgToggle = pkgs.writeShellScript "wg-toggle" '' + INTERFACE="wg0" + + if [ "$1" = "toggle" ]; then + if ip link show "$INTERFACE" >/dev/null 2>&1; then + pkexec systemctl stop wg-quick-wg0.service + else + pkexec systemctl start wg-quick-wg0.service + fi + exit 0 + fi + + if ! ip link show "$INTERFACE" >/dev/null 2>&1; then + echo "{\"text\": \"Not Connected\", \"tooltip\": \"WireGuard is down\", \"alt\": \"disconnected\", \"class\": \"disconnected\"}" + exit 0 + fi + + echo "{\"text\": \"Connected\", \"tooltip\": \"WireGuard connected\", \"alt\": \"connected\", \"class\": \"connected\"}" + exit 0 + ''; + mkWall = import ../scripts/mkWall.nix { inherit config pkgs; }; rofiWall = import ../scripts/rofiwall.nix { inherit config pkgs; }; @@ -46,13 +87,6 @@ in "d /tmp/wall_cache 700 ${username} -" ]; - # === gamemode === # - systemd.user.services.gamemode = lib.mkIf osConfig.programs.gamemode.enable { - Service = { - ExecStart = "${pkgs.gamemode}/bin/gamemoded -r"; - }; - }; - # === waybar === # systemd.user.services.waybar = lib.mkIf config.programs.waybar.enable { Unit = { @@ -61,524 +95,535 @@ in }; }; - programs.waybar = { - enable = true; - style = - let - borderRadius = "6px"; - border = "1px solid @fg-bg"; - gap = "4px"; - in - lib.mkForce - # css - '' - @define-color main #ebdbb2; - @define-color bg-bg rgba(0, 0, 0, 0); - @define-color fg-bg alpha(#fff, 0.05); + programs.waybar = + let + color = "#ebdbb2"; + in + { + enable = true; + style = + let + borderRadius = "6px"; + border = "1px solid @fg-bg"; + gap = "4px"; + in + lib.mkForce + # css + '' + @define-color main ${color}; + @define-color bg-bg rgba(0, 0, 0, 0); + @define-color fg-bg alpha(#fff, 0.05); - * { - font-family: ${osConfig.stylix.fonts.sansSerif.name}; - min-height: 0; - font-size: ${toString (osConfig.stylix.fonts.sizes.desktop + 4)}px; - font-feature-settings: '"zero", "ss01", "ss02", "ss03", "ss04", "ss05", "cv31"'; - transition-property: all; - transition-duration: 0.3s; - } + * { + font-family: ${osConfig.stylix.fonts.sansSerif.name}; + min-height: 0; + font-size: ${toString (osConfig.stylix.fonts.sizes.desktop + 4)}px; + font-feature-settings: '"zero", "ss01", "ss02", "ss03", "ss04", "ss05", "cv31"'; + transition-property: all; + transition-duration: 0.3s; + } - #clock, - #mpris, - #window, - #memory, - #cpu, - #pulseaudio { - font-size: ${toString (osConfig.stylix.fonts.sizes.desktop + 2)}px; - } + #clock, + #mpris, + #window, + #memory, + #cpu, + #pulseaudio { + font-size: ${toString (osConfig.stylix.fonts.sizes.desktop + 2)}px; + } - /* Main bar */ - window#waybar { - background-color: @bg-bg; - } + /* Main bar */ + window#waybar { + background-color: @bg-bg; + } - window#waybar > .horizontal { - padding: ${gap}; - } + window#waybar > .horizontal { + padding: ${gap}; + } - window#waybar.hidden { - opacity: 0.5; - } + window#waybar.hidden { + opacity: 0.5; + } - /* Set transparent if empty */ - window#waybar .empty { - background-color: transparent; - border-color: transparent; - } + /* Set transparent if empty */ + window#waybar .empty { + background-color: transparent; + border-color: transparent; + } - /* tooltip */ - tooltip { - background-color: @fg-bg; - border: ${border}; - border-radius: ${borderRadius}; - } + /* tooltip */ + tooltip { + background-color: @fg-bg; + border: ${border}; + border-radius: ${borderRadius}; + } - tooltip label { - padding: 4px 10px; - color: @main; - } + tooltip label { + padding: 4px 10px; + color: @main; + } - box.module, label.module, #gamemode { - background: @fg-bg; - color: @main; - border-radius: ${borderRadius}; - border: ${border}; - padding: 0px 12px; - } + box.module, label.module { + background: @fg-bg; + color: @main; + border-radius: ${borderRadius}; + border: ${border}; + padding: 0px 12px; + } - /* Gamemode center icon */ - #gamemode { - padding-right: 6px; - } + box.module button:hover { + background: shade(@fg-bg, 1.5); + } - box.module button:hover { - background: shade(@fg-bg, 1.5); - } + label:hover { + background: shade(@fg-bg, 1.5); + } - label:hover { - background: shade(@fg-bg, 1.5); - } + .modules-left .module { + margin-right: ${gap}; + } - .modules-left .module { - margin-right: ${gap}; - } + .modules-right .module { + margin-left: ${gap}; + } - .modules-right .module { - margin-left: ${gap}; - } + .modules-center .module { + background: transparent; + border-color: transparent; + } - .modules-center .module { - background: transparent; - border-color: transparent; - } + /* Workspaces */ + #workspaces { + padding-left: 2px; + padding-right: 2px; + } - /* Workspaces */ - #workspaces { - padding-left: 2px; - padding-right: 2px; - } + #workspaces button { + border-radius: 16px; + padding: 0px 6px; + } - #workspaces button { - border-radius: 16px; - padding: 0px 6px; - } + /* Taskbar */ + #taskbar { + background: transparent; + border-color: transparent; + } - /* Taskbar */ - #taskbar { - background: transparent; - border-color: transparent; - } + /* Group */ + #cpu { + border-top-right-radius: 0; + border-bottom-right-radius: 0; + padding-right: 0; + border-right: none; + } + #memory { + border-top-left-radius: 0; + border-bottom-left-radius: 0; + margin-left: 0; + border-left: none; + } - /* Group */ - #cpu { - border-top-right-radius: 0; - border-bottom-right-radius: 0; - padding-right: 0; - border-right: none; - } - #memory { - border-top-left-radius: 0; - border-bottom-left-radius: 0; - margin-left: 0; - border-left: none; - } + #temperature.critical { + background-color: red; + } - #temperature.critical { - background-color: red; - } + #battery.good { + color: #ebdbb2; + } - #battery.good { - color: #ebdbb2; - } + #battery.warning { + color: #eed49f; + } - #battery.warning { - color: #eed49f; - } + #battery.critical { + color: #ee99a0; + } - #battery.critical { - color: #ee99a0; - } + #battery.charging, + #battery.plugged { + color: #a6da95; + } + ''; - #battery.charging, - #battery.plugged { - color: #a6da95; - } - ''; + settings = + let + commonConfig = { + layer = "top"; + exclusive = true; + passthrough = false; + position = "top"; + fixed-center = true; + ipc = true; + margin-top = 0; + margin-left = 0; + margin-right = 0; + margin-bottom = 0; - settings = - let - commonConfig = { - layer = "top"; - exclusive = true; - passthrough = false; - position = "top"; - fixed-center = true; - ipc = true; - margin-top = 0; - margin-left = 0; - margin-right = 0; - margin-bottom = 0; + modules-center = [ + "hyprland/window" + ]; + }; - modules-center = [ - "hyprland/window" - ]; - }; - - modulesConfig = - let - terminalRun = "${config.programs.ghostty.package}/bin/ghostty -e"; - in - { - "hyprland/workspaces" = { - active-only = false; - all-outputs = true; - format = "{icon}"; - show-special = false; - on-click = "activate"; - on-scroll-up = "hyprctl dispatch workspace e+1"; - on-scroll-down = "hyprctl dispatch workspace e-1"; - persistent-workspaces = { - "1" = [ ]; - "2" = [ ]; - "3" = [ ]; - "4" = [ ]; - }; - format-icons = { - active = ""; - default = ""; - }; - }; - clock = { - format = "󰥔 {:%H:%M 󰃭 %d/%m}"; - tooltip-format = "{:%A %d %B %Y}"; - }; - actions = { - on-click-right = "mode"; - on-click-forward = "tz_up"; - on-click-backward = "tz_down"; - on-scroll-up = "shift_up"; - on-scroll-down = "shift_down"; - }; - "custom/os" = { - format = "󱄅"; - on-click = "wlogout --protocol layer-shell"; - }; - cpu = { - format = " {usage}%"; - max-length = 20; - interval = 5; - on-click-right = "${terminalRun} btop"; - }; - "hyprland/window" = { - format = "{}"; - max-length = 40; - separate-outputs = true; - offscreen-css = true; - offscreen-css-text = "(inactive)"; - rewrite = { - "nvim . (.*)" = " $1"; - "(.*) - Visual Studio Code" = " $1"; - "\\(\\d+\\) Discord (.*)" = " $1"; - - # Firefox - "(.*) - YouTube — Mozilla Firefox" = " $1"; - "(.*)\\.pdf — Mozilla Firefox" = " $1"; - "(.*) — Mozilla Firefox" = " $1"; - "(.*) - YouTube Music — Mozilla Firefox" = "󰎆 $1"; - - # Firefox Nightly - "(.*) - YouTube — Firefox Nightly" = " $1"; - "(.*)\\.pdf — Firefox Nightly" = " $1"; - "(.*) — Firefox Nightly" = " $1"; - "(.*) - YouTube Music — Firefox Nightly" = "󰎆 $1"; - - # Zen - "(.*) - YouTube — Zen Browser" = " $1"; - "(.*) - YouTube Music — Zen Browser" = "󰎆 $1"; - "(.*) — Zen Browser" = " $1"; - - "(.*) - VLC media player" = " $1"; - }; - }; - memory = { - interval = 30; - format = " {used:0.1f}GB/{total:0.1f}G"; - format-alt-click = "click"; - tooltip = true; - tooltip-format = "{used:0.1f}GB/{total:0.1f}G"; - on-click-right = "${terminalRun} btop"; - }; - mpris = { - interval = 10; - format = " {status_icon} {title} | {artist} "; - format-paused = " {status_icon} {title} | {artist} "; - on-click = "playerctl play-pause"; - on-click-right = "playerctl next"; - scroll-step = 5.0; - smooth-scrolling-threshold = 1; - status-icons = { - paused = "󰐎"; - playing = "󰎇"; - stopped = ""; - }; - max-length = 30; - }; - pulseaudio = { - format = "{icon} {volume}%"; - format-bluetooth = "󰂰 {volume}%"; - format-muted = " Muted"; - format-icons = { - default = [ - "" - "" - " " - " " - ]; - ignored-sinks = [ - "Easy Effects Sink" - ]; - }; - scroll-step = 5.0; - on-click = "pavucontrol -t 3"; - tooltip-format = "{icon} {desc} | {volume}%"; - smooth-scrolling-threshold = 1; - }; - temperature = { - interval = 10; - tooltip = true; - hwmon-path = [ - "/sys/class/hwmon/hwmon1/temp1_input" - "/sys/class/thermal/thermal_zone0/temp" - ]; - critical-threshold = 82; - format-critical = " {temperatureC}°C"; - format = "{icon} {temperatureC}°C"; - format-icons = [ - "" - "" - "" - "" - ]; - on-click-right = "kitty -c ~/.config/kitty/kitty.conf --title btop sh -c 'btop'"; - }; - "custom/swaync" = { - tooltip = true; - format = "{icon}"; - format-icons = { - notification = "󱅫"; - none = "󰂚"; - dnd-notification = "󱏧"; - dnd-none = "󱏧"; - inhibited-notification = "󰂚"; - inhibited-none = "󰂚"; - dnd-inhibited-notification = ""; - dnd-inhibited-none = "󱏧"; - }; - return-type = "json"; - exec-if = "which swaync-client"; - exec = "swaync-client -swb"; - on-click = "sleep 0.1 && swaync-client -t -sw"; - on-click-right = "swaync-client -d -sw"; - escape = true; - }; - "wlr/taskbar" = { - format = " {icon} "; - icon-size = 20; - all-outputs = false; - tooltip-format = "{title}"; - on-click = "activate"; - on-click-middle = "close"; - ignore-list = [ - "rofi" - "firefox" - "firefox-nightly" - "zen" - "kitty" - "jetbrains-studio" - "Brave-browser" - "Spotify" - "nemo" - "vlc" - "com.mitchellh.ghostty" - "code" - ".virt-manager-wrapped" - "virt-manager" - "steam_app_*" - "obsidian" - ]; - }; - "custom/cava" = { - exec = "~/.config/scripts/waybarCava.sh"; - format = "{}"; - on-click = "${terminalRun} cava"; - }; - battery = - let - fullAt = if osConfig.services.tlp.enable then 80 else 96; - in - { - full-at = fullAt; - states = { - good = fullAt; - warning = 30; - critical = 15; + modulesConfig = + let + terminalRun = "${config.programs.ghostty.package}/bin/ghostty -e"; + in + { + "hyprland/workspaces" = { + active-only = false; + all-outputs = true; + format = "{icon}"; + show-special = false; + on-click = "activate"; + on-scroll-up = "hyprctl dispatch workspace e+1"; + on-scroll-down = "hyprctl dispatch workspace e-1"; + persistent-workspaces = { + "1" = [ ]; + "2" = [ ]; + "3" = [ ]; + "4" = [ ]; }; - format = "{icon} {capacity}%"; - format-icons = [ - "󰂎" - "󰁺" - "󰁻" - "󰁼" - "󰁽" - "󰁾" - "󰁿" - "󰂀" - "󰂁" - "󰂂" - "󰁹" + format-icons = { + active = ""; + default = ""; + }; + }; + clock = { + format = "󰥔 {:%H:%M 󰃭 %d/%m}"; + tooltip-format = "{:%A %d %B %Y}"; + }; + actions = { + on-click-right = "mode"; + on-click-forward = "tz_up"; + on-click-backward = "tz_down"; + on-scroll-up = "shift_up"; + on-scroll-down = "shift_down"; + }; + "custom/os" = { + format = "󱄅"; + on-click = "wlogout --protocol layer-shell"; + }; + cpu = { + format = " {usage}%"; + max-length = 20; + interval = 5; + on-click-right = "${terminalRun} btop"; + }; + "hyprland/window" = { + format = "{}"; + max-length = 40; + separate-outputs = true; + offscreen-css = true; + offscreen-css-text = "(inactive)"; + rewrite = { + "nvim . (.*)" = " $1"; + "(.*) - Visual Studio Code" = " $1"; + "\\(\\d+\\) Discord (.*)" = " $1"; + + # Firefox + "(.*) - YouTube — Mozilla Firefox" = " $1"; + "(.*)\\.pdf — Mozilla Firefox" = " $1"; + "(.*) — Mozilla Firefox" = " $1"; + "(.*) - YouTube Music — Mozilla Firefox" = "󰎆 $1"; + + # Firefox Nightly + "(.*) - YouTube — Firefox Nightly" = " $1"; + "(.*)\\.pdf — Firefox Nightly" = " $1"; + "(.*) — Firefox Nightly" = " $1"; + "(.*) - YouTube Music — Firefox Nightly" = "󰎆 $1"; + + # Zen + "(.*) - YouTube — Zen Browser" = " $1"; + "(.*) - YouTube Music — Zen Browser" = "󰎆 $1"; + "(.*) — Zen Browser" = " $1"; + + "(.*) - VLC media player" = " $1"; + }; + }; + memory = { + interval = 30; + format = " {used:0.1f}GB/{total:0.1f}G"; + format-alt-click = "click"; + tooltip = true; + tooltip-format = "{used:0.1f}GB/{total:0.1f}G"; + on-click-right = "${terminalRun} btop"; + }; + mpris = { + interval = 10; + format = " {status_icon} {title} | {artist} "; + format-paused = " {status_icon} {title} | {artist} "; + on-click = "playerctl play-pause"; + on-click-right = "playerctl next"; + scroll-step = 5.0; + smooth-scrolling-threshold = 1; + status-icons = { + paused = "󰐎"; + playing = "󰎇"; + stopped = ""; + }; + max-length = 30; + }; + pulseaudio = { + format = "{icon} {volume}%"; + format-bluetooth = "󰂰 {volume}%"; + format-muted = " Muted"; + format-icons = { + default = [ + "" + "" + " " + " " + ]; + ignored-sinks = [ + "Easy Effects Sink" + ]; + }; + scroll-step = 5.0; + on-click = "pavucontrol -t 3"; + tooltip-format = "{icon} {desc} | {volume}%"; + smooth-scrolling-threshold = 1; + }; + temperature = { + interval = 10; + tooltip = true; + hwmon-path = [ + "/sys/class/hwmon/hwmon1/temp1_input" + "/sys/class/thermal/thermal_zone0/temp" ]; - format-charging = "󰂄 {capacity}%"; - format-plugged = "󰂄 {capacity}%"; - format-alt = "{icon} {time}"; + critical-threshold = 82; + format-critical = " {temperatureC}°C"; + format = "{icon} {temperatureC}°C"; + format-icons = [ + "" + "" + "" + "" + ]; + on-click-right = "kitty -c ~/.config/kitty/kitty.conf --title btop sh -c 'btop'"; }; - network = { - format = "{ifname}"; - format-wifi = "󰤨"; - format-ethernet = "󰈀"; - format-disconnected = "󰤭"; - tooltip-format = "{ifname} via {gwaddr}"; - tooltip-format-wifi = "󰤢 {essid}: {signalStrength}%"; - tooltip-format-ethernet = "{ifname} via {gwaddr}"; - tooltip-format-disconnected = "Disconnected"; - max-length = 50; - interval = 5; - on-click = "~/.config/scripts/rofiWifi.sh"; - }; - idle_inhibitor = { - format = "{icon}"; - format-icons = { - activated = "󰅶"; - deactivated = "󰾫"; - }; - }; - "custom/wireguard" = { - format = "{icon}"; - format-icons = { - connected = "󰒘"; - disconnected = ""; - }; - exec = "~/.config/scripts/wgStatus.sh"; - exec-if = "which wg-quick"; - on-click = "~/.config/scripts/wgStatus.sh toggle"; - tooltip = true; - interval = 3; - return-type = "json"; - escape = true; - }; - gamemode = { - format = "{glyph}"; - glyph = ""; - hide-not-running = false; - use-icon = true; - icon-name = "input-gaming-symbolic"; - icon-spacing = 4; - icon-size = 20; - tooltip = true; - tooltip-format = "Games running: {count}"; - on-click-right = "systemctl is-active --quiet gamemode.service && systemctl stop gamemode.service || systemctl start gamemode.service"; - }; - "custom/wallRand" = { - format = ""; - on-click = "${rofiWall}"; - on-click-right = "${wallRand}"; - }; - "custom/airplay" = - let - toggleScript = pkgs.writeShellScript "airplayStatus" '' - SERVICE="uxplay" - ICON="󱖑" - - if [ "$1" = "toggle" ]; then - if systemctl --user is-active --quiet "$SERVICE"; then - systemctl --user stop "$SERVICE" - notify-send "$ICON Airplay" "off" >/dev/null 2>&1 - else - systemctl --user start "$SERVICE" - notify-send "$ICON Airplay" "on" >/dev/null 2>&1 - fi - exit 0 - fi - - if ! systemctl --user is-active --quiet "$SERVICE"; then - echo "{\"text\": \"inactive\", \"tooltip\": \"airplay is inactive\", \"alt\": \"inactive\", \"class\": \"inactive\"}" - exit 0 - fi - - echo "{\"text\": \"active\", \"tooltip\": \"airplay is running\", \"alt\": \"active\", \"class\": \"active\"}" - exit 0 - ''; - in - { + "custom/swaync" = { + tooltip = true; format = "{icon}"; format-icons = { - active = "󱖑"; - inactive = ""; + notification = "󱅫"; + none = "󰂚"; + dnd-notification = "󱏧"; + dnd-none = "󱏧"; + inhibited-notification = "󰂚"; + inhibited-none = "󰂚"; + dnd-inhibited-notification = ""; + dnd-inhibited-none = "󱏧"; }; - exec = toggleScript; + return-type = "json"; + exec-if = "which swaync-client"; + exec = "swaync-client -swb"; + on-click = "sleep 0.1 && swaync-client -t -sw"; + on-click-right = "swaync-client -d -sw"; + escape = true; + }; + "wlr/taskbar" = { + format = " {icon} "; + icon-size = 20; + all-outputs = false; + tooltip-format = "{title}"; + on-click = "activate"; + on-click-middle = "close"; + ignore-list = [ + "rofi" + "firefox" + "firefox-nightly" + "zen" + "kitty" + "jetbrains-studio" + "Brave-browser" + "Spotify" + "nemo" + "vlc" + "com.mitchellh.ghostty" + "code" + ".virt-manager-wrapped" + "virt-manager" + "steam_app_*" + "obsidian" + ]; + }; + "custom/cava" = { + exec = "${pkgs.writeShellScript "cava-wave" '' + #Taken from JaKoolit's dotfiles + + bar="▁▂▃▄▅▆▇█" + dict="s/;//g" + + bar_length=''\${#bar} + + for ((i = 0; i < bar_length; i++)); do + dict+=";s/$i/''\${bar:$i:1}/g" + done + + config_file="/tmp/bar_cava_config" + cat >"$config_file" <.useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.ens4.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/system/modules/airplay.nix b/system/modules/airplay.nix index fab2220..0113d3e 100644 --- a/system/modules/airplay.nix +++ b/system/modules/airplay.nix @@ -25,9 +25,9 @@ in ]; systemd.user.services.uxplay = { - wantedBy = [ "multi-user.target" ]; + wantedBy = [ "default.target" ]; serviceConfig = { - Type = "oneshot"; + Type = "simple"; ExecStart = "${pkgs.uxplay}/bin/uxplay ${ optionalString (hostname != null) "-n ${hostname} -fs -fps 60 -nh" } -p"; diff --git a/system/modules/tmux.nix b/system/modules/tmux.nix index 1d94abd..743b08a 100644 --- a/system/modules/tmux.nix +++ b/system/modules/tmux.nix @@ -1,9 +1,31 @@ { pkgs, config, ... }: let - getIconScript = pkgs.writeShellScript "get-icon" ( - builtins.readFile ../../home/config/scripts/getIcons.sh - ); + getIconScript = pkgs.writeShellScript "get-icon" '' + get_icons() { + local session_name="$1" + local result="" + + local panes=($(tmux list-panes -t "$session_name" -F '#{pane_current_command}')) + + for i in "''\${panes[@]}"; do + case "$i" in + nvim) result+=" " ;; + zsh | *) result+=" " ;; + esac + done + + echo "$result" + } + + if (($# != 1)); then + echo "Usage: $0 " + exit 1 + fi + + get_icons "$1" + ''; + prefixKey = "C-Space"; tmuxConfigPath = "/etc/tmux.conf"; in