Set up waybar and building ISOs.
This commit is contained in:
@@ -44,6 +44,8 @@ let
|
||||
include ${disable-focus-follows-mouse}
|
||||
include ${background}
|
||||
include ${touchpad_input}
|
||||
include ${waybar}
|
||||
include ${announce_sway_start}
|
||||
'';
|
||||
};
|
||||
base-hotkeys = pkgs.writeTextFile {
|
||||
@@ -229,6 +231,36 @@ let
|
||||
}
|
||||
'';
|
||||
};
|
||||
waybar = pkgs.writeTextFile {
|
||||
name = "waybar.conf";
|
||||
text = ''
|
||||
#
|
||||
# Status Bar:
|
||||
#
|
||||
# Read `man 5 sway-bar` for more information about this section.
|
||||
bar {
|
||||
position top
|
||||
|
||||
font pango:Cascadia Mono, FontAwesome 10
|
||||
swaybar_command waybar
|
||||
|
||||
colors {
|
||||
statusline #ffffff
|
||||
background #323232
|
||||
inactive_workspace #32323200 #32323200 #5c5c5c
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
announce_sway_start = pkgs.writeTextFile {
|
||||
name = "announce_sway_start.conf";
|
||||
text = ''
|
||||
# announce a running sway session to systemd
|
||||
exec systemctl --user import-environment XDG_SESSION_TYPE XDG_CURRENT_DESKTOP
|
||||
exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
|
||||
'';
|
||||
};
|
||||
|
||||
start_screen_share = pkgs.writeShellScriptBin "start_screen_share" ''
|
||||
# Disable displaying notifications. This is useful for video conference screen sharing.
|
||||
set -euo pipefail
|
||||
@@ -261,23 +293,37 @@ in
|
||||
stop_screen_share
|
||||
];
|
||||
|
||||
environment.sessionVariables = {
|
||||
# WLR_RENDERER_ALLOW_SOFTWARE = "1";
|
||||
WLR_RENDERER = "vulkan";
|
||||
};
|
||||
# Probably would be cleaner to use environment.sessionVariables but programs.sway.extraSessionCommands is sway-specific.
|
||||
programs.sway.extraSessionCommands =
|
||||
if config.me.buildingIso then
|
||||
''
|
||||
export WLR_RENDERER_ALLOW_SOFTWARE=1;
|
||||
''
|
||||
else
|
||||
''
|
||||
export WLR_RENDERER=vulkan
|
||||
'';
|
||||
|
||||
programs.sway = {
|
||||
enable = true;
|
||||
wrapperFeatures.gtk = true;
|
||||
extraOptions = [
|
||||
"--debug"
|
||||
"--config"
|
||||
"${sway-config}"
|
||||
# "--unsupported-gpu"
|
||||
];
|
||||
extraOptions =
|
||||
if config.me.buildingIso then
|
||||
[
|
||||
"--debug"
|
||||
"--config"
|
||||
"${sway-config}"
|
||||
"--unsupported-gpu"
|
||||
]
|
||||
else
|
||||
[
|
||||
"--debug"
|
||||
"--config"
|
||||
"${sway-config}"
|
||||
];
|
||||
};
|
||||
|
||||
environment.persistence."/state" = {
|
||||
environment.persistence."/state" = lib.mkIf (!config.me.buildingIso) {
|
||||
hideMounts = true;
|
||||
users.talexander = {
|
||||
files = [
|
||||
@@ -293,6 +339,20 @@ in
|
||||
xdg-desktop-portal-wlr
|
||||
xdg-desktop-portal-gtk
|
||||
];
|
||||
wlr = {
|
||||
enable = true;
|
||||
settings = {
|
||||
# uninteresting for this problem, for completeness only
|
||||
screencast = {
|
||||
# output_name = "eDP-1";
|
||||
max_fps = 30;
|
||||
exec_before = "${start_screen_share}";
|
||||
exec_after = "${stop_screen_share}";
|
||||
chooser_type = "simple";
|
||||
chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -or";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user