2020-06-17 19:01:57 +02:00
|
|
|
{ pkgs, config, lib, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.profiles.xsession;
|
2022-04-24 00:23:16 +02:00
|
|
|
non-nixos = config.profiles.non-nixos;
|
2022-09-09 02:49:19 +02:00
|
|
|
mkGL = program: "${lib.strings.optionalString non-nixos.enable "${pkgs.nixgl.auto.nixGLDefault}/bin/nixGL "}${program}";
|
2023-01-16 11:09:00 +01:00
|
|
|
execScope = program: "exec bash -c \"systemd-run --user --scope --unit='app-i3-exec-$RANDOM' -p CollectMode=inactive-or-failed -p MemoryHigh=85% -p MemoryMax=92% -p MemorySwapMax=5G -p MemoryAccounting=true \"${program}\"\"";
|
2020-06-17 19:01:57 +02:00
|
|
|
in
|
|
|
|
{
|
2022-04-24 18:37:29 +02:00
|
|
|
imports = [ ./dunstrc.nix ./terminal.nix ./polybar.nix ];
|
2020-06-17 19:01:57 +02:00
|
|
|
|
|
|
|
options.profiles.xsession = {
|
|
|
|
enable = lib.mkEnableOption "Whether or not to control the xsession";
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
2020-07-11 04:08:58 +02:00
|
|
|
profiles.gui.enable = true;
|
|
|
|
|
2023-01-16 11:09:00 +01:00
|
|
|
systemd.user.slices.app.Slice = {
|
|
|
|
MemoryHigh="90%";
|
|
|
|
MemoryMax="94%";
|
|
|
|
MemorySwapMax="8G";
|
|
|
|
CPUQuota="${toString ((config.machine.cores - 1)*100)}%";
|
|
|
|
MemoryAccounting = true;
|
|
|
|
};
|
|
|
|
|
2020-06-17 19:01:57 +02:00
|
|
|
home.keyboard = {
|
2021-12-23 05:24:59 +01:00
|
|
|
layout = "no";
|
2022-06-05 15:46:48 +02:00
|
|
|
variant = "nodeadkeys";
|
2020-06-17 19:01:57 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
services.random-background = {
|
2022-04-24 00:23:16 +02:00
|
|
|
enable = false;
|
2020-07-11 03:02:33 +02:00
|
|
|
imageDirectory = "${pkgs.dan.wallpapers}";
|
2020-06-17 19:01:57 +02:00
|
|
|
interval = "30m";
|
|
|
|
};
|
|
|
|
|
2020-12-21 19:17:54 +01:00
|
|
|
services.dunst.enable = false;
|
2020-12-20 23:08:45 +01:00
|
|
|
|
2020-06-17 19:01:57 +02:00
|
|
|
xsession = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
|
|
|
|
initExtra = ''
|
|
|
|
export PATH="$HOME/.config/nixpkgs/nix-dotfiles/bin:$PATH"
|
|
|
|
|
|
|
|
export XDG_CURRENT_DESKTOP=kde
|
|
|
|
export DESKTOP_SESSION=kde
|
|
|
|
'';
|
|
|
|
|
|
|
|
windowManager = {
|
|
|
|
i3.enable = true;
|
|
|
|
i3.config = {
|
|
|
|
modifier = "Mod4";
|
2022-09-09 02:49:19 +02:00
|
|
|
terminal = "${pkgs.kitty}/bin/kitty";
|
2021-11-11 05:39:46 +01:00
|
|
|
keybindings = let
|
|
|
|
modifier = config.xsession.windowManager.i3.config.modifier;
|
2023-01-16 06:58:47 +01:00
|
|
|
dmenu = if config.machine.systemd then "${../../scripts/dmenu_run_systemd}" else "dmenu_run";
|
2020-06-17 19:01:57 +02:00
|
|
|
in lib.mkOptionDefault {
|
|
|
|
"${modifier}+0" = "workspace 10";
|
|
|
|
"${modifier}+Shift+0" = "move container to workspace 10";
|
|
|
|
|
|
|
|
"${modifier}+Tab" = "workspace next";
|
|
|
|
"${modifier}+Shift+Tab" = "workspace prev";
|
|
|
|
|
2021-06-04 12:42:58 +02:00
|
|
|
"XF86AudioRaiseVolume" = "exec --no-startup-id ${pkgs.pulseaudio}/bin/pactl set-sink-volume 0 +5%";
|
|
|
|
"XF86AudioLowerVolume" = "exec --no-startup-id ${pkgs.pulseaudio}/bin/pactl set-sink-volume 0 -5%";
|
|
|
|
"XF86AudioMute" = "exec --no-startup-id ${pkgs.pulseaudio}/bin/pactl set-sink-mute 0 toggle";
|
|
|
|
"XF86AudioMicMute" = "exec --no-startup-id ${pkgs.pulseaudio}/bin/pactl set-source-mute 1 toggle";
|
2020-06-17 19:01:57 +02:00
|
|
|
|
2024-05-26 00:49:00 +02:00
|
|
|
# Georg volume controls
|
|
|
|
"Shift+XF86AudioRaiseVolume" = "exec --no-startup-id ${lib.getExe pkgs.gregctl} set-volume -- +5%";
|
|
|
|
"Shift+XF86AudioLowerVolume" = "exec --no-startup-id ${lib.getExe pkgs.gregctl} set-volume -- -5%";
|
|
|
|
"Shift+XF86AudioMute" = "exec --no-startup-id ${lib.getExe pkgs.gregctl} toggle";
|
|
|
|
|
2020-06-17 19:01:57 +02:00
|
|
|
"XF86MonBrightnessUp" = "exec --no-startup-id brightnessctl set +5%";
|
|
|
|
"XF86MonBrightnessDown" = "exec --no-startup-id brightnessctl set 5%-";
|
|
|
|
|
|
|
|
"Print" = "exec scrot %Y-%m-%d_$wx$h_scrot.png -z -e 'mv $f /home/daniel/Pictures/screenshots/'";
|
|
|
|
"${modifier}+Print" = "exec scrot /home/daniel/Pictures/Screenshots/%Y-%m-%d_$wx$h_scrot.png -z";
|
|
|
|
|
2023-04-27 13:36:59 +02:00
|
|
|
"${modifier}+l" = "exec ${pkgs.writers.writeBash "hello_world" ''
|
|
|
|
dunstctl set-paused true
|
|
|
|
${pkgs.i3lock}/bin/i3lock -n -i ~/images/wallpapers/locked.png
|
|
|
|
dunstctl set-paused false
|
|
|
|
''}";
|
|
|
|
|
2023-01-16 06:58:47 +01:00
|
|
|
"XF86Display" = "exec arandr";
|
2020-06-17 19:01:57 +02:00
|
|
|
|
2023-01-16 06:58:47 +01:00
|
|
|
"${modifier}+Shift+U" = "exec $HOME/.config/nixpkgs/nix-dotfiles/scripts/dmenuunicode";
|
2021-11-11 05:39:46 +01:00
|
|
|
"${modifier}+Shift+s" = "exec $HOME/.config/nixpkgs/nix-dotfiles/scripts/dmenuaudio";
|
2023-09-24 18:19:16 +02:00
|
|
|
"${modifier}+Shift+v" = "exec ${pkgs.writers.writeBash "switch_audio" ''
|
|
|
|
if pw-link -l | grep "^VirtualMic:input_FL" -A 2 | grep FilteredMic; then
|
|
|
|
${pkgs.pipewire}/bin/pw-link -d "FilteredMic:capture_MONO" "VirtualMic:input_FL"
|
|
|
|
${pkgs.pipewire}/bin/pw-link -d "FilteredMic:capture_MONO" "VirtualMic:input_FR"
|
|
|
|
${pkgs.pipewire}/bin/pw-link "VoiceChanger:monitor_FL" "VirtualMic:input_FL"
|
|
|
|
${pkgs.pipewire}/bin/pw-link "VoiceChanger:monitor_FR" "VirtualMic:input_FR"
|
|
|
|
${pkgs.pipewire}/bin/pw-link "VoiceChanger:monitor_FL" "VirtualHeadset:playback_FL"
|
|
|
|
${pkgs.pipewire}/bin/pw-link "VoiceChanger:monitor_FR" "VirtualHeadset:playback_FR"
|
|
|
|
else
|
|
|
|
${pkgs.pipewire}/bin/pw-link "FilteredMic:capture_MONO" "VirtualMic:input_FL"
|
|
|
|
${pkgs.pipewire}/bin/pw-link "FilteredMic:capture_MONO" "VirtualMic:input_FR"
|
|
|
|
${pkgs.pipewire}/bin/pw-link -d "VoiceChanger:monitor_FL" "VirtualMic:input_FL"
|
|
|
|
${pkgs.pipewire}/bin/pw-link -d "VoiceChanger:monitor_FR" "VirtualMic:input_FR"
|
|
|
|
${pkgs.pipewire}/bin/pw-link -d "VoiceChanger:monitor_FL" "VirtualHeadset:playback_FL"
|
|
|
|
${pkgs.pipewire}/bin/pw-link -d "VoiceChanger:monitor_FR" "VirtualHeadset:playback_FR"
|
|
|
|
fi
|
|
|
|
''}";
|
2021-11-11 05:39:46 +01:00
|
|
|
|
2023-01-16 06:58:47 +01:00
|
|
|
"${modifier}+d" = "exec ${dmenu}";
|
|
|
|
|
|
|
|
"${modifier}+n" = execScope "dolphin";
|
|
|
|
"${modifier}+b" = execScope "firefox";
|
|
|
|
"${modifier}+t" = execScope "gedit";
|
|
|
|
|
|
|
|
"${modifier}+Return" = execScope "kitty";
|
|
|
|
"${modifier}+Shift+Return" = execScope "kitty -e ssh dandellion@lilith";
|
2020-06-17 19:01:57 +02:00
|
|
|
};
|
2021-06-12 01:35:59 +02:00
|
|
|
startup = [
|
|
|
|
{
|
|
|
|
command = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
|
|
|
|
always = false;
|
|
|
|
#notification = false;
|
|
|
|
}
|
|
|
|
];
|
2020-06-17 19:01:57 +02:00
|
|
|
window = {
|
|
|
|
titlebar = false;
|
|
|
|
hideEdgeBorders = "smart";
|
|
|
|
};
|
2023-11-04 23:28:47 +01:00
|
|
|
floating.criteria = [
|
|
|
|
{ title = "Steam - Update News"; }
|
|
|
|
];
|
2020-06-17 19:01:57 +02:00
|
|
|
};
|
2023-11-04 23:28:47 +01:00
|
|
|
i3.extraConfig = ''
|
|
|
|
for_window [title="Steam Big Picture Mode"] floating enable, resize set 1920 1080, move position 0 0, border pixel 0
|
|
|
|
'';
|
2020-06-17 19:01:57 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services.picom = {
|
|
|
|
enable = true;
|
|
|
|
backend = "xrender";
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
gtk = {
|
2023-11-30 10:16:03 +01:00
|
|
|
enable = true;
|
2020-06-17 19:01:57 +02:00
|
|
|
theme = {
|
|
|
|
package = pkgs.breeze-gtk;
|
|
|
|
name = "Breeze";
|
|
|
|
};
|
|
|
|
iconTheme = {
|
|
|
|
package = pkgs.breeze-icons;
|
|
|
|
name = "breeze";
|
|
|
|
};
|
|
|
|
};
|
2024-03-20 11:02:33 +01:00
|
|
|
# qt = {
|
|
|
|
# enable = true;
|
|
|
|
# platformTheme = "gtk";
|
|
|
|
# };
|
2020-06-17 19:01:57 +02:00
|
|
|
|
2022-09-09 02:49:19 +02:00
|
|
|
xsession.windowManager.command = lib.mkIf non-nixos.enable (lib.mkForce "${pkgs.nixgl.auto.nixGLDefault}/bin/nixGL ${config.xsession.windowManager.i3.package}/bin/i3");
|
2022-04-24 00:23:16 +02:00
|
|
|
|
2020-06-17 19:01:57 +02:00
|
|
|
home.packages = [
|
|
|
|
pkgs.brightnessctl
|
|
|
|
pkgs.xorg.xkill
|
|
|
|
pkgs.arandr
|
|
|
|
|
|
|
|
pkgs.dunst
|
|
|
|
pkgs.libnotify
|
|
|
|
|
|
|
|
pkgs.dmenu
|
|
|
|
|
|
|
|
pkgs.scrot
|
|
|
|
pkgs.neofetch
|
2021-04-12 01:41:56 +02:00
|
|
|
#pkgs.dan.colors
|
2020-06-17 19:01:57 +02:00
|
|
|
pkgs.xclip
|
|
|
|
|
|
|
|
pkgs.dejavu_fonts
|
|
|
|
|
|
|
|
pkgs.source-code-pro
|
|
|
|
|
|
|
|
pkgs.breeze-qt5
|
|
|
|
pkgs.breeze-icons
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|