From 7ab53d2654922bf3d6994e276e14c57672b2f4e6 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Thu, 20 Jun 2024 23:17:47 +0200 Subject: [PATCH 1/5] Add pulsemixer --- system/shared/multimedia/sound/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/system/shared/multimedia/sound/default.nix b/system/shared/multimedia/sound/default.nix index 9e25e37..af213e9 100644 --- a/system/shared/multimedia/sound/default.nix +++ b/system/shared/multimedia/sound/default.nix @@ -1,5 +1,6 @@ { config, + pkgs, lib, ... }: let @@ -12,6 +13,13 @@ in { enable = mkDefault false; # this just enables ALSA, which we don't really care abouyt mediaKeys.enable = true; }; + + environment.systemPackages = with pkgs; [ + # TUI tool to manage sound devices & levels + # It's made for pulseaudio, but it will work with pipewire too since we + # run a compatibility layer for pulse + pulsemixer + ]; }; } From b51d136c0c722f5a0c6cff09dacd94dcc0a8c9d0 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Thu, 20 Jun 2024 23:30:56 +0200 Subject: [PATCH 2/5] Move to focusworkspaceoncurrentmonitor (from custom script) For a long time now, I've been using a custom shell script to handle focusing to a workspace, which handled (xmonad-like) monitor swapping. However recently, the option `focusworkspaceoncurrentmonitor` has been added to Hyprland, which does the exact same. That means the script is no longer necessary and we can move to the new built-in option. --- .../bars/eww/config/scripts/workspaces | 3 +-- .../wms/hyprland/config/keybinds.nix | 18 +++++++-------- .../graphical/wms/hyprland/default.nix | 1 - .../wms/hyprland/packages/default.nix | 1 - .../hyprland-swap-workspace/default.nix | 4 ---- .../hyprland-swap-workspace.sh | 22 ------------------- 6 files changed, 10 insertions(+), 39 deletions(-) delete mode 100644 home/programs/graphical/wms/hyprland/packages/hyprland-swap-workspace/default.nix delete mode 100644 home/programs/graphical/wms/hyprland/packages/hyprland-swap-workspace/hyprland-swap-workspace.sh diff --git a/home/programs/graphical/bars/eww/config/scripts/workspaces b/home/programs/graphical/bars/eww/config/scripts/workspaces index 903182e..f8e45ed 100755 --- a/home/programs/graphical/bars/eww/config/scripts/workspaces +++ b/home/programs/graphical/bars/eww/config/scripts/workspaces @@ -4,8 +4,7 @@ source "./scripts/include" if [ "$1" = "--switch" ]; then - $HOME/.local/bin/scripts/gui/hyprland/swap-workspace "$2" >/dev/null - # hyprctl dispatch workspace "$2" >/dev/null + hyprctl dispatch focusworkspaceoncurrentmonitor "$2" >/dev/null elif [ "$1" = "--loop" ]; then hyprland_ipc "workspace|createworkspace|destroyworkspace" | ./scripts/workspaces.py "$@" else diff --git a/home/programs/graphical/wms/hyprland/config/keybinds.nix b/home/programs/graphical/wms/hyprland/config/keybinds.nix index 2149596..91bfa5a 100644 --- a/home/programs/graphical/wms/hyprland/config/keybinds.nix +++ b/home/programs/graphical/wms/hyprland/config/keybinds.nix @@ -107,15 +107,15 @@ # # Switch workspace (swapping to current monitor) # - "SUPER, 1, exec, hyprland-swap-workspace 1" - "SUPER, 2, exec, hyprland-swap-workspace 2" - "SUPER, 3, exec, hyprland-swap-workspace 3" - "SUPER, 4, exec, hyprland-swap-workspace 4" - "SUPER, 5, exec, hyprland-swap-workspace 5" - "SUPER, 6, exec, hyprland-swap-workspace 6" - "SUPER, 7, exec, hyprland-swap-workspace 7" - "SUPER, 8, exec, hyprland-swap-workspace 8" - "SUPER, 9, exec, hyprland-swap-workspace 9" + "SUPER, 1, focusworkspaceoncurrentmonitor, 1" + "SUPER, 2, focusworkspaceoncurrentmonitor, 2" + "SUPER, 3, focusworkspaceoncurrentmonitor, 3" + "SUPER, 4, focusworkspaceoncurrentmonitor, 4" + "SUPER, 5, focusworkspaceoncurrentmonitor, 5" + "SUPER, 6, focusworkspaceoncurrentmonitor, 6" + "SUPER, 7, focusworkspaceoncurrentmonitor, 7" + "SUPER, 8, focusworkspaceoncurrentmonitor, 8" + "SUPER, 9, focusworkspaceoncurrentmonitor, 9" # # Move window to workspace diff --git a/home/programs/graphical/wms/hyprland/default.nix b/home/programs/graphical/wms/hyprland/default.nix index 166748f..7b1ce94 100644 --- a/home/programs/graphical/wms/hyprland/default.nix +++ b/home/programs/graphical/wms/hyprland/default.nix @@ -16,7 +16,6 @@ in { config = mkIf cfg.enable { home.packages = [ - hyprPkgs.hyprland-swap-workspace hyprPkgs.hyprland-move-window pkgs.brightnessctl hyprPkgs.brightness diff --git a/home/programs/graphical/wms/hyprland/packages/default.nix b/home/programs/graphical/wms/hyprland/packages/default.nix index bbead15..f5c76ee 100644 --- a/home/programs/graphical/wms/hyprland/packages/default.nix +++ b/home/programs/graphical/wms/hyprland/packages/default.nix @@ -3,7 +3,6 @@ ... }: let packages = { - hyprland-swap-workspace = pkgs.callPackage ./hyprland-swap-workspace {}; hyprland-move-window = pkgs.callPackage ./hyprland-move-window {}; brightness = pkgs.callPackage ./brightness {}; }; diff --git a/home/programs/graphical/wms/hyprland/packages/hyprland-swap-workspace/default.nix b/home/programs/graphical/wms/hyprland/packages/hyprland-swap-workspace/default.nix deleted file mode 100644 index 25433db..0000000 --- a/home/programs/graphical/wms/hyprland/packages/hyprland-swap-workspace/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -{pkgs, ...}: - pkgs.writeShellScriptBin "hyprland-swap-workspace" '' - ${builtins.readFile ./hyprland-swap-workspace.sh} - '' diff --git a/home/programs/graphical/wms/hyprland/packages/hyprland-swap-workspace/hyprland-swap-workspace.sh b/home/programs/graphical/wms/hyprland/packages/hyprland-swap-workspace/hyprland-swap-workspace.sh deleted file mode 100644 index 64030b4..0000000 --- a/home/programs/graphical/wms/hyprland/packages/hyprland-swap-workspace/hyprland-swap-workspace.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -WORKSPACE="$1" - -monitors_out="$(hyprctl monitors -j)" -focused_mon="$(echo "$monitors_out" | jq '.[] | select(.focused==true) | .id')" -focused_wks="$(echo "$monitors_out" | jq '.[].activeWorkspace.id')" - -# Workspace is already focused, check on which monitor -if echo "$focused_wks" | grep "$WORKSPACE" >/dev/null; then - mon_id="$(echo "$monitors_out" | jq ".[] | select(.activeWorkspace.id==$WORKSPACE) | .id")" - - # If the workspace is focused on the active monitor, don't do anything (we're here). - # Otherwise, swap the workspaces. - if [ "$mon_id" -ne "$focused_mon" ]; then - hyprctl dispatch swapactiveworkspaces "$focused_mon" "$mon_id" - fi -# Switching to an unfocused workspace, always move it to focused monitor -else - hyprctl dispatch moveworkspacetomonitor "$WORKSPACE" "$focused_mon" - hyprctl dispatch workspace "$WORKSPACE" -fi From 0cd01b09e6ea61381f7fdc27e9a98f37ed216d4b Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Thu, 20 Jun 2024 23:53:26 +0200 Subject: [PATCH 3/5] Set BROWSER and DEFAULT_BROWSER vars --- home/programs/xdg/mime-apps.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/home/programs/xdg/mime-apps.nix b/home/programs/xdg/mime-apps.nix index 984e59e..6b65520 100644 --- a/home/programs/xdg/mime-apps.nix +++ b/home/programs/xdg/mime-apps.nix @@ -39,4 +39,9 @@ "x-scheme-handler/msteams" = ["teams.desktop"]; # I need it for school, don't judge me }; }; + + home.sessionVariables = { + BROWSER = "firefox"; + DEFAULT_BROWSER = "firefox"; + }; } From c96e2de5ecd16d5130949d5f5e08c6624fbf8e9f Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Fri, 21 Jun 2024 00:28:22 +0200 Subject: [PATCH 4/5] Persist stremio data --- hosts/voyager/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/voyager/default.nix b/hosts/voyager/default.nix index b67c3c4..df2ff99 100644 --- a/hosts/voyager/default.nix +++ b/hosts/voyager/default.nix @@ -70,6 +70,7 @@ ".local/share/nvim" ".local/state/nvim" ".local/share/zsh" + ".local/share/Smart Code ltd/Stremio" ".local/share/cargo" ".local/share/go" ]; From 7a79342f93e15d8fead502af6dbde8406e09acfc Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Fri, 21 Jun 2024 00:31:37 +0200 Subject: [PATCH 5/5] Cache walker history --- hosts/voyager/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/voyager/default.nix b/hosts/voyager/default.nix index df2ff99..ece3ddb 100644 --- a/hosts/voyager/default.nix +++ b/hosts/voyager/default.nix @@ -76,6 +76,7 @@ ]; extraFiles = [ ".config/git/git-credentials" + ".cache/walker/history.gob" ]; };