quickshell!

This commit is contained in:
Charlie Root 2024-07-10 22:10:54 +02:00
commit dc8e6873c3
17 changed files with 251 additions and 47 deletions

21
flake.lock generated
View file

@ -3518,6 +3518,26 @@
"type": "github" "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": { "rnix-lsp": {
"inputs": { "inputs": {
"naersk": "naersk", "naersk": "naersk",
@ -3559,6 +3579,7 @@
"nixpkgs-wayland": "nixpkgs-wayland", "nixpkgs-wayland": "nixpkgs-wayland",
"nixvim": "nixvim", "nixvim": "nixvim",
"nur": "nur", "nur": "nur",
"quickshell": "quickshell",
"schizofox": "schizofox", "schizofox": "schizofox",
"spicetify-nix": "spicetify-nix", "spicetify-nix": "spicetify-nix",
"split-monitor-workspaces": "split-monitor-workspaces", "split-monitor-workspaces": "split-monitor-workspaces",

View file

@ -58,6 +58,11 @@
}; };
ags.url = "github:Aylur/ags"; ags.url = "github:Aylur/ags";
quickshell = {
url = "git+https://git.outfoxxed.me/outfoxxed/quickshell";
inputs.nixpkgs.follows = "nixpkgs";
};
schizofox = { schizofox = {
url = "github:schizofox/schizofox"; url = "github:schizofox/schizofox";
inputs = { inputs = {

View file

@ -2,9 +2,9 @@
inherit (inputs) self; inherit (inputs) self;
inherit (self) lib; inherit (self) lib;
in { in {
temperance = lib.nixosSystem { temperance = lib.nixosSystem rec {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = {inherit lib inputs self;}; specialArgs = {inherit lib inputs self system;};
modules = [ modules = [
./vali/temperance ./vali/temperance
../modules ../modules
@ -13,9 +13,9 @@ in {
inputs.stylix.nixosModules.stylix inputs.stylix.nixosModules.stylix
]; ];
}; };
hermit = lib.nixosSystem { hermit = lib.nixosSystem rec {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = {inherit lib inputs self;}; specialArgs = {inherit lib inputs self system;};
modules = [ modules = [
./vali/hermit ./vali/hermit
../modules ../modules

View file

@ -21,6 +21,8 @@
experimental-features = ["nix-command" "flakes"]; experimental-features = ["nix-command" "flakes"];
# reduce file size used & automatic garbage collector # reduce file size used & automatic garbage collector
auto-optimise-store = true; auto-optimise-store = true;
max-jobs = 3;
cores = 4;
}; };
}; };
security.sudo.package = pkgs.sudo.override {withInsults = true;}; security.sudo.package = pkgs.sudo.override {withInsults = true;};
@ -94,7 +96,8 @@
pipewire.enable = true; pipewire.enable = true;
dunst.enable = true; dunst.enable = true;
}; };
themes = { theming = {
quickshell.enable = true;
stylix = { stylix = {
enable = true; enable = true;
# scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-pale.yaml"; # scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-pale.yaml";

View file

@ -18,6 +18,7 @@ in {
browsh browsh
bun bun
cachix cachix
calc
cmake cmake
difftastic difftastic
dig dig

View file

@ -1,34 +1,30 @@
local opt = vim.opt local opt = vim.opt
local options = { local options = {
showmode = false, -- disable the -- STATUS -- line showmode = false, -- disable the -- STATUS -- line
showtabline = 0, -- never show the tabline showtabline = 0, -- never show the tabline
startofline = true, -- motions like "G" also move to the first char startofline = true, -- motions like "G" also move to the first char
virtualedit = 'block', -- visual-block mode can select beyond end of line virtualedit = 'block', -- visual-block mode can select beyond end of line
showmatch = true, -- when closing a bracket, briefly flash the matching one showmatch = true, -- when closing a bracket, briefly flash the matching one
matchtime = 1, -- duration of that flashing n deci-seconds matchtime = 1, -- duration of that flashing n deci-seconds
signcolumn = 'yes:1', -- static width signcolumn = 'yes:1', -- static width
report = 9001, -- disable "x more/fewer lines" messages report = 9001, -- disable "x more/fewer lines" messages
diffopt = opt.diffopt:append('vertical'), -- diff mode: vertical splits diffopt = opt.diffopt:append('vertical'), -- diff mode: vertical splits
backspace = { 'indent', 'eol', 'start' }, -- backspace through everything in insert mode backspace = { 'indent', 'eol', 'start' }, -- backspace through everything in insert mode
hidden = true, -- Enable background buffers hidden = true, -- Enable background buffers
history = 100, -- Remember N lines in history history = 100, -- Remember N lines in history
lazyredraw = false, -- Faster scrolling if enabled, breaks noice lazyredraw = false, -- Faster scrolling if enabled, breaks noice
synmaxcol = 240, -- Max column for syntax highlight synmaxcol = 240, -- Max column for syntax highlight
updatetime = 250, -- ms to wait for trigger an event updatetime = 250, -- ms to wait for trigger an event
-- If 0, move cursor line will not scroll window. -- If 0, move cursor line will not scroll window.
-- If 999, cursor line will always be in middle of window. -- If 999, cursor line will always be in middle of window.
scrolloff = 0, scrolloff = 0,
} }
-- iterate over the options table and set the options -- iterate over the options table and set the options
-- for each key = value pair -- for each key = value pair
for key, value in pairs(options) do for key, value in pairs(options) do
opt[key] = value opt[key] = value
end
if not vim.g.vscode then
opt.timeoutlen = 300 -- Time out on mappings
end end
-- Don't auto-comment new lines automatically -- Don't auto-comment new lines automatically

View file

@ -70,16 +70,16 @@ in {
# I have come to realise that spellfile contents are # I have come to realise that spellfile contents are
# actually **not** loaded when luaConfigRC is used. # actually **not** loaded when luaConfigRC is used.
# as spellfile is a vim thing, this should be fine # as spellfile is a vim thing, this should be fine
# configRC.spellfile = entryAnywhere '' configRC.spellfile = entryAnywhere ''
# set spellfile=${toString ./spell/runtime/en.utf-8.add} " toString sanitizes the path set spellfile=${toString ./spell/runtime/en.utf-8.add} " toString sanitizes the path
# ''; '';
# additional lua configuration that I can append # additional lua configuration that I can append
# or, to be more precise, randomly inject into # or, to be more precise, randomly inject into
# the lua configuration of my Neovim configuration # the lua configuration of my Neovim configuration
# wrapper. this is recursively read from the lua # wrapper. this is recursively read from the lua
# directory, so we do not need to use require # directory, so we do not need to use require
/*
luaConfigRC = let luaConfigRC = let
# get the name of each lua file in the lua directory, where setting files reside # get the name of each lua file in the lua directory, where setting files reside
# and import them recursively # and import them recursively
@ -94,7 +94,6 @@ in {
''); '');
in in
luaConfig; luaConfig;
*/
}; };
}; };
}; };

View file

@ -5,10 +5,10 @@
... ...
}: }:
with lib; let with lib; let
cfg = config.modules.themes.gtk; cfg = config.modules.theming.gtk;
username = config.modules.other.system.username; inherit (config.modules.other.system) username;
in { in {
options.modules.themes.gtk = { options.modules.theming.gtk = {
enable = mkEnableOption "gtk theming"; enable = mkEnableOption "gtk theming";
name = mkOption { name = mkOption {
description = "gtk theme name"; description = "gtk theme name";

View file

@ -9,10 +9,10 @@ with lib; let
package = pkgs.gruvbox-gtk-theme; package = pkgs.gruvbox-gtk-theme;
name = "Gruvbox-Dark-BL"; name = "Gruvbox-Dark-BL";
}; };
cfg = config.modules.themes.qt; cfg = config.modules.theming.qt;
inherit (config.modules.other.system) username; inherit (config.modules.other.system) username;
in { in {
options.modules.themes.qt = { options.modules.theming.qt = {
enable = mkEnableOption "qt theming"; enable = mkEnableOption "qt theming";
name = mkOption { name = mkOption {
description = "qt theme name"; description = "qt theme name";

View file

@ -2,5 +2,6 @@ _: {
imports = [ imports = [
./ags.nix ./ags.nix
./stylix.nix ./stylix.nix
./quickshell
]; ];
} }

View file

@ -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
}
}
}
}

View file

@ -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)
});
}
}

View file

@ -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}";
};
};
}

View file

@ -4,12 +4,12 @@
lib, lib,
... ...
}: let }: let
cfg = config.modules.themes.stylix; cfg = config.modules.theming.stylix;
inherit (config.modules.themes.stylix) scheme image; inherit (config.modules.theming.stylix) scheme image;
inherit (config.modules.themes.stylix.cursor) size; inherit (config.modules.theming.stylix.cursor) size;
inherit (config.modules.themes.stylix.fontsizes) terminal popups applications; inherit (config.modules.theming.stylix.fontsizes) terminal popups applications;
in { in {
options.modules.themes.stylix = { options.modules.theming.stylix = {
enable = lib.mkEnableOption "stylix"; enable = lib.mkEnableOption "stylix";
scheme = lib.mkOption { scheme = lib.mkOption {
description = " Color Scheme"; description = " Color Scheme";

View file

@ -25,11 +25,14 @@ in {
# xdg Portal # xdg Portal
xdg.portal = { xdg.portal = {
enable = true; enable = true;
configPackages = [
hyprland
];
extraPortals = [ extraPortals = [
pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-gtk
inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland
]; ];
config.common.default = "*"; #config.common.default = "hyprland";
}; };
home-manager.users.${username} = { home-manager.users.${username} = {
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
@ -123,6 +126,9 @@ in {
follow_mouse = true; follow_mouse = true;
repeat_rate = 50; repeat_rate = 50;
repeat_delay = 250; repeat_delay = 250;
touchpad = {
disable_while_typing = true;
};
}; };
general = { general = {
sensitivity = 1.0; sensitivity = 1.0;