179 lines
6.8 KiB
Nix
179 lines
6.8 KiB
Nix
{ pkgs, lib, config, ... }: {
|
|
|
|
# environment.systemPackages = with pkgs; [ polkit_gnome ]; #TODO: Needed?
|
|
programs.sway.enable = true;
|
|
xdg.portal.wlr.enable = true;
|
|
|
|
services.gnome.gnome-remote-desktop.enable = true;
|
|
#environment.systemPackages = with pkgs; [ pipewire ];
|
|
#systemd.user.services.pipewire.environment.XDG_CURRENT_DESKTOP = "sway";
|
|
#systemd.user.services.xdg-desktop-portal-wlr.environment.XDG_CURRENT_DESKTOP =
|
|
# "sway";
|
|
# systemd.user.services.xdg-desktop-portal-wlr.script = "${pkgs.xdg-desktop-portal-wlr}/libexec/xdg-desktop-portal-wlr";
|
|
# systemd.user.services.xdg-desktop-portal-wlr.scriptArgs = "--output=DP-1"; # TODO: Extract this *****
|
|
home-manager.users.fhauser = let
|
|
adhereTheSwayTarget = {
|
|
Install.WantedBy = lib.mkForce [ "sway-session.target" ];
|
|
Unit.PartOf = lib.mkForce [ "sway-session.target" ];
|
|
};
|
|
# TODO: active screen with -m $active_screen
|
|
bemenuLauncher = pkgs.writeScriptBin "bemenuLauncher" ''
|
|
#!${pkgs.stdenv.shell}
|
|
#active_screen=$(swaymsg -r -t get_outputs | \
|
|
# ${pkgs.jq}/bin/jq '. [] | select (.focused == true) | .name | split ("-") | last')
|
|
${pkgs.dmenu}/bin/dmenu_path | \
|
|
${pkgs.bemenu}/bin/bemenu --list 20 --ignorecase --prompt 'Start: ' | \
|
|
xargs swaymsg exec --
|
|
'';
|
|
homeManagerConfig = config.home-manager.users.fhauser;
|
|
in rec {
|
|
home.packages = with pkgs; [
|
|
sway-contrib.grimshot
|
|
wl-clipboard
|
|
libappindicator
|
|
gnome.defaultIconTheme
|
|
gnome2.gnome-icon-theme
|
|
hicolor-icon-theme # TODO: Move these requirements?
|
|
];
|
|
|
|
xsession.preferStatusNotifierItems = true;
|
|
|
|
wayland.windowManager.sway = {
|
|
enable = true;
|
|
systemdIntegration = true;
|
|
xwayland = true;
|
|
wrapperFeatures = { gtk = true; };
|
|
extraSessionCommands = ''
|
|
#export XDG_CURRENT_DESKTOP=Unity
|
|
export XDG_CURRENT_DESKTOP=sway
|
|
export XDG_SESSION_TYPE="wayland"
|
|
export _JAVA_AWT_WM_NONREPARENTING=1
|
|
export SSH_AUTH_SOCK=/run/user/1000/gnupg/S.gpg-agent.ssh # TODO: Migrate
|
|
export QT_QPA_PLATFORM=wayland
|
|
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
|
|
# TODO: QTpie
|
|
export WLR_DRM_NO_MODIFIERS=1
|
|
export WLR_NO_HARDWARE_CURSORS=1
|
|
'';
|
|
config = {
|
|
input = {
|
|
"type:keyboard" = {
|
|
xkb_layout = "ch,de";
|
|
xkb_options = "eurosign:e";
|
|
};
|
|
"*" = { xkb_numlock = "enable"; };
|
|
};
|
|
terminal = "${pkgs.alacritty}/bin/alacritty";
|
|
menu = "${bemenuLauncher}/bin/bemenuLauncher";
|
|
gaps.inner = 8;
|
|
modifier = "Mod4";
|
|
window.border = 0;
|
|
#colors.focused.border = "#323232";
|
|
|
|
#TODO: Workspace Programm assignment: Not working properly
|
|
assigns = {
|
|
"10" = [{ app_id = "^firefox$"; }];
|
|
"11" = [{ app_id = "^(claws-mail|thunderbird|evolution)$"; }];
|
|
"12" = [{
|
|
class = "^Chromium-browser$";
|
|
instance = "^web.threema.ch";
|
|
}];
|
|
"13" = [{ class = "^Spotify$"; }];
|
|
};
|
|
|
|
keybindings = let
|
|
mod = wayland.windowManager.sway.config.modifier;
|
|
playerctl = "${pkgs.playerctl}/bin/playerctl";
|
|
pamixer = "${pkgs.pamixer}/bin/pamixer";
|
|
light = "${pkgs.light}/bin/light";
|
|
in lib.mkOptionDefault {
|
|
"${mod}+p" = "exec passbemenu";
|
|
"${mod}+x" = "move workspace to output right";
|
|
"${mod}+y" = "move workspace to output left";
|
|
|
|
"${mod}+section" = "workspace 0";
|
|
"${mod}+0" = "workspace 10";
|
|
"${mod}+apostrophe" = "workspace 11";
|
|
"${mod}+dead_circumflex" = "workspace 12";
|
|
"${mod}+dead_diaeresis" = "workspace 13";
|
|
"${mod}+dollar" = "workspace 14";
|
|
|
|
"${mod}+Shift+section" = "move container to workspace 0";
|
|
"${mod}+Shift+0" = "move container to workspace 10";
|
|
"${mod}+Shift+apostrophe" = "move container to workspace 11";
|
|
"${mod}+Shift+dead_circumflex" = "move container to workspace 12";
|
|
"${mod}+Shift+dead_diaeresis" = "move container to workspace 13";
|
|
"${mod}+Shift+dollar" = "move container to workspace 14";
|
|
|
|
"Ctrl+mod1+l" = "exec ${pkgs.systemd}/bin/loginctl lock-session";
|
|
"Ctrl+mod1+Shift+L" = "exec ${pkgs.systemd}/bin/systemctl suspend";
|
|
|
|
# pulse audio volume control
|
|
XF86AudioLowerVolume = "exec ${pamixer} --decrease 3";
|
|
XF86AudioRaiseVolume = "exec ${pamixer} --increase 3";
|
|
XF86AudioMute = "exec ${pamixer} --toggle-mute";
|
|
XF86AudioMicMute = "exec ${pamixer} --default-source --toggle-mute";
|
|
|
|
# Spotify control
|
|
XF86AudioPause = "exec ${playerctl} play-pause";
|
|
XF86AudioPlay = "exec ${playerctl} play-pause";
|
|
XF86AudioNext = "exec ${playerctl} next";
|
|
XF86AudioPrev = "exec ${playerctl} previous";
|
|
|
|
# screen brightness
|
|
XF86MonBrightnessUp = "exec ${light} -A 10";
|
|
XF86MonBrightnessDown = "exec ${light} -U 5";
|
|
|
|
# screenshot
|
|
Print = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy area";
|
|
};
|
|
};
|
|
extraConfig = ''
|
|
# Disable the laptop screen when the lid is closed.
|
|
bindswitch --reload lid:on output eDP-1 disable
|
|
bindswitch --reload lid:off output eDP-1 enable
|
|
'';
|
|
};
|
|
|
|
# TODO: Move these services elsewhere
|
|
services.network-manager-applet.enable = true;
|
|
services.nextcloud-client.enable = true;
|
|
services.owncloud-client.enable = true;
|
|
services.pasystray.enable = true;
|
|
|
|
systemd.user.services.network-manager-applet = adhereTheSwayTarget;
|
|
systemd.user.services.nextcloud-client = adhereTheSwayTarget // {
|
|
# For trayicon to work:
|
|
Unit.After = [ "waybar.service" ];
|
|
Service = {
|
|
ExecStart =
|
|
lib.mkForce "${pkgs.nextcloud-client}/bin/nextcloud --background";
|
|
ExecStartPre = "${pkgs.coreutils}/bin/sleep 3";
|
|
Environment = lib.mkForce
|
|
"PATH=${homeManagerConfig.home.profileDirectory}/bin XDG_CURRENT_DESKTOP=Unity";
|
|
};
|
|
};
|
|
systemd.user.services.owncloud-client = adhereTheSwayTarget // {
|
|
# For trayicon to work:
|
|
Unit.After = [ "waybar.service" ];
|
|
Service = {
|
|
ExecStartPre = "${pkgs.coreutils}/bin/sleep 3";
|
|
Environment = lib.mkForce
|
|
"PATH=${homeManagerConfig.home.profileDirectory}/bin XDG_CURRENT_DESKTOP=Unity";
|
|
};
|
|
};
|
|
systemd.user.services.pasystray = adhereTheSwayTarget;
|
|
|
|
gtk = {
|
|
iconTheme = {
|
|
# package = pkgs.gnome-icon-theme;
|
|
# name = "gnome";
|
|
package = pkgs.hicolor_icon_theme;
|
|
name = "hicolor";
|
|
};
|
|
gtk3.extraConfig.gtk-menu-images = true;
|
|
};
|
|
|
|
dconf.settings = { "org/gnome/desktop/interface".menus-have-icons = true; };
|
|
};
|
|
}
|