Add current hummelberg-new state
This commit is contained in:
parent
dd204c8ba6
commit
51f5e7eab9
30 changed files with 1486 additions and 0 deletions
261
defaults/user-configuration/fhauser/sway.nix
Normal file
261
defaults/user-configuration/fhauser/sway.nix
Normal file
|
@ -0,0 +1,261 @@
|
|||
{ pkgs, lib, config, ... }: {
|
||||
|
||||
# environment.systemPackages = with pkgs; [ polkit_gnome ]; #TODO: Needed?
|
||||
programs.sway.enable = true;
|
||||
services.gnome3.gnome-remote-desktop.enable = true;
|
||||
environment.systemPackages = with pkgs; [ pipewire_0_2 ];
|
||||
home-manager.users.fhauser = let
|
||||
adhereTheSwayTarget = {
|
||||
Install.WantedBy = lib.mkForce [ "sway-session.target" ];
|
||||
Unit.PartOf = lib.mkForce [ "sway-session.target" ];
|
||||
};
|
||||
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 -m $active_screen --list 20 --ignorecase --prompt 'Start: ' | \
|
||||
xargs swaymsg exec --
|
||||
'';
|
||||
in rec {
|
||||
home.packages = with pkgs; [
|
||||
sway-contrib.grimshot
|
||||
wl-clipboard
|
||||
libappindicator
|
||||
gnome3.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 _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;
|
||||
'';
|
||||
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;
|
||||
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 pactl set-sink-volume '@DEFAULT_SINK@' '-3%'";
|
||||
XF86AudioRaiseVolume =
|
||||
"exec pactl set-sink-volume '@DEFAULT_SINK@' '+3%'";
|
||||
XF86AudioMute = "exec pactl set-sink-mute '@DEFAULT_SINK@' 'toggle'";
|
||||
XF86AudioMicMute =
|
||||
"exec pactl set-source-mute '@DEFAULT_SOURCE@' 'toggle'";
|
||||
|
||||
# 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
|
||||
'';
|
||||
};
|
||||
|
||||
services.kanshi = {
|
||||
enable = true;
|
||||
profiles = let
|
||||
backgroundPicturePath = "~/pictures/backgrounds";
|
||||
mkScreen = (screen: {
|
||||
criteria = screen;
|
||||
status = "enable";
|
||||
scale = 1.0;
|
||||
});
|
||||
in rec {
|
||||
#mobile.exec = ''
|
||||
# swaymsg "output * bg `find ${backgroundPicturePath} -type f | shuf -n 1` fill"'';
|
||||
mobile.outputs = [
|
||||
(mkScreen "Unknown 0x08CE 0x00000000" // {
|
||||
position = "0,0";
|
||||
scale = 2.0;
|
||||
})
|
||||
];
|
||||
#home-dock.exec = mobile.exec;
|
||||
home-dock.outputs = [
|
||||
(mkScreen "Unknown 0x08CE 0x00000000" // {
|
||||
status = "enable";
|
||||
scale = 2.0;
|
||||
position = "0,0";
|
||||
})
|
||||
(mkScreen "Dell Inc. DELL P2720DC 22JPK53" // {
|
||||
position = "1920,0";
|
||||
scale = 1.0;
|
||||
status = "enable";
|
||||
})
|
||||
#(mkScreen "Dell Inc. DELL P2720DC 6JRRK53" // {
|
||||
# position = "2560,0";
|
||||
# #position = "4480,0";
|
||||
# scale = 1.0;
|
||||
# status = "enable";
|
||||
#})
|
||||
];
|
||||
#chur-dock.outputs = [
|
||||
# (mkScreen "Unknown 0x08CE 0x00000000" // {
|
||||
# position = "0,0";
|
||||
# scale = 2.0;
|
||||
# })
|
||||
# (mkScreen "Dell Inc. DELL P2720DC 22JPK53" // {
|
||||
# position = "1920,0";
|
||||
# })
|
||||
#];
|
||||
#office-dock.exec = mobile.exec;
|
||||
office-dock.outputs = [
|
||||
(mkScreen "Unknown 0x08CE 0x00000000" // {
|
||||
position = "0,0";
|
||||
scale = 2.0;
|
||||
})
|
||||
(mkScreen "Dell Inc. DELL P2720DC BRKPK53" // {
|
||||
position = "1920,0";
|
||||
})
|
||||
(mkScreen "Dell Inc. DELL P2720DC 22JPK53" // {
|
||||
position = "4480,0";
|
||||
})
|
||||
];
|
||||
};
|
||||
};
|
||||
# TODO: Move these services elsewhere
|
||||
services.network-manager-applet.enable = true;
|
||||
systemd.user.services.network-manager-applet = adhereTheSwayTarget;
|
||||
services.nextcloud-client.enable = true;
|
||||
systemd.user.services.nextcloud-client = adhereTheSwayTarget // {
|
||||
Service.ExecStart =
|
||||
lib.mkForce "${pkgs.nextcloud-client}/bin/nextcloud --background";
|
||||
Unit.After = [ "waybar.service" ]; # For trayicon to work
|
||||
}; # TODO: Test and upstream
|
||||
services.owncloud-client.enable = true;
|
||||
systemd.user.services.owncloud-client = adhereTheSwayTarget // {
|
||||
Unit.After = [ "waybar.service" ]; # For trayicon to work
|
||||
};
|
||||
services.pasystray.enable = true;
|
||||
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; };
|
||||
|
||||
xdg.mimeApps = {
|
||||
enable = true;
|
||||
defaultApplications = let
|
||||
browser = [ "firefox.desktop" ];
|
||||
email = [ "org.gnome.Evolution.desktop" ];
|
||||
doc-editor = [ "writer.desktop" ];
|
||||
sheet-editor = [ "calc.desktop" ];
|
||||
presentation-editor = [ "impress.desktop" ];
|
||||
pdf = [ "org.gnome.Evince.desktop " ];
|
||||
image = [ "geeqie.desktop" ];
|
||||
image-vector = [ "org.inkscape.Inkscape.desktop" ];
|
||||
ebooks = [ "calibre-ebook-viewer.desktop" ];
|
||||
code-general = [ "codium.desktop" ];
|
||||
video = [ "vlc.desktop" ];
|
||||
in {
|
||||
"text/html" = browser;
|
||||
"x-scheme-handler/http" = browser;
|
||||
"x-scheme-handler/https" = browser;
|
||||
"x-scheme-handler/mailto" = email;
|
||||
"x-scheme-handler/msteams" = [ "teams.desktop" ];
|
||||
|
||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" =
|
||||
doc-editor;
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" =
|
||||
sheet-editor;
|
||||
"application/vnd.openxmlformats-officedocument.presentationml.presentation" =
|
||||
presentation-editor;
|
||||
"application/vnd.oasis.opendocument.presentation" = presentation-editor;
|
||||
"application/pdf" = pdf;
|
||||
"application/epub+zip" = ebooks;
|
||||
|
||||
"text/plain" = code-general;
|
||||
"application/json" = code-general;
|
||||
"text/markdown" = code-general;
|
||||
|
||||
"image/png" = image;
|
||||
"image/jpg" = image;
|
||||
"image/jpeg" = image;
|
||||
"image/x-tga" = image;
|
||||
"image/tiff" = image;
|
||||
"image/x-canon-cr2" = image;
|
||||
"image/svg+xml" = image-vector;
|
||||
|
||||
"video/mp4" = video;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue