bump to new quadshell
This commit is contained in:
parent
e48297d2ba
commit
d6728c1c96
5 changed files with 10 additions and 53 deletions
8
flake.lock
generated
8
flake.lock
generated
|
|
@ -1234,11 +1234,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1794952294,
|
"lastModified": 1794964664,
|
||||||
"narHash": "sha256-vRU0fxynA0W6KnH4eN4wp0FP1YWtU9jDhamrfNX7T3I=",
|
"narHash": "sha256-SZAog68A9C0c3ymtmORtOIzm34o3nOhiR7QX06xEmTU=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "7f2794a630be74129ea6a4e9717d97378d1224ee",
|
"rev": "b5e5ecf2f351806ee2215641ab30ea37d403afa0",
|
||||||
"revCount": 1,
|
"revCount": 5,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.federated.nexus/Henry-Hiles/quadshell"
|
"url": "https://git.federated.nexus/Henry-Hiles/quadshell"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
213
modules/desktop/wm/gtklock.nix
Normal file
213
modules/desktop/wm/gtklock.nix
Normal file
|
|
@ -0,0 +1,213 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (config.lib.stylix) colors;
|
||||||
|
|
||||||
|
background =
|
||||||
|
pkgs.runCommand "lock-background.jpg" { nativeBuildInputs = [ pkgs.buildPackages.imagemagick ]; }
|
||||||
|
''
|
||||||
|
magick ${../../../background.jpg} -resize 50% -blur 0x16 -modulate 80 $out
|
||||||
|
'';
|
||||||
|
|
||||||
|
layout = pkgs.writeText "gtklock.ui" ''
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<interface>
|
||||||
|
<object class="GtkScrolledWindow" id="window-box">
|
||||||
|
<property name="name">window-box</property>
|
||||||
|
<!-- Never ask for more width than the screen has: the lock surface has to stay the size
|
||||||
|
the compositor gave it, or it gets disconnected and the session stays locked. -->
|
||||||
|
<property name="hscrollbar-policy">external</property>
|
||||||
|
<property name="vscrollbar-policy">never</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkViewport">
|
||||||
|
<property name="shadow-type">none</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox" id="content-box">
|
||||||
|
<property name="name">content-box</property>
|
||||||
|
<property name="halign">center</property>
|
||||||
|
<property name="valign">center</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox" id="info-box">
|
||||||
|
<property name="name">info-box</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox" id="time-box">
|
||||||
|
<property name="name">time-box</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="clock-label">
|
||||||
|
<property name="name">clock-label</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="date-label">
|
||||||
|
<property name="name">date-label</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkRevealer" id="body-revealer">
|
||||||
|
<property name="transition-type">none</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkGrid" id="body-grid">
|
||||||
|
<property name="halign">center</property>
|
||||||
|
<property name="row-spacing">8</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="input-label">
|
||||||
|
<property name="no-show-all">1</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkEntry" id="input-field">
|
||||||
|
<property name="name">input-field</property>
|
||||||
|
<property name="width-request">300</property>
|
||||||
|
<property name="xalign">0.5</property>
|
||||||
|
<property name="visibility">0</property>
|
||||||
|
<property name="caps-lock-warning">0</property>
|
||||||
|
<property name="input-purpose">password</property>
|
||||||
|
<property name="placeholder-text">Input Password</property>
|
||||||
|
<signal name="activate" handler="window_pw_check"/>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left-attach">0</property>
|
||||||
|
<property name="top-attach">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkRevealer" id="message-revealer">
|
||||||
|
<property name="transition-type">none</property>
|
||||||
|
<property name="no-show-all">1</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkScrolledWindow" id="message-scrolled-window">
|
||||||
|
<property name="hscrollbar-policy">never</property>
|
||||||
|
<property name="max-content-height">256</property>
|
||||||
|
<property name="propagate-natural-height">1</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkViewport">
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox" id="message-box">
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="homogeneous">1</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left-attach">0</property>
|
||||||
|
<property name="top-attach">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="halign">center</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="error-label">
|
||||||
|
<property name="name">error-label</property>
|
||||||
|
<property name="wrap">1</property>
|
||||||
|
<property name="justify">center</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="warning-label">
|
||||||
|
<property name="name">warning-label</property>
|
||||||
|
<property name="wrap">1</property>
|
||||||
|
<property name="justify">center</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="unlock-button">
|
||||||
|
<property name="no-show-all">1</property>
|
||||||
|
<signal name="clicked" handler="window_pw_check"/>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left-attach">0</property>
|
||||||
|
<property name="top-attach">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</interface>
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.quad.lock = lib.mkOption {
|
||||||
|
type = lib.types.package;
|
||||||
|
readOnly = true;
|
||||||
|
description = "Locks the session with gtklock, unless it's already running.";
|
||||||
|
default = pkgs.writeShellScript "lock" ''
|
||||||
|
exec ${lib.getExe' pkgs.util-linux "flock"} --nonblock "$XDG_RUNTIME_DIR/gtklock.lock" \
|
||||||
|
${lib.getExe' config.systemd.package "systemd-cat"} --identifier=gtklock \
|
||||||
|
${lib.getExe config.programs.gtklock.package}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
config.programs.gtklock = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
config.main = {
|
||||||
|
layout = "${layout}";
|
||||||
|
time-format = "%H:%M";
|
||||||
|
date-format = "%A, %B %-d";
|
||||||
|
};
|
||||||
|
|
||||||
|
style = ''
|
||||||
|
window {
|
||||||
|
background-image: url("${background}");
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#window-box,
|
||||||
|
#window-box viewport {
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#clock-label {
|
||||||
|
font-size: 96pt;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
#date-label {
|
||||||
|
font-size: 20pt;
|
||||||
|
color: white;
|
||||||
|
margin-bottom: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#input-field {
|
||||||
|
min-height: 50px;
|
||||||
|
padding: 0 20px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 25px;
|
||||||
|
box-shadow: none;
|
||||||
|
background: #${colors.base01};
|
||||||
|
color: #${colors.base05};
|
||||||
|
}
|
||||||
|
|
||||||
|
#error-label,
|
||||||
|
#warning-label {
|
||||||
|
color: #${colors.base08};
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -34,7 +34,6 @@ let
|
||||||
|
|
||||||
hypridleConfig = pkgs.writeText "hypridle.conf" ''
|
hypridleConfig = pkgs.writeText "hypridle.conf" ''
|
||||||
general {
|
general {
|
||||||
lock_cmd = ${config.quad.lock}
|
|
||||||
before_sleep_cmd = loginctl lock-session
|
before_sleep_cmd = loginctl lock-session
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
@ -44,43 +43,6 @@ let
|
||||||
exec ${config.systemd.package}/bin/systemctl suspend
|
exec ${config.systemd.package}/bin/systemctl suspend
|
||||||
'';
|
'';
|
||||||
|
|
||||||
swaync = pkgs.swaynotificationcenter;
|
|
||||||
|
|
||||||
swayncStyle = pkgs.writeText "swaync.css" ''
|
|
||||||
@import url("file://${swaync}/etc/xdg/swaync/style.css");
|
|
||||||
|
|
||||||
:root {
|
|
||||||
--noti-bg-focus: transparent;
|
|
||||||
--noti-border-color: transparent;
|
|
||||||
--notification-shadow: none;
|
|
||||||
--border-radius: 16px;
|
|
||||||
--notification-icon-size: 48px;
|
|
||||||
--font-size-summary: 14px;
|
|
||||||
--font-size-body: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.notification-row .notification-background .notification {
|
|
||||||
background: shade(@theme_bg_color, 1.25);
|
|
||||||
}
|
|
||||||
|
|
||||||
.notification-row .notification-background .notification .notification-default-action .notification-content {
|
|
||||||
padding: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.notification-row .notification-background .notification .notification-default-action .notification-content .text-box .body {
|
|
||||||
opacity: 0.8;
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
|
|
||||||
swayncConfig = (pkgs.formats.json { }).generate "swaync.json" (
|
|
||||||
lib.importJSON "${swaync}/etc/xdg/swaync/config.json"
|
|
||||||
// {
|
|
||||||
positionX = "center";
|
|
||||||
positionY = "top";
|
|
||||||
notification-window-width = 344;
|
|
||||||
ignore-gtk-theme = false;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
|
|
@ -155,9 +117,6 @@ in
|
||||||
spawn-at-startup "${lib.getExe pkgs.app-grid}"
|
spawn-at-startup "${lib.getExe pkgs.app-grid}"
|
||||||
spawn-at-startup "${lib.getExe stevia}"
|
spawn-at-startup "${lib.getExe stevia}"
|
||||||
spawn-at-startup "${lib.getExe' pkgs.swayosd "swayosd-server"}" "--style" "${swayosdStyle}"
|
spawn-at-startup "${lib.getExe' pkgs.swayosd "swayosd-server"}" "--style" "${swayosdStyle}"
|
||||||
spawn-at-startup "${lib.getExe' swaync "swaync"}" "--style" "${swayncStyle}" "--config" "${swayncConfig}"
|
|
||||||
// We log in automatically, so lock straight away.
|
|
||||||
spawn-at-startup "${config.quad.lock}"
|
|
||||||
spawn-at-startup "${lib.getExe pkgs.hypridle}" "--config" "${hypridleConfig}"
|
spawn-at-startup "${lib.getExe pkgs.hypridle}" "--config" "${hypridleConfig}"
|
||||||
|
|
||||||
binds {
|
binds {
|
||||||
|
|
|
||||||
|
|
@ -15,11 +15,6 @@
|
||||||
|
|
||||||
networking.modemmanager.enable = true;
|
networking.modemmanager.enable = true;
|
||||||
|
|
||||||
services = {
|
|
||||||
# Write logs out often, so a crash can be found.
|
|
||||||
journald.settings.Journal.SyncIntervalSec = "15s";
|
|
||||||
geoclue2.enable = true;
|
|
||||||
};
|
|
||||||
users.users.geoclue.extraGroups = [ "networkmanager" ];
|
users.users.geoclue.extraGroups = [ "networkmanager" ];
|
||||||
location.provider = "geoclue2";
|
location.provider = "geoclue2";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,11 @@
|
||||||
{
|
{
|
||||||
nixpkgs.overlays = [ inputs.quadshell.overlays.default ];
|
nixpkgs.overlays = [ inputs.quadshell.overlays.default ];
|
||||||
|
|
||||||
# The flashlight LED's brightness is writable by this group
|
# quadshell is GeoClue's agent, for its location toggle
|
||||||
users.users.quadradical.extraGroups = [ "feedbackd" ];
|
services.geoclue2 = {
|
||||||
|
enableDemoAgent = false;
|
||||||
|
whitelistedAgents = [ "quadshell" ];
|
||||||
|
};
|
||||||
|
|
||||||
environment.etc."niri/config.kdl".text = ''
|
environment.etc."niri/config.kdl".text = ''
|
||||||
spawn-at-startup "${lib.getExe pkgs.quadshell}"
|
spawn-at-startup "${lib.getExe pkgs.quadshell}"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue