Autologin

This commit is contained in:
2023-02-16 00:44:56 +09:00
parent be201cd2f5
commit eb53b5d861
6 changed files with 61 additions and 16 deletions
+5 -1
View File
@@ -34,7 +34,11 @@
(import ./pkgs) (import ./pkgs)
]; ];
}; };
inputs = rawInput // {inherit nixpkgs;}; inputs =
rawInput
// {
inherit nixpkgs user;
};
in in
rawInput.nixpkgs.lib.nixosSystem { rawInput.nixpkgs.lib.nixosSystem {
inherit system; inherit system;
+19 -1
View File
@@ -2,6 +2,7 @@
pkgs, pkgs,
lib, lib,
config, config,
user,
... ...
}: let }: let
cfg = config.modules.hyprland; cfg = config.modules.hyprland;
@@ -10,7 +11,10 @@ in {
config = config =
lib.mkIf cfg.enable lib.mkIf cfg.enable
{ {
home.packages = with pkgs; [nur.repos.ocfox.swww]; home.packages = with pkgs; [
nur.repos.ocfox.swww
xorg.xprop
];
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
enable = true; enable = true;
systemdIntegration = true; systemdIntegration = true;
@@ -27,6 +31,20 @@ in {
source = ./wallpaper.sh; source = ./wallpaper.sh;
executable = true; executable = true;
}; };
home.file.".config/startWayland.sh" = {
source = ./start.sh;
executable = true;
};
home.pointerCursor = {
name = "Adwaita";
package = pkgs.gnome.adwaita-icon-theme;
size = 16;
x11 = {
enable = true;
defaultCursor = "Adwaita";
};
};
# TODO: zsh alias for wp # TODO: zsh alias for wp
}; };
+15 -14
View File
@@ -1,6 +1,7 @@
exec-once=xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2
exec-once=discord
exec-once=eww open bar exec-once=eww open bar
exec-once=swww init exec-once=/home/zoriya/.config/hypr/wallpaper.sh init
exec-once=~/.config/hypr/wallpaper.sh
autogenerated = 0 autogenerated = 0
@@ -84,9 +85,9 @@ gestures {
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
windowrulev2=workspace 5,class:^(discord)$ windowrulev2=workspace 5 silent,class:^(discord)$
windowrulev2=float,title:^(Discord Updater)$ windowrulev2=float,title:^(Discord Updater)$
windowrulev2=workspace 5,title:^(Discord Updater)$ windowrulev2=workspace 5 silent,title:^(Discord Updater)$
windowrulev2=nofullscreenrequest,class:^(zoom)$ windowrulev2=nofullscreenrequest,class:^(zoom)$
windowrulev2=float,class:^(zoom)$ windowrulev2=float,class:^(zoom)$
@@ -139,16 +140,16 @@ bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10 bind = $mainMod, 0, workspace, 10
# Move active window to a workspace with mainMod + SHIFT + [0-9] # Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, 1, movetoworkspace, 1 bind = $mainMod SHIFT, 1, movetoworkspacesilent, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2 bind = $mainMod SHIFT, 2, movetoworkspacesilent, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3 bind = $mainMod SHIFT, 3, movetoworkspacesilent, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4 bind = $mainMod SHIFT, 4, movetoworkspacesilent, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5 bind = $mainMod SHIFT, 5, movetoworkspacesilent, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6 bind = $mainMod SHIFT, 6, movetoworkspacesilent, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7 bind = $mainMod SHIFT, 7, movetoworkspacesilent, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8 bind = $mainMod SHIFT, 8, movetoworkspacesilent, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9 bind = $mainMod SHIFT, 9, movetoworkspacesilent, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10 bind = $mainMod SHIFT, 0, movetoworkspacesilent, 10
# Move/resize windows with mainMod + LMB/RMB and dragging # Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:272, movewindow
+3
View File
@@ -0,0 +1,3 @@
export GDK_SCALE=2
export XCURSOR_SIZE=32
Hyprland
+2
View File
@@ -7,4 +7,6 @@ export SWWW_TRANSITION=grow
WP=$(find $WALLPAPERS -type f | shuf -n 1) WP=$(find $WALLPAPERS -type f | shuf -n 1)
ln -fs $WP ~/.cache/current-wallpaper ln -fs $WP ~/.cache/current-wallpaper
[[ "$1" = "init" ]] && swww init && sleep 1
swww img "$WP" swww img "$WP"
+17
View File
@@ -1,6 +1,8 @@
{ {
lib, lib,
config, config,
pkgs,
user,
... ...
}: let }: let
cfg = config.wayland; cfg = config.wayland;
@@ -16,5 +18,20 @@ in {
alsa.support32Bit = true; alsa.support32Bit = true;
pulse.enable = true; pulse.enable = true;
}; };
# Autostart hyprland and display lockscreen as greeter
# See https://github.com/NixOS/nixpkgs/issues/140304 for why this looks weird
services.getty = {
loginProgram = "${pkgs.bash}/bin/sh";
loginOptions = toString (pkgs.writeText "login-program.sh" ''
if [[ "$(tty)" == '/dev/tty1' ]]; then
${pkgs.shadow}/bin/login -f ${user};
~/.config/startWayland.sh
else
${pkgs.shadow}/bin/login;
fi
'');
extraArgs = ["--skip-login"];
};
}; };
} }