cleanup FHT config
This commit is contained in:
parent
b68919bf6d
commit
74fe86402c
1 changed files with 259 additions and 263 deletions
|
|
@ -8,31 +8,37 @@
|
|||
let
|
||||
filename = "fht-compositor.toml";
|
||||
|
||||
swaync = pkgs.swaynotificationcenter;
|
||||
swaync-config = (pkgs.formats.json { }).generate "swaync.json" (
|
||||
let
|
||||
default = lib.importJSON "${swaync}/etc/xdg/swaync/config.json";
|
||||
in
|
||||
default
|
||||
// lib.genAttrs (map (side: "control-center-margin-${side}") [
|
||||
"top"
|
||||
"bottom"
|
||||
"right"
|
||||
]) (_: 8)
|
||||
// {
|
||||
notification-window-width = 420;
|
||||
ignore-gtk-theme = false;
|
||||
fit-to-screen = false;
|
||||
control-center-height = -1;
|
||||
widget-config = default.widget-config // {
|
||||
notifications = default.widget-config.notifications or { } // {
|
||||
vexpand = false;
|
||||
};
|
||||
};
|
||||
session-programs = pkgs.writeShellApplication {
|
||||
name = "session-programs";
|
||||
runtimeInputs = with pkgs; [
|
||||
procps
|
||||
util-linux
|
||||
];
|
||||
text = ''
|
||||
restart() {
|
||||
pattern=$1
|
||||
shift
|
||||
pkill -f "$pattern" || true
|
||||
for _ in $(seq 50); do
|
||||
pgrep -f "$pattern" >/dev/null || break
|
||||
sleep 0.1
|
||||
done
|
||||
setsid "$@" >/dev/null 2>&1 </dev/null &
|
||||
}
|
||||
);
|
||||
swaync-style = pkgs.writeText "swaync.css" ''
|
||||
@import url("file://${swaync}/etc/xdg/swaync/style.css");
|
||||
|
||||
restart '/bin/elephant$' systemd-cat -t elephant ${lib.getExe pkgs.elephant}
|
||||
restart 'walker.* --gapplication-service' walker --gapplication-service
|
||||
restart 'gaypanel-wrapped_' systemd-cat -t gaypanel gaypanel
|
||||
restart 'bin/swaybg ' ${lib.getExe pkgs.swaybg} -i ${../../../background.jpg} -m fill
|
||||
restart 'bin/swayosd-server ' ${lib.getExe' pkgs.swayosd "swayosd-server"} --style ${pkgs.writeText "swayosd.css" ''
|
||||
@import url("file://${pkgs.swayosd}/etc/xdg/swayosd/style.css");
|
||||
|
||||
window#osd {
|
||||
background: shade(@theme_bg_color, 1.15);
|
||||
}
|
||||
''}
|
||||
restart 'bin/swaync ' ${lib.getExe' pkgs.swaynotificationcenter "swaync"} --style ${pkgs.writeText "swaync.css" ''
|
||||
@import url("file://${pkgs.swaynotificationcenter}/etc/xdg/swaync/style.css");
|
||||
|
||||
:root {
|
||||
--noti-bg-focus: transparent;
|
||||
|
|
@ -76,48 +82,36 @@ let
|
|||
.notification-row .notification-background .notification .notification-default-action .notification-content .text-box .body {
|
||||
opacity: 0.8;
|
||||
}
|
||||
'';
|
||||
|
||||
osd-style = pkgs.writeText "swayosd.css" ''
|
||||
@import url("file://${pkgs.swayosd}/etc/xdg/swayosd/style.css");
|
||||
|
||||
window#osd {
|
||||
background: shade(@theme_bg_color, 1.15);
|
||||
''} --config ${
|
||||
(pkgs.formats.json { }).generate "swaync.json" (
|
||||
let
|
||||
default = lib.importJSON "${pkgs.swaynotificationcenter}/etc/xdg/swaync/config.json";
|
||||
in
|
||||
default
|
||||
// lib.genAttrs (map (side: "control-center-margin-${side}") [
|
||||
"top"
|
||||
"bottom"
|
||||
"right"
|
||||
]) (_: 8)
|
||||
// {
|
||||
notification-window-width = 420;
|
||||
ignore-gtk-theme = false;
|
||||
fit-to-screen = false;
|
||||
control-center-height = -1;
|
||||
widget-config = default.widget-config // {
|
||||
notifications = default.widget-config.notifications or { } // {
|
||||
vexpand = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
'';
|
||||
|
||||
session-programs = pkgs.writeShellApplication {
|
||||
name = "session-programs";
|
||||
runtimeInputs = with pkgs; [
|
||||
procps
|
||||
util-linux
|
||||
];
|
||||
text = ''
|
||||
restart() {
|
||||
pattern=$1
|
||||
shift
|
||||
pkill -f "$pattern" || true
|
||||
for _ in $(seq 50); do
|
||||
pgrep -f "$pattern" >/dev/null || break
|
||||
sleep 0.1
|
||||
done
|
||||
setsid "$@" >/dev/null 2>&1 </dev/null &
|
||||
)
|
||||
}
|
||||
|
||||
restart '/bin/elephant$' systemd-cat -t elephant ${lib.getExe pkgs.elephant}
|
||||
restart 'walker.* --gapplication-service' walker --gapplication-service
|
||||
restart 'gaypanel-wrapped_' systemd-cat -t gaypanel gaypanel
|
||||
restart 'bin/swaybg ' ${lib.getExe pkgs.swaybg} -i ${../../../background.jpg} -m fill
|
||||
restart 'bin/swayosd-server ' ${lib.getExe' pkgs.swayosd "swayosd-server"} --style ${osd-style}
|
||||
restart 'bin/swaync ' ${lib.getExe' swaync "swaync"} --style ${swaync-style} --config ${swaync-config}
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [ inputs.fht-compositor.nixosModules.default ];
|
||||
|
||||
environment.systemPackages = [ session-programs ];
|
||||
|
||||
# Prefer the GNOME portal (e.g. Nautilus as the file picker), falling back to GTK. This replaces
|
||||
# the portal config fht-compositor ships.
|
||||
xdg.portal.config.fht-compositor = {
|
||||
|
|
@ -133,13 +127,20 @@ in
|
|||
"org.freedesktop.impl.portal.ScreenCast" = [ "fht-compositor" ];
|
||||
};
|
||||
|
||||
environment = {
|
||||
systemPackages = [ session-programs ];
|
||||
etc = {
|
||||
"xdg/walker/config.toml".source = (pkgs.formats.toml { }).generate "walker.toml" {
|
||||
# Take keyboard focus when opened, so you can type into the search straight away
|
||||
environment.etc."xdg/walker/config.toml".source = (pkgs.formats.toml { }).generate "walker.toml" {
|
||||
force_keyboard_focus = true;
|
||||
theme = "system";
|
||||
};
|
||||
|
||||
environment.etc = {
|
||||
# The default theme, minus its hardcoded @define-color palette, so the GTK theme's colors show through
|
||||
"xdg/walker/themes/system/style.css".source = pkgs.runCommand "walker-system-style.css" { } ''
|
||||
sed '/^@define-color/d' ${pkgs.walker.src}/resources/themes/default/style.css > $out
|
||||
'';
|
||||
|
||||
# Only load the providers Walker uses
|
||||
"xdg/elephant/elephant.toml".source = (pkgs.formats.toml { }).generate "elephant.toml" {
|
||||
terminal_cmd = "ptyxis -x";
|
||||
|
|
@ -185,16 +186,9 @@ in
|
|||
// lib.optionalAttrs (engine ? Alias) { prefix = "${engine.Alias} "; }
|
||||
) SearchEngines.Add;
|
||||
};
|
||||
};
|
||||
|
||||
# The default theme, minus its hardcoded @define-color palette, so the GTK theme's colors show through
|
||||
environment.etc."xdg/walker/themes/system/style.css".source =
|
||||
pkgs.runCommand "walker-system-style.css" { }
|
||||
''
|
||||
sed '/^@define-color/d' ${pkgs.walker.src}/resources/themes/default/style.css > $out
|
||||
'';
|
||||
|
||||
environment.etc.${filename}.source = (pkgs.formats.toml { }).generate "config.toml" {
|
||||
# FHT config
|
||||
${filename}.source = (pkgs.formats.toml { }).generate "config.toml" {
|
||||
autostart = [ "session-programs" ];
|
||||
|
||||
general = {
|
||||
|
|
@ -333,6 +327,8 @@ in
|
|||
size = 24;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.fht-compositor = {
|
||||
enable = true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue