stable sddm

This commit is contained in:
sam 2024-05-11 13:49:12 +01:00
parent 73254cd0d3
commit f69ffa5f23
15 changed files with 530 additions and 71 deletions

185
.old/hyprland.conf Normal file
View File

@ -0,0 +1,185 @@
#
# Please note not all available settings / options are set here.
# For a full list, see the wiki
#
# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=,preferred,auto,auto
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
# Execute your favorite apps at launch
# exec-once = waybar & hyprpaper & firefox
# Source a file (multi-file configs)
# source = ~/.config/hypr/myColors.conf
# Set programs that you use
$terminal = kitty
$fileManager = dolphin
$menu = wofi --show drun
# Some default env vars.
env = XCURSOR_SIZE,24
env = QT_QPA_PLATFORMTHEME,qt5ct # change to qt6ct if you have that
# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
input {
kb_layout = gb
kb_variant =
kb_model =
kb_options = caps:swapescape
kb_rules =
follow_mouse = 1
touchpad {
natural_scroll = no
}
sensitivity = 0 # -1.0 to 1.0, 0 means no modification.
}
general {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
gaps_in = 5
gaps_out = 20
border_size = 2
col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
col.inactive_border = rgba(595959aa)
layout = dwindle
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
allow_tearing = false
}
decoration {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
rounding = 10
blur {
enabled = true
size = 3
passes = 1
}
drop_shadow = yes
shadow_range = 4
shadow_render_power = 3
col.shadow = rgba(1a1a1aee)
}
animations {
enabled = yes
# Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 7, myBezier
animation = windowsOut, 1, 7, default, popin 80%
animation = border, 1, 10, default
animation = borderangle, 1, 8, default
animation = fade, 1, 7, default
animation = workspaces, 1, 6, default
}
dwindle {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = yes # you probably want this
}
master {
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
new_is_master = true
}
gestures {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
workspace_swipe = off
}
misc {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
force_default_wallpaper = -1 # Set to 0 or 1 to disable the anime mascot wallpapers
}
# Example per-device config
# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more
device {
name = epic-mouse-v1
sensitivity = -0.5
}
# Example windowrule v1
# windowrule = float, ^(kitty)$
# Example windowrule v2
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
windowrulev2 = suppressevent maximize, class:.* # You'll probably like this.
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
$mainMod = SUPER
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod, Q, exec, $terminal
bind = $mainMod, C, killactive,
bind = $mainMod, M, exit,
bind = $mainMod, E, exec, $fileManager
bind = $mainMod, V, togglefloating,
bind = $mainMod, R, exec, $menu
bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, J, togglesplit, # dwindle
bind = $mainMod, S, exec, rofi -show drun -show-icons
# Move focus with mainMod + arrow keys
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d
# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10
# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10
# Example special workspace (scratchpad)
bind = $mainMod, S, togglespecialworkspace, magic
bind = $mainMod SHIFT, S, movetoworkspace, special:magic
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
# Autostart
exec-once=bash ~/.config/hypr/start.sh

View File

@ -1,30 +1,3 @@
#{
# description = "Nixos config flake";
#
# inputs = {
# nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
#
# home-manager = {
# url = "github:nix-community/home-manager";
# inputs.nixpkgs.follows = "nixpkgs";
# };
# };
#
# outputs = { self, nixpkgs, ... }@inputs: {
# nixosConfigurations = {
# default = nixpkgs.lib.nixosSystem {
# system = "x86_64-linux";
# specialArgs = {inherit inputs;};
# modules = [
# ./configuration.nix
# ./hosts/default
# #./nixos_modules
# ];
# };
# };
# #homeManagerModules.default = ./homeManager_modules;
# };
#}
{
description = "Your new nix config";
@ -80,27 +53,27 @@
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
# FIXME replace with your hostname
default = nixpkgs.lib.nixosSystem {
nixdev = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
# > Our main nixos configuration file <
./nixos/configuration.nix
./hosts/nixdev
];
};
};
# # Standalone home-manager configuration entrypoint
# # Available through 'home-manager --flake .#your-username@your-hostname'
# homeConfigurations = {
# # FIXME replace with your username@hostname
# "sam" = home-manager.lib.homeManagerConfiguration {
# pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
# extraSpecialArgs = {inherit inputs outputs;};
# modules = [
# # > Our main home-manager configuration file <
# ./home-manager/home.nix
# ];
# };
# };
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
# FIXME replace with your username@hostname
"sam@nixdev" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = {inherit inputs outputs;};
modules = [
# > Our main home-manager configuration file <
./home/sam/nixdev.nix
];
};
};
};
}

View File

@ -0,0 +1,159 @@
{
lib,
config,
pkgs,
...
}: {
imports = [
];
wayland.windowManager.hyprland = {
enable = true;
systemd = {
enable = true;
# Same as default, but stop graphical-session too
extraCommands = lib.mkBefore [
"systemctl --user stop graphical-session.target"
"systemctl --user start hyprland-session.target"
];
};
extraConfig = let
monitor = "${toString (builtins.map (m: "monitor=${ m.name },${ toString(m.width) }x${ toString(m.height) }@60,auto,1") config.monitors)}";
in ''
${monitor}
$terminal = kitty
$fileManager = dolphin
$menu = wofi --show drun
env = XCURSOR_SIZE,24
input {
kb_layout = gb
kb_variant =
kb_model =
kb_options = caps:swapescape
kb_rules =
follow_mouse = 1
touchpad {
natural_scroll = no
}
}
general {
gaps_in = 5
gaps_out = 20
border_size = 2
col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
col.inactive_border = rgba(595959aa)
layout = dwindle
allow_tearing = false
}
decoration {
rounding = 10
blur {
enabled = true
size = 3
passes = 1
}
drop_shadow = yes
shadow_range = 4
shadow_render_power = 3
col.shadow = rgba(1a1a1aee)
}
animations {
enabled = yes
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 7, myBezier
animation = windowsOut, 1, 7, default, popin 80%
animation = border, 1, 10, default
animation = borderangle, 1, 8, default
animation = fade, 1, 7, default
animation = workspaces, 1, 6, default
}
dwindle {
}
master {
new_is_master = true
}
gestures {
workspace_swipe = off
}
misc {
}
device {
name = epic-mouse-v1
sensitivity = -0.5
}
$mainMod = SUPER
bind = $mainMod, Q, exec, $terminal
bind = $mainMod, C, killactive,
bind = $mainMod, M, exit,
bind = $mainMod, E, exec, $fileManager
bind = $mainMod, V, togglefloating,
bind = $mainMod, R, exec, $menu
bind = $mainMod, S, exec, rofi -show drun -show-icons
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10
bind = $mainMod, S, togglespecialworkspace, magic
bind = $mainMod SHIFT, S, movetoworkspace, special:magic
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
exec-once=bash ~/.config/hypr/start.sh
'';
};
}

View File

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ config, pkgs, lib, outputs, ... }:
{
home.username = "sam";
@ -12,6 +12,18 @@
pkgs.xfce.thunar
];
# You can import other home-manager modules here
imports = [
# If you want to use modules your own flake exports (from modules/home-manager):
# outputs.homeManagerModules.example
# Or modules exported from other flakes (such as nix-colors):
# inputs.nix-colors.homeManagerModules.default
# You can also split up your configuration and import pieces of it here:
# ./nvim.nix
] ++ (builtins.attrValues outputs.homeManagerModules); # import all homeManagerModules?
programs.zsh = {
enable = true;
enableCompletion = true;
@ -20,7 +32,8 @@
shellAliases = {
ll = "ls -l";
update = "sudo nixos-rebuild switch --flake $(readlink -f /etc/nixos)#default";
update = "sudo nixos-rebuild switch --flake $(readlink -f /etc/nixos)#nixdev";
update-home = "home-manager switch --flake $(readlink -f /etc/nixos)#sam@nixdev";
nix-home = "nvim $HOME/nixos/hosts/workmachine/home.nix";
nix-conf = "nvim $HOME/nixos/hosts/workmachine/configuration.nix";
};

25
home/sam/nixdev.nix Normal file
View File

@ -0,0 +1,25 @@
{
pkgs,
config,
lib,
...
}: {
imports = [
./global
./features/desktop/hyprland
];
# ------
# | DP-1
# ------
monitors = [
{
name = "Virtual-1";
width = 2048;
height = 1152;
x = 0;
workspace = "1";
primary = true;
}
];
}

View File

@ -4,16 +4,8 @@
imports =
[
./hardware-configuration.nix
inputs.home-manager.nixosModules.home-manager
];
home-manager = {
extraSpecialArgs = { inherit inputs outputs; };
users = {
# Import your home-manager configuration
sam = import ../home-manager/home.nix;
};
};
nixpkgs = {
# You can add overlays here
@ -93,10 +85,10 @@
rofi-wayland
networkmanagerapplet
htop
sddm-theme
sddm
sshfs-fuse
wdisplays
sddm-sugar-candy-theme
wallpaper_changer
#(callPackage ../../nixos_modules/themes/sddm-sugar-candy.nix{}).sddm-sugar-candy-theme
libsForQt5.qt5.qtgraphicaleffects #required for sugar candy
@ -120,10 +112,15 @@
};
services.openssh.enable = true;
services.displayManager.sddm = {
enable = true;
theme = "sugar-candy";
};
# services.displayManager.sddm = {
# enable = true;
# theme = "sugar-candy";
# };
services.displayManager.sddm = {
enable = true;
package = lib.mkForce pkgs.libsForQt5.sddm;
theme = "sugar-candy";
};
services.displayManager.sddm.wayland.enable = true;

View File

@ -0,0 +1,10 @@
{
#fonts = import ./fonts.nix;
monitors = import ./monitors.nix;
# pass-secret-service = import ./pass-secret-service.nix;
# rgbdaemon = import ./rgbdaemon.nix;
# shellcolor = import ./shellcolor.nix;
# wallpaper = import ./wallpaper.nix;
# xpo = import ./xpo.nix;
# colors = import ./colors.nix;
}

View File

@ -0,0 +1,64 @@
{
lib,
config,
...
}: let
inherit (lib) mkOption types;
cfg = config.monitors;
in {
options.monitors = mkOption {
type = types.listOf (
types.submodule {
options = {
name = mkOption {
type = types.str;
example = "DP-1";
};
primary = mkOption {
type = types.bool;
default = false;
};
width = mkOption {
type = types.int;
example = 1920;
};
height = mkOption {
type = types.int;
example = 1080;
};
refreshRate = mkOption {
type = types.int;
default = 60;
};
x = mkOption {
type = types.int;
default = 0;
};
y = mkOption {
type = types.int;
default = 0;
};
enabled = mkOption {
type = types.bool;
default = true;
};
workspace = mkOption {
type = types.nullOr types.str;
default = null;
};
};
}
);
default = [];
};
config = {
assertions = [
{
assertion =
((lib.length config.monitors) != 0)
-> ((lib.length (lib.filter (m: m.primary) config.monitors)) == 1);
message = "Exactly one monitor must be set to primary.";
}
];
};
}

View File

@ -0,0 +1,17 @@
{ lib, config, ...}:
let
cfg = config.sddm;
in {
options = {
sddm.enable = lib.mkEnableOption "Enable Module";
dataDir = mkOption {
type = types.path;
description = "sddm theme path";
default = "/usr/share/sddm/themes/${theme}";
};
};
config = lib.mkIf cfg.enable {
#config contents
}
}

View File

@ -1,6 +1,6 @@
# Custom packages, that can be defined similarly to ones from nixpkgs
# You can build them using 'nix build .#example'
pkgs: {
sddm-sugar-candy-theme = pkgs.callPackage ./sddm-sugar-candy.nix { };
wallpaper_changer = pkgs.callPackage ./wallpaper_changer.nix { };
sddm-theme = pkgs.callPackage ./sddm-theme { };
wallpaper_changer = pkgs.callPackage ./wallpaper-changer { };
}

View File

@ -1,11 +1,15 @@
{ pkgs ? import <nixpkgs> { }, stdenv, fetchFromGitHub }:
pkgs.stdenv.mkDerivation rec {
pname = "sddm-sugar-candy-theme";
pname = "sddm-theme";
version = "1.6";
dontBuild = true;
# nativeBuildInputs = with pkgs; [
# sddm
# ];
installPhase = ''
mkdir -p $out/share/sddm/themes
cp -aR $src $out/share/sddm/themes/sugar-candy
touch $out/share/sddm/themes/balls
'';
src = fetchFromGitHub {
owner = "Kangie";

View File

@ -0,0 +1,11 @@
# Uses swww to cycle through wallpapers in a random order.
# xpo [local port] [remote host] [remote port]
{
lib,
writeShellApplication,
swww,
}:
(writeShellApplication {
name = "wallpaper-changer";
text = builtins.readFile ./wallpaper-changer.sh;
})

View File

@ -1,8 +1,7 @@
{ pkgs }:
pkgs.writeShellScriptBin "wallpaper_changer" ''
script_name=''${BASH_SOURCE[0]}
set +o errexit
set +o nounset
set +o pipefail
script_name=${BASH_SOURCE[0]}
for pid in $(pidof -x "$script_name"); do
if [ "$pid" != $$ ]; then
kill -15 "$pid"
@ -12,15 +11,16 @@ done
[ "$XDG_SESSION_TYPE" != "wayland" ] && echo "Not a Wayland session, exiting." && exit 1
wallpaper_dir="$HOME/.local/share/bg/"
kill -15 $(pidof -x "swww-daemon")
kill -15 $(pidof -x "swww")
${pkgs.swww}/bin/swww-daemon &
swww_daemon_pid=$(pidof -x 'swww-daemon')
swww_pid=$(pidof -x 'swww')
[ -z "$swww_daemon_pid" ] || kill -15 "$swww_daemon_pid"
[ -z "$swww_pid" ] || kill -15 "$swww_pid"
swww-daemon &
while true; do
find "$wallpaper_dir" -type f -follow \( -iname \*.jpg -o -iname \*.png -o -iname \*.gif -o -iname \*.bmp \) | shuf | while read -r file; do
${pkgs.swww}/bin/swww img "$file" --transition-step 10 --transition-fps 60
swww img "$file" --transition-step 10 --transition-fps 60
sleep 600
done
done
''

1
result Symbolic link
View File

@ -0,0 +1 @@
/nix/store/iil5ayx17m3dn8jqrrv5y48prrcxb7d8-sddm-sugar-candy-theme-1.6