From 5786716a383254c256f109d38fda1c898456fb60 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 11 Aug 2024 11:13:27 +0200 Subject: sif: hyprland --- _sources/generated.json | 20 +++ _sources/generated.nix | 14 ++ accounts/gkleen@sif/default.nix | 222 +++++++++++++++++++++++++-- accounts/gkleen@sif/dunst-settings.nix | 10 +- accounts/gkleen@sif/dunstrc.d/20-kitty.conf | 3 + accounts/gkleen@sif/emacs.el | 4 +- accounts/gkleen@sif/hyprland.nix | 229 ++++++++++++++++++++++++++++ accounts/gkleen@sif/systemd.nix | 1 + accounts/gkleen@sif/zshrc | 4 +- hosts/sif/default.nix | 29 +++- nvfetcher.toml | 4 + 11 files changed, 520 insertions(+), 20 deletions(-) create mode 100644 accounts/gkleen@sif/dunstrc.d/20-kitty.conf create mode 100644 accounts/gkleen@sif/hyprland.nix diff --git a/_sources/generated.json b/_sources/generated.json index 87d6c357..a7dba77c 100644 --- a/_sources/generated.json +++ b/_sources/generated.json @@ -324,6 +324,26 @@ }, "version": "2.3.0" }, + "tomorrow-night-paradise-theme": { + "cargoLocks": null, + "date": "2012-06-04", + "extract": null, + "name": "tomorrow-night-paradise-theme", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "rev": "70225a5bf90d495e13a9260bfdc268632ece0801", + "sha256": "sha256-5EhngRD5Xq8bUUeoY6Jmpsvszsk8fM8eQcfhbLs5WI8=", + "sparseCheckout": [], + "type": "git", + "url": "https://github.com/jimeh/tomorrow-night-paradise-theme.el" + }, + "version": "70225a5bf90d495e13a9260bfdc268632ece0801" + }, "v4l2loopback": { "cargoLocks": null, "date": "2024-05-24", diff --git a/_sources/generated.nix b/_sources/generated.nix index cb6022ab..7050dab8 100644 --- a/_sources/generated.nix +++ b/_sources/generated.nix @@ -199,6 +199,20 @@ sha256 = "sha256-+pRvc5mr2PEkG05IzPjUrE6Yr8EwG4zA/3DEU8GVA1E="; }; }; + tomorrow-night-paradise-theme = { + pname = "tomorrow-night-paradise-theme"; + version = "70225a5bf90d495e13a9260bfdc268632ece0801"; + src = fetchgit { + url = "https://github.com/jimeh/tomorrow-night-paradise-theme.el"; + rev = "70225a5bf90d495e13a9260bfdc268632ece0801"; + fetchSubmodules = false; + deepClone = false; + leaveDotGit = false; + sparseCheckout = [ ]; + sha256 = "sha256-5EhngRD5Xq8bUUeoY6Jmpsvszsk8fM8eQcfhbLs5WI8="; + }; + date = "2012-06-04"; + }; v4l2loopback = { pname = "v4l2loopback"; version = "2d44c2f3a33844dfd9928dc536288283289bbc34"; diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix index 8e567a4f..5c90808c 100644 --- a/accounts/gkleen@sif/default.nix +++ b/accounts/gkleen@sif/default.nix @@ -41,7 +41,6 @@ let wrapElectron = { package, bin ? package.meta.mainProgram or package.pname or (pkgs.lib.strings.nameFromURL package.name "-"), outBin ? bin, sandbox ? true }: pkgs.runCommand "${package.name}-wrapped" { buildInputs = with pkgs; [ makeWrapper ]; } '' mkdir -p "$out/bin" makeWrapper ${package}/bin/${bin} $out/bin/${outBin} \ - --add-flags '--force-device-scale-factor=1.6' \ ${optionalString (!sandbox) "--add-flags '--no-sandbox'"} ''; @@ -158,6 +157,7 @@ in { emacs = { enable = true; + package = pkgs.emacs29-pgtk; extraPackages = epkgs: with epkgs; [ evil evil-dvorak undo-tree magit haskell-mode nix-mode yaml-mode json-mode shakespeare-mode smart-mode-line @@ -166,14 +166,19 @@ in { use-package-ensure-system-package git-gutter emacsScratch edit-server mediawiki editorconfig typescript-mode markdown-mode nftables-mode rustic lsp-mode lsp-ui - direnv company projectile + direnv company projectile tomorrow-night-paradise-theme ]; + overrides = self: super: { + tomorrow-night-paradise-theme = super.trivialBuild { + inherit (sources.tomorrow-night-paradise-theme) pname version src; + }; + }; }; firefox = { enable = true; profiles.default = { settings = { - "layout.css.devPixelsPerPx" = "0.5833"; + # "layout.css.devPixelsPerPx" = "0.5833"; "browser.tabs.drawInTitlebar" = false; "toolkit.legacyUserProfileCustomizations.stylesheets" = true; "dom.security.https_only_mode" = true; @@ -223,7 +228,7 @@ in { docs = "$HOME/documents"; dl = "$HOME/Downloads"; scrot = "$HOME/screenshots"; - flk = "$HOME/config/nixos-flakes"; + flk = "$HOME/projects/machines"; rz = "$HOME/projects/rz"; pro = "$HOME/projects/pro"; }; @@ -240,6 +245,150 @@ in { gitProtocol = "ssh"; }; }; + + kitty = { + enable = true; + font = { + package = pkgs.fira; + name = "FiraMono Nerd Font"; + size = 10; + }; + settings = { + enable_audio_bell = false; + update_check_interval = 0; + strip_trailing_spaces = "smart"; + focus_follows_mouse = true; + visual_bell_duration = "0.1"; + visual_bell_color = "#26240d"; + tab_bar_style = "powerline"; + tab_powerline_style = "slanted"; + notify_on_cmd_finish = "invisible 30.0"; + }; + }; + wofi = { + enable = true; + settings = { + location = "top"; + run-always_parse_args = true; + run-show_all = false; + }; + }; + waybar = { + enable = true; + systemd = { + enable = true; + target = "hyprland-session.target"; + }; + settings.mainBar = { + layer = "top"; + position = "top"; + height = 14; + output = [ "eDP-1" ]; + modules-left = [ "hyprland/workspaces" ]; + modules-center = [ "hyprland/window" ]; + modules-right = [ "clock" "tray" "battery" ]; + + clock = { + interval = 1; + timezone = "Europe/Berlin"; + format = "W{:%V-%u %F %H:%M:%S%Ez}"; + tooltip-format = "{calendar}"; + calendar = { + mode = "year"; + mode-mon-col = 3; + week-pos = "right"; + on-scroll = 1; + format = { + months = "{}"; + days = "{}"; + weeks = "W{}"; + weekdays = "{}"; + today = "{}"; + }; + }; + }; + battery = { + format = "{icon}"; + format-icons = ["" "" "" "" ""]; + tooltip-format = "{capacity}% {timeTo}"; + }; + icon = { + icon-size = 12; + show-passive-items = true; + spacing = 2; + }; + }; + style = '' + * { + border: none; + font-family: "Fira Sans"; + font-size: 10pt; + min-height: 0; + } + + window#waybar { + background-color: rgba(0, 0, 0, 0.5); + color: #ffffff; + } + + label.module { + margin: 0 5px; + } + + #workspaces button.visible { + color: @blue; + } + #workspaces button.active { + color: @green; + } + #workspaces button.urgent { + color: @red; + } + ''; + }; + wpaperd = { + enable = true; + settings.default = { + path = "~/.wallpapers"; + duration = "8h"; + mode = "center"; + }; + }; + hyprlock = { + enable = false; + settings = { + general = { + disable_loading_bar = false; + grace = 60; + hide_cursor = true; + no_fade_in = false; + }; + + background = [ + { + path = "screenshot"; + blur_passes = 3; + blur_size = 8; + } + ]; + + input-field = [ + { + size = "200, 50"; + position = "0, -80"; + monitor = ""; + dots_center = true; + fade_on_empty = false; + font_color = "rgb(202, 211, 245)"; + inner_color = "rgb(91, 96, 120)"; + outer_color = "rgb(24, 25, 38)"; + outline_thickness = 5; + placeholder_text = "'Password...'"; + shadow_passes = 2; + } + ]; + }; + }; }; services = { @@ -265,10 +414,10 @@ in { ''; }; taffybar = { - enable = true; + enable = false; package = import ./taffybar { haskellPackages = deHaskell; }; }; - status-notifier-watcher.enable = true; + # status-notifier-watcher.enable = true; xembed-sni-proxy.enable = true; pasystray.enable = true; udiskie = { @@ -284,7 +433,7 @@ in { }; }; unclutter = { - enable = true; + enable = false; timeout = 5; }; network-manager-applet.enable = true; @@ -324,7 +473,7 @@ in { }; screen-locker = { - enable = true; + enable = false; lockCmd = toString (pkgs.writeShellScript "lock" '' ${pkgs.playerctl}/bin/playerctl -a status | ${pkgs.gnugrep}/bin/grep -q "Playing" && exit 0 @@ -344,6 +493,46 @@ in { enable = true; serverUrl = "https://etesync.yggdrasil.li"; }; + + hypridle = { + enable = false; + settings = { + general = { + after_sleep_cmd = "hyprctl dispatch dpms on"; + before_sleep_cmd = "hyprlock"; + ignore_dbus_inhibit = false; + ignore_systemd_inhibit = false; + lock_cmd = "hyprlock"; + }; + + listener = [ + { + timeout = 300; + on-timeout = "hyprlock"; + } + { + timeout = 600; + on-timeout = "hyprctl dispatch dpms off"; + on-resume = "hyprctl dispatch dpms on"; + } + ]; + }; + }; + swayidle = { + enable = true; + events = [ + { event = "before-sleep"; command = "${lib.getExe pkgs.gtklock} -d"; } + { event = "after-resume"; command = "${cfg.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms on"; } + { event = "lock"; command = "${lib.getExe pkgs.gtklock} -d"; } + ]; + timeouts = [ + { timeout = 300; + command = "${cfg.wayland.windowManager.hyprland.package}/binhyprctl dispatch dpms off"; + resumeCommand = "${cfg.wayland.windowManager.hyprland.package}/binhyprctl dispatch dpms on"; + } + { timeout = 330; command = "${lib.getExe pkgs.gtklock} -d"; } + ]; + }; }; home.pointerCursor = { @@ -363,7 +552,7 @@ in { font = { package = pkgs.fira; name = "Fira Sans"; - size = 6; + size = 10; }; theme = { package = pkgs.equilux-theme; @@ -402,7 +591,7 @@ in { matrix-synapse-tools.synadm wrappedRocketChatDesktop flakeInputs.deploy-rs.packages.${config.nixpkgs.system}.deploy-rs sieve-connect gimp inkscape udiskie glab scrot nitrokey-app - pynitrokey + pynitrokey gtklock wlrctl ]; file = { @@ -419,8 +608,8 @@ in { }; sessionVariables = { - GDK_SCALE = 96.0 / 282.0; - QT_AUTO_SCREEN_SCALE_FACTOR = 1; + # GDK_SCALE = 96.0 / 282.0; + # QT_AUTO_SCREEN_SCALE_FACTOR = 1; QT_QPA_PLATFORMTHEME = "qt5ct"; LIBVIRT_DEFAULT_URI = "qemu:///system"; STACK_XDG = 1; @@ -451,6 +640,10 @@ in { recommend-stack-upgrade = false; }; }; + "gtklock/config.ini" = { + source = (pkgs.formats.ini {}).generate "config.ini" { + }; + }; }; xdg.dataFile = { @@ -509,6 +702,11 @@ in { color-scheme = "prefer-dark"; }; }; + + wayland.windowManager.hyprland = { + enable = true; + settings = import ./hyprland.nix inputs; + }; }; }; } diff --git a/accounts/gkleen@sif/dunst-settings.nix b/accounts/gkleen@sif/dunst-settings.nix index 61bd12a6..90fffcc5 100644 --- a/accounts/gkleen@sif/dunst-settings.nix +++ b/accounts/gkleen@sif/dunst-settings.nix @@ -1,14 +1,14 @@ { pkgs, ... }: { global = { - font = "Fira Sans 6"; + font = "Fira Sans 12"; markup = "full"; format = "%s %p\\n%b"; alignment = "left"; # geometry = "1216x10-32+64"; - width = 250; - height = 50; - offset = "16x25"; + width = 500; + height = 100; + offset = "4x4"; origin = "top-right"; shrink = true; monitor = 0; @@ -33,7 +33,7 @@ sort = false; sticky_history = false; - dmenu = "${pkgs.dmenu}/bin/dmenu"; + dmenu = "wofi --show dmenu"; browser = "${pkgs.xdg-utils}/bin/xdg-open"; }; # shortcuts = { diff --git a/accounts/gkleen@sif/dunstrc.d/20-kitty.conf b/accounts/gkleen@sif/dunstrc.d/20-kitty.conf new file mode 100644 index 00000000..b27ee27e --- /dev/null +++ b/accounts/gkleen@sif/dunstrc.d/20-kitty.conf @@ -0,0 +1,3 @@ +[kitty] +appname=kitty +urgency=low diff --git a/accounts/gkleen@sif/emacs.el b/accounts/gkleen@sif/emacs.el index 0eed3bce..48daa951 100644 --- a/accounts/gkleen@sif/emacs.el +++ b/accounts/gkleen@sif/emacs.el @@ -5,7 +5,9 @@ (setq inhibit-startup-message t) (defalias 'yes-or-no-p 'y-or-n-p) -(set-face-attribute 'default nil :font "Fira Code" :height 49) +;; (set-face-attribute 'default nil :font "Fira Code" :height 49) +(set-frame-font "Fira Code 8" nil nil) +(load-theme 'modus-vivendi t) (require 'package) (setq package-archives nil) diff --git a/accounts/gkleen@sif/hyprland.nix b/accounts/gkleen@sif/hyprland.nix new file mode 100644 index 00000000..9b20f89e --- /dev/null +++ b/accounts/gkleen@sif/hyprland.nix @@ -0,0 +1,229 @@ +{ pkgs, lib, ... }: +{ + monitor = [ + ",preferred,auto,auto" + "eDP-1,3840x2160@59.99900,auto,1.5" + ]; + + "$terminal" = "kitty"; + "$menu" = "wofi --show run"; + + exec-once = [ + "wpaperd" + ]; + + env = [ + # "XCURSOR_SIZE,12" + "NIXOS_OZONE_WL,1" + "QT_QPA_PLATFORM,wayland" + "GDK_BACKEND,wayland" + "GDK_SCALE,0.66" + "QT_AUTO_SCREEN_SCALE_FACTOR,1" + ]; + + xwayland.force_zero_scaling = true; + + general = { + gaps_in = 3; + gaps_out = 9; + "col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg"; + "col.inactive_border" = "rgba(595959aa)"; + + resize_on_border = false; + + allow_tearing = false; + + layout = "dwindle"; + }; + + decoration = { + rounding = 5; + + active_opacity = 1.0; + inactive_opacity = 1.0; + + drop_shadow = false; + shadow_range = 4; + shadow_render_power = 3; + "col.shadow" = "rgba(1a1a1aee)"; + + blur = { + enabled = true; + size = 3; + passes = 1; + + vibrancy = 0.1696; + }; + }; + + animations = { + enabled = true; + bezier = "myBezier, 0.05, 0.9, 0.1, 1.05"; + animation = [ + "windows, 1, 3, default, popin 80%" + "windowsMove, 0" + # "windows, 1, 7, myBezier" + # "windowsOut, 1, 7, myBezier, popin 80%" + "border, 1, 10, default" + "borderangle, 1, 8, default" + "fade, 1, 3, default" + "workspaces, 1, 3, default, fade" + # "workspaces, 1, 6, default" + ]; + }; + + dwindle = { + pseudotile = true; + preserve_split = true; + }; + + master = { + new_status = "master"; + }; + + misc = { + force_default_wallpaper = -1; + disable_hyprland_logo = false; + }; + + input = { + kb_layout = "us,us"; + kb_variant = "dvp,"; + kb_model = ""; + kb_options = "compose:caps,grp:win_space_toggle"; + kb_rules = ""; + + follow_mouse = 1; + + sensitivity = 0; + + touchpad = { + natural_scroll = false; + }; + }; + + device = [ + { name = "synaptics-tm3512-010"; + sensitivity = 0.4; + } + { name = "tpps/2-elan-trackpoint"; + sensitivity = 0.2; + } + ]; + + gestures = { + workspace_swipe = false; + }; + + dwindle = { + # no_gaps_when_only = 1; + }; + + "$mainMod" = "SUPER"; + + bind = [ + "$mainMod, Q, exec, $terminal" + "$mainMod, C, killactive" + "$mainMod, M, exit" + "$mainMod, V, togglefloating" + "$mainMod, R, exec, $menu" + "$mainMod, P, pseudo," + "$mainMod, J, togglesplit," + + # "$mainMod SHIFT, L, exec, loginctl lock-session" + "$mainMod SHIFT, L, exec, gtklock -d" + "$mainMod SHIFT, S, exec, systemctl suspend" + + "$mainMod, left, movefocus, l" + "$mainMod, right, movefocus, r" + "$mainMod, up, movefocus, u" + "$mainMod, down, movefocus, d" + "$mainMod SHIFT, left, swapwindow, l" + "$mainMod SHIFT, right, swapwindow, r" + "$mainMod SHIFT, up, swapwindow, u" + "$mainMod SHIFT, down, swapwindow, d" + + "$mainMod, T, cyclenext" + + "$mainMod SHIFT, N, movecurrentworkspacetomonitor, +1" + + "$mainMod, F, fullscreen, 1" + "$mainMod SHIFT, F, fullscreen, 0" + + "$mainMod, code:14, workspace, 1" + "$mainMod, code:17, workspace, 2" + "$mainMod, code:13, workspace, 3" + "$mainMod, code:18, workspace, 4" + "$mainMod, code:12, workspace, 5" + "$mainMod, code:19, workspace, 6" + "$mainMod, code:11, workspace, 7" + "$mainMod, code:20, workspace, 8" + "$mainMod, code:15, workspace, 9" + "$mainMod, code:16, workspace, 10" + + "$mainMod SHIFT, code:14, movetoworkspacesilent, 1" + "$mainMod SHIFT, code:17, movetoworkspacesilent, 2" + "$mainMod SHIFT, code:13, movetoworkspacesilent, 3" + "$mainMod SHIFT, code:18, movetoworkspacesilent, 4" + "$mainMod SHIFT, code:12, movetoworkspacesilent, 5" + "$mainMod SHIFT, code:19, movetoworkspacesilent, 6" + "$mainMod SHIFT, code:11, movetoworkspacesilent, 7" + "$mainMod SHIFT, code:20, movetoworkspacesilent, 8" + "$mainMod SHIFT, code:15, movetoworkspacesilent, 9" + "$mainMod SHIFT, code:16, movetoworkspacesilent, 10" + + "CTRL, space, exec, dunstctl close" + "CTRL SHIFT, space, exec, dunstctl close-all" + "CTRL, period, exec, dunstctl context" + "CTRL, comma, exec, dunstctl history-pop" + + "$mainMod ALT, E, exec, emacsclient -c" + + ", XF86MonBrightnessUp, exec, brightnessctl s +5%" + ", XF86MonBrightnessDown, exec, brightnessctl s 5%-" + ", XF86AudioRaiseVolume, exec, pamixer -i 2" + ", XF86AudioLowerVolume, exec, pamixer -d 2" + ", XF86AudioMute, exec, pamixer -t" + + ", Print, exec, ${pkgs.writeShellScript "screenshot" '' + export PATH="${lib.makeBinPath (with pkgs; [ grim slurp wl-clipboard-rs coreutils ])}:$PATH" + + outFile="$HOME/screenshots/$(date +"%Y-%m-%dT%H:%M:%S").png" + grim -g "$(slurp -b 00000080 -c FFFFFFFF -s 00000000 -w 1)" "$outFile" + wl-copy --type image/png <"$outFile" + ''}" + + "$mainMod CTRL, return, togglespecialworkspace, term" + "$mainMod CTRL, e, togglespecialworkspace, edit" + "$mainMod CTRL, a, togglespecialworkspace, pavucontrol" + "$mainMod CTRL, o, togglespecialworkspace, easyeffects" + "$mainMod CTRL, b, togglespecialworkspace, blueman" + "$mainMod CTRL, p, togglespecialworkspace, keepass" + ]; + bindm = [ + "$mainMod, mouse:272, movewindow" + "$mainMod, mouse:273, resizewindow" + ]; + + windowrulev2 = [ + "suppressevent maximize, class:.*" + "maximize, class:^(Element|thunderbird)$" + "workspace special:keepass, class:^org\.keepassxc\.KeePassXC$" + # "group set always lock invade, class:^Element$" + ]; + + workspace = [ + "s[true], gapsout:200" + + "special:term, on-created-empty:kitty" + "special:edit, on-created-empty:emacsclient -c" + "special:pavucontrol, on-created-empty:pavucontrol" + "special:easyeffects, on-created-empty:easyeffects" + "special:blueman, on-created-empty:blueman-manager" + "special:keepass, on-created-empty:keepassxc" + ]; + + layerrule = [ + "blur, waybar" + ]; +} diff --git a/accounts/gkleen@sif/systemd.nix b/accounts/gkleen@sif/systemd.nix index fe69a757..1397ca62 100644 --- a/accounts/gkleen@sif/systemd.nix +++ b/accounts/gkleen@sif/systemd.nix @@ -149,6 +149,7 @@ in { BusName = "org.keepassxc.KeePassXC.MainWindow"; WorkingDirectory = "~"; ExecStart = "${pkgs.keepassxc}/bin/keepassxc"; + Environment = [ "QT_QPA_PLATFORM=wayland" ]; }; Unit = { Requires = ["graphical-session-pre.target"]; diff --git a/accounts/gkleen@sif/zshrc b/accounts/gkleen@sif/zshrc index 16079c89..83e86270 100644 --- a/accounts/gkleen@sif/zshrc +++ b/accounts/gkleen@sif/zshrc @@ -481,4 +481,6 @@ export EDITOR=emacsclient bindkey -e bindkey ';5C' emacs-forward-word -bindkey ';5D' emacs-backward-word \ No newline at end of file +bindkey ';5D' emacs-backward-word +bindkey '^[[1;5C' emacs-forward-word +bindkey '^[[1;5D' emacs-backward-word \ No newline at end of file diff --git a/hosts/sif/default.nix b/hosts/sif/default.nix index f505874b..809e2ace 100644 --- a/hosts/sif/default.nix +++ b/hosts/sif/default.nix @@ -388,7 +388,7 @@ in { exportConfiguration = true; displayManager.lightdm = { - enable = true; + enable = false; greeters.gtk = { clock-format = "%H:%M %a %b %_d"; indicators = ["~host" "~spacer" "~clock" "~session" "~power"]; @@ -413,7 +413,32 @@ in { }; }; libinput.enable = true; + + greetd = { + enable = true; + }; + }; + + programs.regreet = { + enable = true; + theme = { + package = pkgs.equilux-theme; + name = "Equilux-compact"; + }; + iconTheme = { + package = pkgs.paper-icon-theme; + name = "Paper"; + }; + font = { + package = pkgs.fira; + name = "Fira Sans"; + # size = 6; + }; + settings = { + GTK.application_prefer_dark_theme = true; + }; }; + programs.hyprland.enable = true; systemd.tmpfiles.rules = [ "d /var/lib/lightdm/.cache/lightdm-gtk-greeter 1770 lightdm lightdm -" @@ -692,6 +717,8 @@ in { ]; }; + security.pam.services.gtklock = {}; + system.stateVersion = "24.11"; }; } diff --git a/nvfetcher.toml b/nvfetcher.toml index bdde5795..d40a8d3a 100644 --- a/nvfetcher.toml +++ b/nvfetcher.toml @@ -89,3 +89,7 @@ fetch.tarball = "https://downloads.open-mesh.org/batman/stable/sources/batman-ad src.github_tag = "bk2204/scutiger" src.prefix = "v" fetch.tarball = "https://github.com/bk2204/scutiger/archive/refs/tags/v$ver.tar.gz" + +[tomorrow-night-paradise-theme] +src.git = "https://github.com/jimeh/tomorrow-night-paradise-theme.el" +fetch.git = "https://github.com/jimeh/tomorrow-night-paradise-theme.el" -- cgit v1.2.3