quickshell fixes

This commit is contained in:
Charlie Root 2024-08-09 11:54:07 +02:00
commit 5158f3ff8f
10 changed files with 96 additions and 29 deletions

16
flake.lock generated
View file

@ -963,6 +963,21 @@
"type": "github" "type": "github"
} }
}, },
"impurity": {
"locked": {
"lastModified": 1689836741,
"narHash": "sha256-82KeRg2sAqDXCdzVs8P8GoqVaPsZjkWgrfsj6kgOLTY=",
"owner": "outfoxxed",
"repo": "impurity.nix",
"rev": "bbc41b69ab5485cd55aa315d08cff865781d3913",
"type": "github"
},
"original": {
"owner": "outfoxxed",
"repo": "impurity.nix",
"type": "github"
}
},
"lib-aggregate": { "lib-aggregate": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_6", "flake-utils": "flake-utils_6",
@ -3326,6 +3341,7 @@
"home-manager": "home-manager", "home-manager": "home-manager",
"hyprland": "hyprland", "hyprland": "hyprland",
"hyprland-plugins": "hyprland-plugins", "hyprland-plugins": "hyprland-plugins",
"impurity": "impurity",
"neovim-flake": "neovim-flake", "neovim-flake": "neovim-flake",
"nix-super": "nix-super", "nix-super": "nix-super",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",

View file

@ -45,6 +45,9 @@
# Helix my beloved # Helix my beloved
helix.url = "github:helix-editor/helix"; helix.url = "github:helix-editor/helix";
# Impurity, ruining my nice pure system
impurity.url = "github:outfoxxed/impurity.nix";
# Hyprland, my main compositor # Hyprland, my main compositor
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";

View file

@ -38,6 +38,14 @@ in {
./vali/temperance ./vali/temperance
../modules ../modules
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
{
imports = [inputs.impurity.nixosModules.impurity];
impurity = {
enable = true;
configRoot = self;
};
}
]; ];
}; };

View file

@ -43,6 +43,7 @@ in {
keepassxc keepassxc
krita krita
lazygit lazygit
libreoffice
librewolf librewolf
libtool libtool
links2 links2

View file

@ -36,8 +36,8 @@ in {
*/ */
#TabsToolbar {visibility: collapse;} #TabsToolbar {visibility: collapse;}
/* #navigator-toolbox {visibility: collapse;} */ /* #navigator-toolbox {visibility: collapse;}
browser {margin-right: -14px; margin-bottom: -14px;} browser {margin-right: -14px; margin-bottom: -14px;} */
''; '';
}; };

View file

@ -3,6 +3,7 @@
inputs, inputs,
lib, lib,
self, self,
impurity,
... ...
}: }:
with lib; let with lib; let
@ -20,7 +21,7 @@ in {
useUserPackages = true; useUserPackages = true;
useGlobalPkgs = true; useGlobalPkgs = true;
backupFileExtension = "hm.old"; backupFileExtension = "hm.old";
extraSpecialArgs = {inherit inputs self;}; extraSpecialArgs = {inherit inputs self impurity;};
users.${username} = { users.${username} = {
programs = { programs = {
home-manager.enable = true; home-manager.enable = true;

View file

@ -3,8 +3,6 @@ import Quickshell.Io // For Processes
import QtQuick // For Text import QtQuick // For Text
Scope { Scope {
id: root
property string time;
Variants { Variants {
model: Quickshell.screens model: Quickshell.screens
@ -14,37 +12,16 @@ Scope {
screen: modelData screen: modelData
anchors { anchors {
top: true bottom: true
left: true left: true
right: true right: true
} }
height: 30 height: 30
Text { ClockWidget {
anchors.centerIn: parent anchors.centerIn: parent
// now just time instead of root.time
text: time
} }
} }
} }
Process {
id: dateProc
command: ["date"]
running: true
stdout: SplitParser {
// now just time instead of root.time
onRead: data => time = data
}
}
Timer {
interval: 1000
running: true
repeat: true
onTriggered: dateProc.running = true
}
} }

View file

@ -0,0 +1,31 @@
import Quickshell.Io
import QtQuick
import QtQuick.Layouts
Item {
property string time
Text {
text: time
}
Process {
id: dateProc
command: ["date", "-u", "+%a, %d %b %H:%M:%S"]
running: true
stdout: SplitParser {
onRead: data => time = data
}
}
Timer {
interval: 1000
running: true
repeat: true
onTriggered: dateProc.running = true
}
}

View file

@ -0,0 +1,28 @@
// with this line our type becomes a singleton
pragma Singleton
import Quickshell
import Quickshell.Io
import QtQuick
// your singletons should always have Singleton as the type
Singleton {
property string time
Process {
id: dateProc
command: ["date"]
running: true
stdout: SplitParser {
onRead: data => time = data
}
}
Timer {
interval: 1000
running: true
repeat: true
onTriggered: dateProc.running = true
}
}

View file

@ -3,6 +3,7 @@
lib, lib,
inputs, inputs,
pkgs, pkgs,
impurity,
... ...
}: let }: let
inherit (inputs) quickshell; inherit (inputs) quickshell;
@ -20,7 +21,8 @@ in {
pamtester pamtester
]; ];
home-manager.users.${username}.xdg.configFile."quickshell/manifest.conf".text = toKeyValue {} { home-manager.users.${username}.xdg.configFile."quickshell/manifest.conf".text = toKeyValue {} {
bar = "${./bar}"; bar = "${impurity.link ./bar}";
# bar = "${./bar}";
}; };
}; };
} }