From 587ce8548586f4b204c24ccc29d12128493fc1dd Mon Sep 17 00:00:00 2001 From: alisceon Date: Thu, 11 Dec 2025 20:23:32 +0100 Subject: [PATCH] empty commit message. --- TODO.md | 3 +- flake.lock | 12 ++--- home/alisceon/workstation.nix | 23 ++++----- home/wm/sway.nix | 95 ++++++++++++++++++++++++++++------- hosts/common/wm/sway.nix | 2 + util/get_xdg_desktops.xsh | 5 ++ 6 files changed, 101 insertions(+), 39 deletions(-) create mode 100644 util/get_xdg_desktops.xsh diff --git a/TODO.md b/TODO.md index c497e20..aa760a5 100644 --- a/TODO.md +++ b/TODO.md @@ -7,5 +7,4 @@ - [ ] selinux - https://github.com/NixOS/nixpkgs/pull/396177 - [ ] Secure boot - - [ ] **REFACTOR** - - [ ] \ No newline at end of file + - [ ] **REFACTOR** \ No newline at end of file diff --git a/flake.lock b/flake.lock index d9763d2..076ff81 100644 --- a/flake.lock +++ b/flake.lock @@ -103,11 +103,11 @@ ] }, "locked": { - "lastModified": 1765397369, - "narHash": "sha256-WqZfobdsAIT1rHItS8Nt7m02bZZYeVNV3Gh63Bnn5gM=", + "lastModified": 1765478879, + "narHash": "sha256-40MDB5qv9QOftCrduVTD2DjX76bXycTzvDZoQ9+l5Ak=", "owner": "nix-community", "repo": "NUR", - "rev": "e941e36ac1d3c61f94ad767bc8849636f032f95e", + "rev": "8d973756ed1d3152c273af69431fde7d67472b84", "type": "github" }, "original": { @@ -124,11 +124,11 @@ ] }, "locked": { - "lastModified": 1765397369, - "narHash": "sha256-WqZfobdsAIT1rHItS8Nt7m02bZZYeVNV3Gh63Bnn5gM=", + "lastModified": 1765478879, + "narHash": "sha256-40MDB5qv9QOftCrduVTD2DjX76bXycTzvDZoQ9+l5Ak=", "owner": "nix-community", "repo": "NUR", - "rev": "e941e36ac1d3c61f94ad767bc8849636f032f95e", + "rev": "8d973756ed1d3152c273af69431fde7d67472b84", "type": "github" }, "original": { diff --git a/home/alisceon/workstation.nix b/home/alisceon/workstation.nix index 4113fed..2a60efc 100644 --- a/home/alisceon/workstation.nix +++ b/home/alisceon/workstation.nix @@ -30,23 +30,22 @@ # nixpkgs config xdg.configFile."nixpkgs/config.nix".source = ../conf/config.nix; - xdg.autostart = { - enable = true; - entries = [ - "${pkgs.firefox}/share/applications/firefox.desktop" - "${pkgs.discord}/share/applications/discord.desktop" - "${pkgs.signal-desktop}/share/applications/signal.desktop" - "${pkgs.obsidian}/share/applications/obsidian.desktop" - "${pkgs.vscode}/share/applications/code.desktop" - ]; - }; # end xdg.autostart - xdg = { enable = true; userDirs.enable = true; mime.enable = true; + autostart = { + enable = true; + entries = [ + "${pkgs.firefox}/share/applications/firefox.desktop" + "${pkgs.discord}/share/applications/discord.desktop" + "${pkgs.signal-desktop}/share/applications/signal.desktop" + "${pkgs.obsidian}/share/applications/obsidian.desktop" + "${pkgs.vscode}/share/applications/code.desktop" + ]; + }; }; - gtk = { + gtk = lib.mkDefault { enable = true; cursorTheme.package = pkgs.vanilla-dmz; cursorTheme.name = "Vanilla-DMZ"; diff --git a/home/wm/sway.nix b/home/wm/sway.nix index 52fde1a..2563ea8 100644 --- a/home/wm/sway.nix +++ b/home/wm/sway.nix @@ -6,6 +6,7 @@ term = "${pkgs.kitty}/bin/kitty"; dmenu = "${pkgs.rofi}/bin/rofi -show drun"; notify = "${pkgs.libnotify}/bin/notify-send"; + nag = "${pkgs.sway}/bin/swaynag --edge bottom --font '${style_font} ${style_font_sz}'"; # keybinds key_mod = "Mod4"; @@ -159,11 +160,12 @@ { wayland.windowManager.sway = { enable = true; - wrapperFeatures.gtk = true; # Fixes common issues with GTK 3 apps + wrapperFeatures.gtk = true; config = { modifier = "${key_mod}"; startup = [ { command = "systemctl --user start libinput-gestures"; } + { command = "swaybg -m fill -i /home/alisceon/Pictures/system/bg.png";} ]; bars = [ { command = "${pkgs.waybar}/bin/waybar"; } @@ -191,12 +193,6 @@ }; }; # end input keybindings = { - # Basic - "${key_mod}+Return" = "exec ${term}"; - "${key_mod}+d" = "exec ${dmenu}"; - "${key_mod}+Shift+q" = "kill"; - "${key_mod}+F4" = "kill"; - "${key_mod}+L" = "exec ${lock}"; # Workspaces "${key_mod}+f" = "fullscreen"; "${key_mod}+Shift+f" = "floating toggle"; @@ -254,12 +250,25 @@ "${key_mod}+${key_mod_misc}+Tab" = "workspace next"; "${key_mod}+${key_mod_misc}+Shift+Tab" = "workspace prev"; - # System "Mod4+space" = ''exec ${notify} -t 2000 "$(xonsh ~/.nixos_config/util/get_xkb.xsh)"''; + "${key_mod}+Shift+r" = "reload"; + "${key_mod}+Ctrl+r" = "restart"; + "${key_mod}+Escape" = "exec ${nag} -m 'Shutdown options:' -B 'Power Off' 'systemctl poweroff' -B 'Reboot' 'systemctl reboot' -B 'Logout' 'swaymsg exit'"; + "${key_mod}+Return" = "exec ${term}"; + "${key_mod}+Shift+q" = "kill"; + "${key_mod}+F4" = "kill"; + + # Locking and idle + "${key_mod}+L" = "exec ${lock}"; + + # Apps + "${key_mod}+d" = "exec ${dmenu}"; + #Screenshot region "${key_mod}+Shift+s" = "exec grimshot savecopy area"; - "Print" = "exec grimshot savecopy output"; + "${key_mod}+Ctrl+s" = "exec grimshot savecopy output"; + # media keys "XF86AudioRaiseVolume" = "exec 'pactl set-sink-volume @DEFAULT_SINK@ +3%'"; "XF86AudioLowerVolume" = "exec 'pactl set-sink-volume @DEFAULT_SINK@ -3%'"; @@ -271,7 +280,7 @@ window = { titlebar = false; commands = [ - #{ criteria ={ app_id = "flameshot"; }; command = "border pixel 0, floating enable, fullscreen disable, move absolute position 0 0"; } + { criteria = { all = true; }; command = "inhibit_idle fullscreen"; } ]; }; colors = { @@ -462,7 +471,7 @@ max-length = 64; }; "tray" = { - icon-size = 13; + icon-size = 24; spacing = 8; }; "clock" = { @@ -635,7 +644,6 @@ } #tray { background-color: transparent; - border-bottom: 3px solid ${color_f_text}; } #tray > .passive { @@ -675,15 +683,21 @@ }; }; # end kitty }; # end programs - dconf = { + gtk = { enable = true; - settings = { - "org/gnome/desktop/interface" = { - color-scheme = "prefer-dark"; - gtk-theme = "Adwaita-Dark"; - }; - }; + gtk2.enable = true; + gtk3.enable = true; + gtk4.enable = true; + colorScheme = "dark"; + theme.name = "Adwaita-Dark"; + cursorTheme.name = "Adwaita-Dark"; + font.package = pkgs.inconsolata; + font.name = "Inconsolata"; + font.size = 14; + iconTheme.name = "Adwaita-Dark"; + iconTheme.package = pkgs.adwaita-icon-theme; }; + xdg.configFile."libinput-gestures.conf".text = '' gesture swipe left 3 ${swaymsg} workspace prev gesture swipe right 3 ${swaymsg} workspace next @@ -704,6 +718,49 @@ --ozone-platform=wayland --gtk-version=4 ''; + xdg.mimeApps = { + enable = true; + defaultApplications ={ + # Text + "text/plain" = [ "${pkgs.gnome-text-editor}/share/applications/org.gnome.TextEditor.desktop" ]; + "text/markdown" = [ "${pkgs.gnome-text-editor}/share/applications/org.gnome.TextEditor.desktop" ]; + "text/x-markdown" = [ "${pkgs.gnome-text-editor}/share/applications/org.gnome.TextEditor.desktop" ]; + "text/csv" = [ "${pkgs.gnome-text-editor}/share/applications/org.gnome.TextEditor.desktop" ]; + "text/xml" = [ "${pkgs.gnome-text-editor}/share/applications/org.gnome.TextEditor.desktop" ]; + "application/xml" = [ "${pkgs.gnome-text-editor}/share/applications/org.gnome.TextEditor.desktop" ]; + "application/json" = [ "${pkgs.gnome-text-editor}/share/applications/org.gnome.TextEditor.desktop" ]; + + # Media + "video/mp4" = [ "${pkgs.vlc}/share/applications/vlc.desktop" ]; + "audio/mpeg" = [ "${pkgs.vlc}/share/applications/vlc.desktop" ]; + "audio/ogg" = [ "${pkgs.vlc}/share/applications/vlc.desktop" ]; + "audio/wav" = [ "${pkgs.vlc}/share/applications/vlc.desktop" ]; + "audio/flac" = [ "${pkgs.vlc}/share/applications/vlc.desktop" ]; + "video/x-matroska" = [ "${pkgs.vlc}/share/applications/vlc.desktop" ]; + "video/webm" = [ "${pkgs.vlc}/share/applications/vlc.desktop" ]; + "video/avi" = [ "${pkgs.vlc}/share/applications/vlc.desktop" ]; + "video/mkv" = [ "${pkgs.vlc}/share/applications/vlc.desktop" ]; + + # Browser + "text/html" = [ "${pkgs.firefox}/share/applications/firefox.desktop" ]; + "application/xhtml+xml" = [ "${pkgs.firefox}/share/applications/firefox.desktop" ]; + "application/x-web-app-manifest+json" = [ "${pkgs.firefox}/share/applications/firefox.desktop" ]; + "application/xml-dtd" = [ "${pkgs.firefox}/share/applications/firefox.desktop" ]; + + + # Images + "image/png" = [ "${pkgs.swayimg}/share/applications/swayimg.desktop" ]; + "image/jpeg" = [ "${pkgs.swayimg}/share/applications/swayimg.desktop" ]; + "image/gif" = [ "${pkgs.swayimg}/share/applications/swayimg.desktop" ]; + "image/bmp" = [ "${pkgs.swayimg}/share/applications/swayimg.desktop" ]; + "image/webp" = [ "${pkgs.swayimg}/share/applications/swayimg.desktop" ]; + "image/svg+xml" = [ "${pkgs.swayimg}/share/applications/swayimg.desktop" ]; + "image/svg+xml-compressed" = [ "${pkgs.swayimg}/share/applications/swayimg.desktop" ]; + "image/tiff" = [ "${pkgs.swayimg}/share/applications/swayimg.desktop" ]; + "image/apng" = [ "${pkgs.swayimg}/share/applications/swayimg.desktop" ]; + "image/heic" = [ "${pkgs.swayimg}/share/applications/swayimg.desktop" ]; + }; + }; # this right here offends me https://source.chromium.org/chromium/chromium/src/+/main:base/nix/xdg_util.cc;l=179-180 systemd.user.sessionVariables = { diff --git a/hosts/common/wm/sway.nix b/hosts/common/wm/sway.nix index 8a2f667..447e8b3 100644 --- a/hosts/common/wm/sway.nix +++ b/hosts/common/wm/sway.nix @@ -27,6 +27,8 @@ extraPackages = with pkgs; [ swayidle swaylock + swayimg + swaybg grim slurp wl-clipboard diff --git a/util/get_xdg_desktops.xsh b/util/get_xdg_desktops.xsh new file mode 100644 index 0000000..ae8cf4a --- /dev/null +++ b/util/get_xdg_desktops.xsh @@ -0,0 +1,5 @@ +files = $(fd \.desktop$ /nix/store) +xdg_desktops = set() +for file in files.splitlines(): + xdg_desktops.add(file.split('/')[-1]) +print('\n'.join([x for x in sorted(xdg_desktops) if x])) \ No newline at end of file