From 1c127b29e7417ee0435f3926d1b7d9811726d7ab Mon Sep 17 00:00:00 2001 From: Johannes Kresner Date: Sun, 16 Aug 2026 15:45:30 +0200 Subject: [PATCH] feat: updates --- config/quickshell/Bar/Bar.qml | 1 - .../quickshell/Widgets/AppLauncherWindow.qml | 12 ++- .../Widgets/HyprlandWorkspaceWidget.qml | 8 +- .../Widgets/NiriWorkspaceWidget.qml | 79 ------------------- config/quickshell/Widgets/PowerMenuWindow.qml | 2 +- config/quickshell/Widgets/qmldir | 1 - flake.lock | 77 +++++++++++++++++- flake.nix | 6 +- home.nix | 9 ++- mutable_config/btop/btop.conf | 18 ++++- 10 files changed, 119 insertions(+), 94 deletions(-) delete mode 100644 config/quickshell/Widgets/NiriWorkspaceWidget.qml diff --git a/config/quickshell/Bar/Bar.qml b/config/quickshell/Bar/Bar.qml index 2e46ed5..feac194 100644 --- a/config/quickshell/Bar/Bar.qml +++ b/config/quickshell/Bar/Bar.qml @@ -25,7 +25,6 @@ PanelWindow { BarPill { Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter HyprlandWorkspaceWidget {} - NiriWorkspaceWidget {} NetTrafficWidget {} } diff --git a/config/quickshell/Widgets/AppLauncherWindow.qml b/config/quickshell/Widgets/AppLauncherWindow.qml index 230dc22..4628c31 100644 --- a/config/quickshell/Widgets/AppLauncherWindow.qml +++ b/config/quickshell/Widgets/AppLauncherWindow.qml @@ -32,8 +32,10 @@ FloatingWindow { function launchSelected() { if (filteredApps.length === 0) return const id = filteredApps[selectedIndex].id + const path = filteredApps[selectedIndex].path const hist = Quickshell.env("HOME") + "/.cache/quickshell/app-launcher-history" - launchProcess.command = ["bash", "-lc", "mkdir -p ~/.cache/quickshell; { printf '%s\\n' " + shellQuote(id) + "; grep -vxF " + shellQuote(id) + " " + shellQuote(hist) + " 2>/dev/null | head -n 29; } > " + shellQuote(hist + ".tmp") + " && mv " + shellQuote(hist + ".tmp") + " " + shellQuote(hist) + "; gtk-launch " + shellQuote(id)] + launchProcess.command = ["bash", "-c", "mkdir -p ~/.cache/quickshell; { printf '%s\\n' " + shellQuote(id) + "; grep -vxF " + shellQuote(id) + " " + shellQuote(hist) + " 2>/dev/null | head -n 29; } > " + shellQuote(hist + ".tmp") + " && mv " + shellQuote(hist + ".tmp") + " " + shellQuote(hist) + "; uwsm app " + shellQuote(path) + " > ~/.cache/quickshell/launch.log 2>&1 & disown"] + console.log("launching: " + launchProcess.command.join(" ")) launchProcess.running = true visible = false } @@ -178,8 +180,12 @@ FloatingWindow { Process { id: appList running: false - command: ["python3", "-c", "import configparser,glob,os,json;\nseen={};\nhist_path=os.path.expanduser('~/.cache/quickshell/app-launcher-history');\nhist=[]\ntry:\n hist=[x.strip() for x in open(hist_path, encoding='utf-8') if x.strip()]\nexcept Exception:\n pass\nrank={v:i for i,v in enumerate(hist)}\npaths=glob.glob('/usr/share/applications/*.desktop')+glob.glob(os.path.expanduser('~/.local/share/applications/*.desktop'));\nfor p in paths:\n cp=configparser.ConfigParser(interpolation=None); cp.optionxform=str\n try: cp.read(p, encoding='utf-8')\n except Exception: continue\n if not cp.has_section('Desktop Entry'): continue\n d=cp['Desktop Entry']\n if d.get('Type','Application')!='Application' or d.get('NoDisplay','false').lower()=='true' or d.get('Hidden','false').lower()=='true': continue\n name=d.get('Name','').strip()\n if not name: continue\n did=os.path.basename(p)\n appid=did[:-8] if did.endswith('.desktop') else did\n seen[appid]={'id':appid,'name':name,'comment':d.get('Comment','').strip(),'icon':d.get('Icon','').strip(),'used': appid in rank}\nprint(json.dumps(sorted(seen.values(), key=lambda x:(rank.get(x['id'],999999), x['name'].lower()))))"] + command: ["python3", "-c", "import configparser,glob,os,json;\nseen={};\nhist_path=os.path.expanduser('~/.cache/quickshell/app-launcher-history');\nhist=[]\ntry:\n hist=[x.strip() for x in open(hist_path, encoding='utf-8') if x.strip()]\nexcept Exception:\n pass\nrank={v:i for i,v in enumerate(hist)}\npaths=[f for d in os.environ.get('XDG_DATA_DIRS', '/usr/share').split(':') + ['~/.local/share'] for f in glob.glob(os.path.expanduser(d)+'/applications/*.desktop')];\nfor p in paths:\n cp=configparser.ConfigParser(interpolation=None); cp.optionxform=str\n try: cp.read(p, encoding='utf-8')\n except Exception: continue\n if not cp.has_section('Desktop Entry'): continue\n d=cp['Desktop Entry']\n if d.get('Type','Application')!='Application' or d.get('NoDisplay','false').lower()=='true' or d.get('Hidden','false').lower()=='true': continue\n name=d.get('Name','').strip()\n if not name: continue\n did=os.path.basename(p)\n appid=did[:-8] if did.endswith('.desktop') else did\n seen[appid]={'id':appid,'path':p,'name':name,'comment':d.get('Comment','').strip(),'icon':d.get('Icon','').strip(),'used': appid in rank}\nprint(json.dumps(sorted(seen.values(), key=lambda x:(rank.get(x['id'],999999), x['name'].lower()))))"] stdout: StdioCollector { onStreamFinished: { try { win.apps = JSON.parse(text) } catch(e) { win.apps = [] }; win.selectedIndex = 0 } } } - Process { id: launchProcess; running: false } + Process { + id: launchProcess + running: false + command: [] + } } diff --git a/config/quickshell/Widgets/HyprlandWorkspaceWidget.qml b/config/quickshell/Widgets/HyprlandWorkspaceWidget.qml index 1d2984c..81aab3d 100644 --- a/config/quickshell/Widgets/HyprlandWorkspaceWidget.qml +++ b/config/quickshell/Widgets/HyprlandWorkspaceWidget.qml @@ -8,6 +8,8 @@ Row { property ListModel workspaces: ListModel {} + property bool isHyprland: (Quickshell.env("XDG_CURRENT_DESKTOP") || "").toLowerCase().indexOf("hyprland") >= 0 + Process { id: process command: ["sh", "-c", "hyprctl activeworkspace -j | jq .id; hyprctl workspaces -j | jq -c ."] @@ -31,17 +33,17 @@ Row { }); } } - onExited: restartTimer.start() + onExited: if (root.isHyprland) restartTimer.start() } Timer { id: restartTimer interval: 500 repeat: false - onTriggered: process.running = true + onTriggered: if (root.isHyprland) process.running = true } - Component.onCompleted: process.running = true + Component.onCompleted: if (root.isHyprland) process.running = true Repeater { model: workspaces diff --git a/config/quickshell/Widgets/NiriWorkspaceWidget.qml b/config/quickshell/Widgets/NiriWorkspaceWidget.qml deleted file mode 100644 index 1909536..0000000 --- a/config/quickshell/Widgets/NiriWorkspaceWidget.qml +++ /dev/null @@ -1,79 +0,0 @@ -import QtQuick -import Quickshell.Io -import qs.Theme - -Row { - id: root - spacing: Theme.spacing - - property ListModel workspaces: ListModel {} - - Process { - id: workspaceProcess - running: true - command: ["mmsg", "-w"] - - stdout: SplitParser { - onRead: line => { - parseWorkspaceLine(line); - } - } - } - - function parseWorkspaceLine(line) { - const tagBinary = /^(\S+)\s+tags\s+([01]+)\s+([01]+)\s+([01]+)$/ - const match = line.match(tagBinary); - - if (match) { - const outputName = match[1]; - const occ = match[2]; - const sel = match[3]; - const urg = match[4]; - - workspaces.clear(); - - for (let i = 0; i < occ.length; i++) { - const tagId = i + 1; - const charIdx = occ.length - 1 - i; - - const isOccupied = occ[charIdx] === '1'; - const isActive = sel[charIdx] === '1'; - const isUrgent = urg[charIdx] === '1'; - - workspaces.append({ - "tagId": tagId, - "output": outputName, - "isOccupied": isOccupied, - "isActive": isActive, - "isUrgent": isUrgent - }); - } - } - } - - Repeater { - model: workspaces - delegate: Rectangle { - height: Theme.barHeight - 16 - width: height - radius: width / 2 - color: model.isActive ? Theme.mauve : (model.isOccupied ? Theme.surface1 : Theme.surface0) - border.color: model.isUrgent ? Theme.red : "transparent" - border.width: 2 - - Text { - anchors.centerIn: parent - text: model.tagId - color: Theme.text - font.pixelSize: Theme.fontPixelSize - } - - MouseArea { - anchors.fill: parent - onClicked: { - Quickshell.execDetached(["mmsg", "-s", "-t", model.tagId]); - } - } - } - } -} diff --git a/config/quickshell/Widgets/PowerMenuWindow.qml b/config/quickshell/Widgets/PowerMenuWindow.qml index 8b8e49e..e09925f 100644 --- a/config/quickshell/Widgets/PowerMenuWindow.qml +++ b/config/quickshell/Widgets/PowerMenuWindow.qml @@ -17,7 +17,7 @@ FloatingWindow { property bool mouseWasInside: false readonly property var actions: [ { name: "Lock", icon: "", hint: "hyprlock", cmd: "hyprlock", danger: false }, - { name: "Logout", icon: "󰗼", hint: "Hyprland exit", cmd: "hyprctl dispatch exit", danger: true }, + { name: "Logout", icon: "󰗼", hint: "loginctl terminate-user", cmd: "loginctl terminate-user $USER", danger: true }, { name: "Suspend", icon: "󰤄", hint: "systemctl suspend", cmd: "systemctl suspend", danger: false }, { name: "Reboot", icon: "󰜉", hint: "systemctl reboot", cmd: "systemctl reboot", danger: true }, { name: "Shutdown", icon: "󰐥", hint: "systemctl poweroff", cmd: "systemctl poweroff", danger: true } diff --git a/config/quickshell/Widgets/qmldir b/config/quickshell/Widgets/qmldir index 2434f37..0ba355e 100644 --- a/config/quickshell/Widgets/qmldir +++ b/config/quickshell/Widgets/qmldir @@ -7,7 +7,6 @@ StorageWidget 1.0 StorageWidget.qml TemperatureWidget 1.0 TemperatureWidget.qml AudioWidget 1.0 AudioWidget.qml TrayWidget 1.0 TrayWidget.qml -NiriWorkspaceWidget 1.0 NiriWorkspaceWidget.qml HyprlandWorkspaceWidget 1.0 HyprlandWorkspaceWidget.qml ThemeSwitcherWindow 1.0 ThemeSwitcherWindow.qml WallpaperSwitcherWindow 1.0 WallpaperSwitcherWindow.qml diff --git a/flake.lock b/flake.lock index bfa0659..627d45c 100644 --- a/flake.lock +++ b/flake.lock @@ -23,6 +23,27 @@ "type": "github" } }, + "chaotic": { + "inputs": { + "flake-schemas": "flake-schemas", + "home-manager": "home-manager_2", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1786855262, + "narHash": "sha256-mMgM6dKcrpZ0sBrlnYU4EoV1JzWjIP8faWPllFXhW8g=", + "owner": "chaotic-cx", + "repo": "nyx", + "rev": "651d55cfb9ae62189ce078ad35161043490c1a96", + "type": "github" + }, + "original": { + "owner": "chaotic-cx", + "ref": "nyxpkgs-unstable", + "repo": "nyx", + "type": "github" + } + }, "darwin": { "inputs": { "nixpkgs": [ @@ -45,6 +66,20 @@ "type": "github" } }, + "flake-schemas": { + "locked": { + "lastModified": 1780327564, + "narHash": "sha256-HiRPtA0spK+Dkgbhz/1zW9glXxNVB+L4Rj2VYmdawb8=", + "rev": "6cc9bd98891b1fc6bb2b8cb3277df8bc72799ca6", + "revCount": 149, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.5.0/019e83cf-9af3-78b1-ac5b-70e68ad1efe1/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/DeterminateSystems/flake-schemas/%3D0.5.0.tar.gz" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -67,6 +102,27 @@ } }, "home-manager_2": { + "inputs": { + "nixpkgs": [ + "chaotic", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1786719456, + "narHash": "sha256-B74DLQs/VjlqyhnnX3tguWwghqJHWSJX30TKZuAljIg=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "83b7606dcf44abe3a94b86e8bb2b3355d22e8797", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_3": { "inputs": { "nixpkgs": [ "nixpkgs" @@ -87,6 +143,22 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1786599213, + "narHash": "sha256-yNJd40f11EzXBjSByCB7IPpeFFAdeoSKKM67dGkfFoU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0e251e24a4f24e036a084b6b4b2d2491af4167f4", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1784497964, "narHash": "sha256-vlHUuqAcbcH2RKmHbPiuQzbv1pnzzavXnI62RD0bqCU=", @@ -105,8 +177,9 @@ "root": { "inputs": { "agenix": "agenix", - "home-manager": "home-manager_2", - "nixpkgs": "nixpkgs" + "chaotic": "chaotic", + "home-manager": "home-manager_3", + "nixpkgs": "nixpkgs_2" } }, "systems": { diff --git a/flake.nix b/flake.nix index 924f65e..b932b4d 100644 --- a/flake.nix +++ b/flake.nix @@ -11,15 +11,19 @@ url = "github:ryantm/agenix"; inputs.nixpkgs.follows = "nixpkgs"; }; + chaotic = { + url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; + }; }; - outputs = { self, nixpkgs, home-manager, agenix, ... }: + outputs = { self, nixpkgs, home-manager, agenix, chaotic, ... }: let mkHome = system: home-manager.lib.homeManagerConfiguration { pkgs = nixpkgs.legacyPackages.${system}; modules = [ agenix.homeManagerModules.age ./home.nix + chaotic.homeModules.default ]; }; in { diff --git a/home.nix b/home.nix index 1c1c19c..d7707e6 100644 --- a/home.nix +++ b/home.nix @@ -1,8 +1,10 @@ { config, pkgs, lib, ... }: { + nix.package = pkgs.nix; + home.username = "johannes"; - home.homeDirectory = if pkgs.stdenv.isDarwin then "/Users/johannes" else "/home/johannes"; + home.homeDirectory = if pkgs.stdenv.hostPlatform.isDarwin then "/Users/johannes" else "/home/johannes"; home.stateVersion = "24.05"; home.packages = with pkgs; [ @@ -35,6 +37,11 @@ sops age devenv + pi-coding-agent + yazi + unzip + owncloud-client + wl-clipboard ]; home.file = { diff --git a/mutable_config/btop/btop.conf b/mutable_config/btop/btop.conf index 1258b44..1f2e49e 100644 --- a/mutable_config/btop/btop.conf +++ b/mutable_config/btop/btop.conf @@ -1,4 +1,4 @@ -#? Config file for btop v.1.4.6 +#? Config file for btop v.1.4.7 #* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes. #* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes" @@ -14,6 +14,11 @@ truecolor = true #* Will force 16-color mode and TTY theme, set all graph symbols to "tty" and swap out other non tty friendly symbols. force_tty = false +#* Option to disable presets. Either the default preset, custom presets, or all presets. +#* "Off" All presets are enabled. +#* "Default" preset is disabled.#* "Custom" presets are disabled.#* "All" presets are disabled. +disable_presets = "Off" + #* Define presets for the layout of the boxes. Preset 0 is always all boxes shown with default settings. Max 9 presets. #* Format: "box_name:P:G,box_name:P:G" P=(0 or 1) for alternate positions, G=graph symbol to use for box. #* Use whitespace " " as separator between different presets. @@ -24,6 +29,9 @@ presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:defaul #* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift. vim_keys = true +#* Disable all mouse events. +disable_mouse = false + #* Rounded corners on boxes, is ignored if TTY mode is ON. rounded_corners = true @@ -92,6 +100,9 @@ proc_left = false #* (Linux) Filter processes tied to the Linux kernel(similar behavior to htop). proc_filter_kernel = false +#* Should the process list follow the selected process when detailed view is open. +proc_follow_detailed = true + #* In tree-view, always accumulate child process resources in the parent process. proc_aggregate = false @@ -208,6 +219,9 @@ io_graph_combined = false #* Example: "/mnt/media:100 /:20 /boot:1". io_graph_speeds = "" +#* Swap the positions of the upload and download speed graphs. When true, upload will be on top. +swap_upload_download = false + #* Set fixed values for network graphs in Mebibits. Is only used if net_auto is also set to False. net_download = 100 @@ -250,7 +264,7 @@ rsmi_measure_pcie_speeds = true #* Horizontally mirror the GPU graph. gpu_mirror_graph = true -#* Set which GPU vendors to show. Available values are "nvidia amd intel" +#* Set which GPU vendors to show. Available values are "nvidia amd intel apple" shown_gpus = "nvidia amd intel" #* Custom gpu0 model name, empty string to disable.