diff --git a/flake.lock b/flake.lock index 90537ec..6317e62 100644 --- a/flake.lock +++ b/flake.lock @@ -3518,6 +3518,26 @@ "type": "github" } }, + "quickshell": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1720478269, + "narHash": "sha256-53nF07+fPxLXfQ9bBuxVZ90UAgryG5WJVBmG1XXSuE0=", + "ref": "refs/heads/master", + "rev": "db23c0264a1c277b33698e115a9768caf4da4628", + "revCount": 240, + "type": "git", + "url": "https://git.outfoxxed.me/outfoxxed/quickshell" + }, + "original": { + "type": "git", + "url": "https://git.outfoxxed.me/outfoxxed/quickshell" + } + }, "rnix-lsp": { "inputs": { "naersk": "naersk", @@ -3559,6 +3579,7 @@ "nixpkgs-wayland": "nixpkgs-wayland", "nixvim": "nixvim", "nur": "nur", + "quickshell": "quickshell", "schizofox": "schizofox", "spicetify-nix": "spicetify-nix", "split-monitor-workspaces": "split-monitor-workspaces", diff --git a/flake.nix b/flake.nix index f31fe9b..64dab36 100644 --- a/flake.nix +++ b/flake.nix @@ -58,6 +58,11 @@ }; ags.url = "github:Aylur/ags"; + + quickshell = { + url = "git+https://git.outfoxxed.me/outfoxxed/quickshell"; + inputs.nixpkgs.follows = "nixpkgs"; + }; schizofox = { url = "github:schizofox/schizofox"; inputs = { diff --git a/hosts/default.nix b/hosts/default.nix index f53a67a..0ee3baa 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -2,9 +2,9 @@ inherit (inputs) self; inherit (self) lib; in { - temperance = lib.nixosSystem { + temperance = lib.nixosSystem rec { system = "x86_64-linux"; - specialArgs = {inherit lib inputs self;}; + specialArgs = {inherit lib inputs self system;}; modules = [ ./vali/temperance ../modules @@ -13,9 +13,9 @@ in { inputs.stylix.nixosModules.stylix ]; }; - hermit = lib.nixosSystem { + hermit = lib.nixosSystem rec { system = "x86_64-linux"; - specialArgs = {inherit lib inputs self;}; + specialArgs = {inherit lib inputs self system;}; modules = [ ./vali/hermit ../modules diff --git a/hosts/vali/hermit/configuration.nix b/hosts/vali/hermit/configuration.nix index cc6f63e..adb4f46 100644 --- a/hosts/vali/hermit/configuration.nix +++ b/hosts/vali/hermit/configuration.nix @@ -21,6 +21,8 @@ experimental-features = ["nix-command" "flakes"]; # reduce file size used & automatic garbage collector auto-optimise-store = true; + max-jobs = 3; + cores = 4; }; }; security.sudo.package = pkgs.sudo.override {withInsults = true;}; @@ -94,7 +96,8 @@ pipewire.enable = true; dunst.enable = true; }; - themes = { + theming = { + quickshell.enable = true; stylix = { enable = true; # scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-pale.yaml"; diff --git a/hosts/vali/hermit/programs.nix b/hosts/vali/hermit/programs.nix index d53f2f6..adf82d6 100644 --- a/hosts/vali/hermit/programs.nix +++ b/hosts/vali/hermit/programs.nix @@ -18,6 +18,7 @@ in { browsh bun cachix + calc cmake difftastic dig diff --git a/modules/editors/nvf/lua/core.lua b/modules/editors/nvf/lua/core.lua index 8c95af1..617e954 100644 --- a/modules/editors/nvf/lua/core.lua +++ b/modules/editors/nvf/lua/core.lua @@ -1,34 +1,30 @@ local opt = vim.opt local options = { - showmode = false, -- disable the -- STATUS -- line - showtabline = 0, -- never show the tabline - startofline = true, -- motions like "G" also move to the first char - virtualedit = 'block', -- visual-block mode can select beyond end of line - showmatch = true, -- when closing a bracket, briefly flash the matching one - matchtime = 1, -- duration of that flashing n deci-seconds - signcolumn = 'yes:1', -- static width - report = 9001, -- disable "x more/fewer lines" messages - diffopt = opt.diffopt:append('vertical'), -- diff mode: vertical splits - backspace = { 'indent', 'eol', 'start' }, -- backspace through everything in insert mode - hidden = true, -- Enable background buffers - history = 100, -- Remember N lines in history - lazyredraw = false, -- Faster scrolling if enabled, breaks noice - synmaxcol = 240, -- Max column for syntax highlight - updatetime = 250, -- ms to wait for trigger an event + showmode = false, -- disable the -- STATUS -- line + showtabline = 0, -- never show the tabline + startofline = true, -- motions like "G" also move to the first char + virtualedit = 'block', -- visual-block mode can select beyond end of line + showmatch = true, -- when closing a bracket, briefly flash the matching one + matchtime = 1, -- duration of that flashing n deci-seconds + signcolumn = 'yes:1', -- static width + report = 9001, -- disable "x more/fewer lines" messages + diffopt = opt.diffopt:append('vertical'), -- diff mode: vertical splits + backspace = { 'indent', 'eol', 'start' }, -- backspace through everything in insert mode + hidden = true, -- Enable background buffers + history = 100, -- Remember N lines in history + lazyredraw = false, -- Faster scrolling if enabled, breaks noice + synmaxcol = 240, -- Max column for syntax highlight + updatetime = 250, -- ms to wait for trigger an event - -- If 0, move cursor line will not scroll window. - -- If 999, cursor line will always be in middle of window. - scrolloff = 0, + -- If 0, move cursor line will not scroll window. + -- If 999, cursor line will always be in middle of window. + scrolloff = 0, } -- iterate over the options table and set the options -- for each key = value pair for key, value in pairs(options) do - opt[key] = value -end - -if not vim.g.vscode then - opt.timeoutlen = 300 -- Time out on mappings + opt[key] = value end -- Don't auto-comment new lines automatically diff --git a/modules/editors/nvf/plugins/settings/ui.nix b/modules/editors/nvf/plugins/settings/ui.nix index b321846..dddc91c 100644 --- a/modules/editors/nvf/plugins/settings/ui.nix +++ b/modules/editors/nvf/plugins/settings/ui.nix @@ -11,13 +11,13 @@ in { colorizer.enable = true; modes-nvim.enable = true; illuminate.enable = true; - + breadcrumbs = { enable = true; source = "nvim-navic"; navbuddy.enable = false; }; - + smartcolumn = { enable = true; setupOpts = { @@ -30,7 +30,7 @@ in { }; }; }; - + borders = { enable = true; globalStyle = "rounded"; diff --git a/modules/editors/nvf/settings.nix b/modules/editors/nvf/settings.nix index 23611c8..43ef9c8 100644 --- a/modules/editors/nvf/settings.nix +++ b/modules/editors/nvf/settings.nix @@ -70,16 +70,16 @@ in { # I have come to realise that spellfile contents are # actually **not** loaded when luaConfigRC is used. # as spellfile is a vim thing, this should be fine - # configRC.spellfile = entryAnywhere '' - # set spellfile=${toString ./spell/runtime/en.utf-8.add} " toString sanitizes the path - # ''; + configRC.spellfile = entryAnywhere '' + set spellfile=${toString ./spell/runtime/en.utf-8.add} " toString sanitizes the path + ''; # additional lua configuration that I can append # or, to be more precise, randomly inject into # the lua configuration of my Neovim configuration # wrapper. this is recursively read from the lua # directory, so we do not need to use require - /* + luaConfigRC = let # get the name of each lua file in the lua directory, where setting files reside # and import them recursively @@ -94,7 +94,6 @@ in { ''); in luaConfig; - */ }; }; }; diff --git a/modules/gui/gtk.nix b/modules/gui/gtk.nix index acec4ed..d82a155 100644 --- a/modules/gui/gtk.nix +++ b/modules/gui/gtk.nix @@ -5,10 +5,10 @@ ... }: with lib; let - cfg = config.modules.themes.gtk; - username = config.modules.other.system.username; + cfg = config.modules.theming.gtk; + inherit (config.modules.other.system) username; in { - options.modules.themes.gtk = { + options.modules.theming.gtk = { enable = mkEnableOption "gtk theming"; name = mkOption { description = "gtk theme name"; diff --git a/modules/gui/qt.nix b/modules/gui/qt.nix index 0614a9f..a632724 100644 --- a/modules/gui/qt.nix +++ b/modules/gui/qt.nix @@ -9,10 +9,10 @@ with lib; let package = pkgs.gruvbox-gtk-theme; name = "Gruvbox-Dark-BL"; }; - cfg = config.modules.themes.qt; + cfg = config.modules.theming.qt; inherit (config.modules.other.system) username; in { - options.modules.themes.qt = { + options.modules.theming.qt = { enable = mkEnableOption "qt theming"; name = mkOption { description = "qt theme name"; diff --git a/modules/styling/default.nix b/modules/styling/default.nix index 7cf51db..eee4ccd 100644 --- a/modules/styling/default.nix +++ b/modules/styling/default.nix @@ -2,5 +2,6 @@ _: { imports = [ ./ags.nix ./stylix.nix + ./quickshell ]; } diff --git a/modules/styling/quickshell/bar/shell.qml b/modules/styling/quickshell/bar/shell.qml new file mode 100644 index 0000000..d931566 --- /dev/null +++ b/modules/styling/quickshell/bar/shell.qml @@ -0,0 +1,35 @@ +import Quickshell // for ShellRoot and PanelWindow +import QtQuick // for text +import QtQuick.Layouts +import QtQuick.Controls +import "workspaces" as Workspaces + +ShellRoot { + PanelWindow { + anchors { + top: true + left : true + right:true + } + height: 30 + ColumnLayout { + Layout.fillWidth: true + spacing: 0 + Loader { + active: isSoleBar + Layout.preferredHeight: active ? implicitHeight: 0; + Layout.fillWidth: true + sourceComponent: Workspaces.Widget { + bar: root + wsBaseIndex: 1 + } + } + Workspaces.Widget { + bar: root + Layout.fillWidth: true + wsBaseIndex: 1; + hideWhenEmpty: isSoleBar + } + } + } +} diff --git a/modules/styling/quickshell/bar/workspaces/Widget.qml b/modules/styling/quickshell/bar/workspaces/Widget.qml new file mode 100644 index 0000000..117325e --- /dev/null +++ b/modules/styling/quickshell/bar/workspaces/Widget.qml @@ -0,0 +1,110 @@ +import QtQuick +import QtQuick.Layouts +import Quickshell.Hyprland +import ".." +import "root:." + +MouseArea { + id: root + required property var bar; + required property int wsBaseIndex; + property int wsCount: 10; + property bool hideWhenEmpty: false; + implicitHeight: column.implicitHeight + 10; + acceptedButtons: Qt.NoButton + onWheel: event => { + event.accepted = true; + const step = -Math.sign(event.angleDelta.y); + const targetWs = currentIndex + step; + if (targetWs >= wsBaseIndex && targetWs < wsBaseIndex + wsCount) { + Hyprland.dispatch(`workspace ${targetWs}`) + } + } + readonly property HyprlandMonitor monitor: Hyprland.monitorFor(bar.screen); + property int currentIndex: 0; + property int existsCount: 0; + visible: !hideWhenEmpty || existsCount > 0; + + property real animPos: 0; + Behavior on animPos { SmoothedAnimation { velocity: 100 } } + + // destructor takes care of nulling + signal workspaceAdded(workspace: HyprlandWorkspace); + + ColumnLayout { + id: column + spacing: 0 + anchors { + fill: parent; + topMargin: 0; + margins: 5; + } + + Repeater { + model: 10 + + MouseArea { + id: wsItem + onPressed: Hyprland.dispatch(`workspace ${wsIndex}`); + + Layout.fillWidth: true + implicitHeight: 15 + + required property int index; + property int wsIndex: wsBaseIndex + index; + property HyprlandWorkspace workspace: null; + property bool exists: workspace != null; + property bool active: (monitor?.activeWorkspace ?? false) && monitor.activeWorkspace == workspace; + + onActiveChanged: { + if (active) root.currentIndex = wsIndex; + } + + onExistsChanged: { + root.existsCount += exists ? 1 : -1; + } + + Connections { + target: root + + function onWorkspaceAdded(workspace: HyprlandWorkspace) { + if (workspace.id == wsItem.wsIndex) { + wsItem.workspace = workspace; + } + } + } + + property real animActive: active ? 100 : 0 + Behavior on animActive { NumberAnimation { duration: 100 } } + + property real animExists: exists ? 100 : 0 + Behavior on animExists { NumberAnimation { duration: 100 } } + + Rectangle { + anchors.centerIn: parent + height: 10 + width: parent.width + scale: 1 + animActive * 0.003 + radius: height / 2 + border.color: ShellGlobals.colors.widgetOutline + border.width: 1 + color: ShellGlobals.interpolateColors(animExists * 0.01, ShellGlobals.colors.widget, ShellGlobals.colors.widgetActive); + } + } + } + } + + Connections { + target: Hyprland.workspaces + + function onObjectInsertedPost(workspace) { + root.workspaceAdded(workspace); + } + } + + Component.onCompleted: { + Hyprland.workspaces.values.forEach(workspace => { + root.workspaceAdded(workspace) + }); + } +} diff --git a/modules/styling/quickshell/default.nix b/modules/styling/quickshell/default.nix new file mode 100644 index 0000000..f9c4fcc --- /dev/null +++ b/modules/styling/quickshell/default.nix @@ -0,0 +1,27 @@ +{ + config, + lib, + system, + inputs, + pkgs, + ... +}: let + inherit (inputs) quickshell; + inherit (lib) mkIf mkEnableOption; + inherit (lib.generators) toKeyValue; + inherit (config.modules.other.system) username; + cfg = config.modules.theming.quickshell; +in { + options.modules.theming.quickshell.enable = mkEnableOption "quickshell"; + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + qt6.qtimageformats + qt6.qt5compat + quickshell.packages.${system}.default + pamtester + ]; + home-manager.users.${username}.xdg.configFile."quickshell/manifest.conf".text = toKeyValue {} { + bar = "${./bar}"; + }; + }; +} diff --git a/modules/styling/quickshell/systray/Widget.qml b/modules/styling/quickshell/systray/Widget.qml new file mode 100644 index 0000000..e69de29 diff --git a/modules/styling/stylix.nix b/modules/styling/stylix.nix index a2351e2..77ab969 100644 --- a/modules/styling/stylix.nix +++ b/modules/styling/stylix.nix @@ -4,12 +4,12 @@ lib, ... }: let - cfg = config.modules.themes.stylix; - inherit (config.modules.themes.stylix) scheme image; - inherit (config.modules.themes.stylix.cursor) size; - inherit (config.modules.themes.stylix.fontsizes) terminal popups applications; + cfg = config.modules.theming.stylix; + inherit (config.modules.theming.stylix) scheme image; + inherit (config.modules.theming.stylix.cursor) size; + inherit (config.modules.theming.stylix.fontsizes) terminal popups applications; in { - options.modules.themes.stylix = { + options.modules.theming.stylix = { enable = lib.mkEnableOption "stylix"; scheme = lib.mkOption { description = " Color Scheme"; diff --git a/modules/wms/wayland/hypr/land.nix b/modules/wms/wayland/hypr/land.nix index 9bf42e8..4da1e90 100644 --- a/modules/wms/wayland/hypr/land.nix +++ b/modules/wms/wayland/hypr/land.nix @@ -25,11 +25,14 @@ in { # xdg Portal xdg.portal = { enable = true; + configPackages = [ + hyprland + ]; extraPortals = [ pkgs.xdg-desktop-portal-gtk inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland ]; - config.common.default = "*"; + #config.common.default = "hyprland"; }; home-manager.users.${username} = { wayland.windowManager.hyprland = { @@ -123,6 +126,9 @@ in { follow_mouse = true; repeat_rate = 50; repeat_delay = 250; + touchpad = { + disable_while_typing = true; + }; }; general = { sensitivity = 1.0;