dotfiles

My PC Dotfiles & Website
commit 40b3af1579ec7b9227260cb8d38c4439a972a385
parent fc38606071ea4613efacf1a3e6e6fe39a44d3942
Author: maydayv7 <maydayv7@gmail.com>
Date:   Tue, 16 Jan 2024 13:55:23 +0530

feat: Multiple Changes

+ Add AppImage Support
+ Add `gui.gtk` Module
+ Refactor GTK Configuration
+ Fix ULauncher Nits

Diffstat:

MREADME.md | 4+++-
Mdevices/vortex.nix | 2+-
Mfiles/images/desktop/xfce.png | 0
Mfiles/touchegg/gestures.xml | 19++++++++++++++-----
Afiles/ulauncher/extensions/com.github.dflock.ulauncher-window-switcher.db | 0
Mfiles/ulauncher/settings/extension.json | 7+++++++
Mfiles/ulauncher/themes/adwaita/manifest.json | 2+-
Mfiles/ulauncher/themes/arc/manifest.json | 2+-
Mflake.lock | 6+++---
Mmodules/README.md | 2++
Mmodules/apps/default.nix | 11+++++++++++
Mmodules/gui/default.nix | 25++++++++++++++-----------
Mmodules/gui/desktop/gnome.nix | 42+++++++++++-------------------------------
Mmodules/gui/desktop/xfce.nix | 169++++++++++++++++++++++++++++++++++++++-----------------------------------------
Amodules/gui/gtk.nix | 50++++++++++++++++++++++++++++++++++++++++++++++++++
Mmodules/gui/wayland.nix | 8++++++--
16 files changed, 205 insertions(+), 144 deletions(-)

diff --git a/README.md b/README.md @@ -392,9 +392,11 @@ You can navigate to the `README`s present in the various directories to know mor - Re-expose `lib.build.device` - Refactor GNOME `dconf` - Overhaul XFCE Configuration - - Use ULauncher + - Use ULauncher - Add VS Code Extensions Repository - Fix Android Virtualisation +- Add AppImage Support +- Add `gui.gtk` Module - Add `sql` Shell - Actually persist `~/.local/share/Trash` diff --git a/devices/vortex.nix b/devices/vortex.nix @@ -31,7 +31,7 @@ gui = { desktop = "xfce"; - wallpaper = "Nix"; + wallpaper = "Sunset"; }; # User V7 diff --git a/files/images/desktop/xfce.png b/files/images/desktop/xfce.png Binary files differ. diff --git a/files/touchegg/gestures.xml b/files/touchegg/gestures.xml @@ -64,7 +64,16 @@ </gesture> <!-- 3 Fingers --> - <gesture type="SWIPE" fingers="3" direction="UP"> + <gesture type="SWIPE" fingers="3" direction="RIGHT"> + <action type="SEND_KEYS"> + <repeat>true</repeat> + <modifiers>Alt_L</modifiers> + <keys>Tab</keys> + <decreaseKeys>Shift_L+Tab</decreaseKeys> + </action> + </gesture> + + <gesture type="SWIPE" fingers="3" direction="LEFT"> <action type="SEND_KEYS"> <repeat>true</repeat> <modifiers>Alt_L</modifiers> @@ -73,21 +82,21 @@ </action> </gesture> - <gesture type="SWIPE" fingers="3" direction="LEFT"> + <gesture type="SWIPE" fingers="3" direction="UP"> <action type="CHANGE_DESKTOP"> <direction>next</direction> <animate>true</animate> <cyclic>true</cyclic> - <animationPosition>right</animationPosition> + <animationPosition>down</animationPosition> </action> </gesture> - <gesture type="SWIPE" fingers="3" direction="RIGHT"> + <gesture type="SWIPE" fingers="3" direction="DOWN"> <action type="CHANGE_DESKTOP"> <direction>previous</direction> <animate>true</animate> <cyclic>true</cyclic> - <animationPosition>left</animationPosition> + <animationPosition>up</animationPosition> </action> </gesture> diff --git a/files/ulauncher/extensions/com.github.dflock.ulauncher-window-switcher.db b/files/ulauncher/extensions/com.github.dflock.ulauncher-window-switcher.db Binary files differ. diff --git a/files/ulauncher/settings/extension.json b/files/ulauncher/settings/extension.json @@ -82,5 +82,12 @@ "updated_at": "2024-01-15T11:29:58.066495", "last_commit": "262ed206057d38cec97e94297ab94246a43468cd", "last_commit_time": "2021-12-12T15:45:10" + }, + "com.github.dflock.ulauncher-window-switcher": { + "id": "com.github.dflock.ulauncher-window-switcher", + "url": "https://github.com/dflock/ulauncher-window-switcher", + "updated_at": "2024-01-15T13:58:08.459425", + "last_commit": "54622e353a7d2d0421250a76cab4aafa9ca720c5", + "last_commit_time": "2022-01-16T17:56:00" } } diff --git a/files/ulauncher/themes/adwaita/manifest.json b/files/ulauncher/themes/adwaita/manifest.json @@ -1,6 +1,6 @@ { "manifest_version": "1", - "name": "adwaita-dark", + "name": "Adwaita-Dark", "display_name": "Adwaita Dark", "extend_theme": "dark", "css_file": "theme.css", diff --git a/files/ulauncher/themes/arc/manifest.json b/files/ulauncher/themes/arc/manifest.json @@ -1,6 +1,6 @@ { "manifest_version": "1", - "name": "arc-dark", + "name": "Arc-Dark", "display_name": "Arc Dark", "extend_theme": "dark", "css_file": "theme.css", diff --git a/flake.lock b/flake.lock @@ -337,11 +337,11 @@ "systems": "systems_3" }, "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", "owner": "numtide", "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", "type": "github" }, "original": { diff --git a/modules/README.md b/modules/README.md @@ -30,6 +30,8 @@ Configuration [Builder](./configuration.nix) - `wallpaper`: Desktop Wallpaper Choice (taken from `files.wallpapers`) - `fonts` - - `enable`: Enable Fonts Configuration - `true / false` + - `gtk` - + - `enable`: Enable GTK Configuration - `true / false` - `wayland` - - `enable`: Enable Wayland Configuration - `true / false` diff --git a/modules/apps/default.nix b/modules/apps/default.nix @@ -1,6 +1,7 @@ { lib, util, + pkgs, ... }: let inherit (util.map) modules; @@ -13,4 +14,14 @@ in { type = types.listOf (types.enum (modules.name ./.)); default = []; }; + + # AppImage Support + config.boot.binfmt.registrations.appimage = { + wrapInterpreterInShell = false; + interpreter = "${pkgs.appimage-run}/bin/appimage-run"; + recognitionType = "magic"; + offset = 0; + mask = ''\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff''; + magicOrExtension = ''\x7fELF....AI\x02''; + }; } diff --git a/modules/gui/default.nix b/modules/gui/default.nix @@ -3,7 +3,6 @@ options, lib, util, - pkgs, ... }: let inherit (builtins) map; @@ -19,15 +18,19 @@ in { default = ""; }; - config = { - # Warning - warnings = optional (!enable) (options.gui.desktop.description + " is unset"); + config = + { + # Warning + warnings = optional (!enable) (options.gui.desktop.description + " is unset"); + } + // (mkIf enable { + # Autostart Apps + user.persist.directories = [".config/autostart"]; - # Desktop Integration - xdg.portal = mkIf enable { - enable = true; - xdgOpenUsePortal = true; - extraPortals = [pkgs.xdg-desktop-portal-gtk]; - }; - }; + # Desktop Integration + xdg.portal = { + enable = true; + xdgOpenUsePortal = true; + }; + }); } diff --git a/modules/gui/desktop/gnome.nix b/modules/gui/desktop/gnome.nix @@ -8,7 +8,7 @@ }: with files; let inherit (config.gui) desktop; - inherit (lib) gvariant mkIf mkForce mkMerge; + inherit (lib) gvariant mkAfter mkIf mkForce mkMerge; exists = app: builtins.elem app config.apps.list; in { ## GNOME Desktop Configuration ## @@ -55,18 +55,16 @@ in { # Desktop Integration gui = { fonts.enable = true; + gtk.enable = true; wayland.enable = true; }; programs = { - dconf.enable = true; firefox.enable = true; - gnupg.agent.pinentryFlavor = - mkIf config.programs.gnupg.agent.enable "gnome3"; + gnupg.agent.pinentryFlavor = mkForce "gnome3"; }; services = { - dbus.packages = [pkgs.dconf]; udev.packages = [pkgs.gnome.gnome-settings-daemon]; telepathy.enable = true; gnome = { @@ -84,17 +82,9 @@ in { # GTK+ Theming stylix.targets.gnome.enable = true; - gtk = { - enable = true; - theme = { - name = "adw-gtk3-dark"; - package = pkgs.adw-gtk3; - }; - - iconTheme = { - name = "Papirus-Dark"; - package = pkgs.papirus-icon-theme; - }; + gtk.theme = { + name = "adw-gtk3-dark"; + package = pkgs.adw-gtk3; }; # Default Applications @@ -113,9 +103,6 @@ in { home.file = { - # GTK+ Bookmarks - ".config/gtk-3.0/bookmarks".text = gtk.bookmarks; - # Action Menu ".config/guillotine.json".source = gnome.menu; @@ -177,16 +164,11 @@ in { environment = { # QT Theme - variables."QT_STYLE_OVERRIDE" = mkForce "kvantum"; - etc."xdg/Kvantum/kvantum.kvconfig".text = '' - [General] - theme=KvLibadwaitaDark - ''; + etc."xdg/Kvantum/kvantum.kvconfig".text = mkAfter "theme=KvLibadwaitaDark"; ## Package List - systemPackages = with pkgs; - [libsForQt5.qtstyleplugin-kvantum custom.kvlibadwaita] - ++ (with pkgs.gnome; [ + systemPackages = with pkgs.gnome; + [ # GNOME Apps gnome-boxes gnome-dictionary @@ -198,7 +180,7 @@ in { gnome-chess gnome-mines quadrapassel - ]) + ] ++ (with pkgs; [ # GNOME Circle apostrophe @@ -222,6 +204,7 @@ in { celluloid dconf2nix gnuchess + custom.kvlibadwaita ]) ++ (with pkgs; with unstable.gnomeExtensions // gnomeExtensions; [ @@ -252,12 +235,9 @@ in { # Persisted Files user.persist.directories = [ - ".config/dconf" ".config/forge" ".config/gnome-boxes" ".config/gnome-builder" - ".config/gtk-3.0" - ".config/gtk-4.0" ".config/pitivi" ".local/share/clipboard" ".local/share/epiphany" diff --git a/modules/gui/desktop/xfce.nix b/modules/gui/desktop/xfce.nix @@ -9,19 +9,12 @@ with files; let inherit (config.gui) desktop wallpaper; exists = app: builtins.elem app config.apps.list; - inherit (lib) mkIf mkForce mkMerge replaceStrings; + inherit (lib) mkAfter mkForce mkIf mkMerge replaceStrings; # GTK+ Theme theme = { - theme = { - name = "Arc-Dark"; - package = pkgs.arc-theme; - }; - - iconTheme = { - name = "Papirus-Dark"; - package = pkgs.papirus-icon-theme; - }; + name = "Arc-Dark"; + package = pkgs.arc-theme; }; in { ## XFCE Desktop Configuration ## @@ -57,91 +50,86 @@ in { ## Full-Fledged XFCE Desktop Configuration (mkIf (desktop == "xfce") { # Desktop Integration - gui.fonts.enable = true; - environment.variables.GTK_THEME = theme.theme.name; + gui = { + fonts.enable = true; + gtk.enable = true; + }; + + environment.variables.GTK_THEME = theme.name; services = { bamf.enable = true; blueman.enable = true; touchegg.enable = true; gnome.gnome-keyring.enable = true; - xserver.displayManager.lightdm.greeters.gtk = theme; + xserver.displayManager.lightdm.greeters.gtk = {inherit theme;}; }; # Plugins - programs = - { - xfconf.enable = true; - seahorse.enable = true; - thunar = { - enable = true; - plugins = with pkgs.xfce; [ - thunar-archive-plugin - thunar-dropbox-plugin - thunar-volman - ]; - }; - } - // {gnupg.agent.pinentryFlavor = mkIf config.programs.gnupg.agent.enable "gtk2";}; + programs = { + xfconf.enable = true; + seahorse.enable = true; + thunar = { + enable = true; + plugins = with pkgs.xfce; [ + thunar-archive-plugin + thunar-dropbox-plugin + thunar-volman + ]; + }; + }; - # Utilities - environment.systemPackages = with pkgs.xfce // pkgs; [ - galculator - gnome.file-roller - mate.atril - orage - pavucontrol - plank - system-config-printer - transmission-gtk - ulauncher - xfce4-clipman-plugin - xfce4-eyes-plugin - xfce4-notes-plugin - xfce4-panel-profiles - xfce4-pulseaudio-plugin - xfce4-sensors-plugin - xfce4-timer-plugin - xfce4-weather-plugin - xfce4-whiskermenu-plugin - xfce4-windowck-plugin - xorg.xkill - ]; + environment = { + # QT Theme + etc."xdg/Kvantum/kvantum.kvconfig".text = mkAfter "theme=KvArcDark"; - # Persisted Files - user.persist = { - directories = [ - ".config/autostart" - ".config/dconf" - ".config/Mousepad" - ".config/plank" - ".config/Thunar" - ".config/ulauncher" - ".config/xfce4" - ".cache/xfce4" - ".local/share/ulauncher" + # Utilities + systemPackages = with pkgs.xfce // pkgs; [ + arc-kde-theme + galculator + gnome.file-roller + mate.atril + orage + pavucontrol + plank + system-config-printer + transmission-gtk + ulauncher + xfce4-clipman-plugin + xfce4-eyes-plugin + xfce4-notes-plugin + xfce4-panel-profiles + xfce4-pulseaudio-plugin + xfce4-sensors-plugin + xfce4-timer-plugin + xfce4-weather-plugin + xfce4-whiskermenu-plugin + xfce4-windowck-plugin + xorg.xkill ]; }; + # Persisted Files + user.persist.directories = [ + ".config/Mousepad" + ".config/plank" + ".config/Thunar" + ".config/ulauncher" + ".config/xfce4" + ".cache/xfce4" + ".local/share/ulauncher" + ]; + # Color Scheme stylix.base16Scheme = colors.arc; - # QT Theme - qt = { - enable = true; - platformTheme = "gtk2"; - style = "gtk2"; - }; - ## User Configuration user.homeConfig = { # GTK+ Theming stylix.targets.xfce.enable = false; - gtk = - { - enable = true; - gtk3.extraCss = xfce.css; - } - // theme; + gtk = { + inherit theme; + gtk3.extraCss = xfce.css; + }; # Default Applications xdg.mimeApps.defaultApplications = util.build.mime xdg.mime { @@ -156,9 +144,6 @@ in { home.file = { - # GTK+ Bookmarks - ".config/gtk-3.0/bookmarks".text = gtk.bookmarks; - # Touchpad Gestures ".config/touchegg/touchegg.conf".text = gestures; @@ -205,8 +190,8 @@ in { values = [ path.system wallpaper - theme.theme.name - theme.iconTheme.name + theme.name + "Papirus-Dark" config.stylix.cursor.name config.stylix.fonts.sansSerif.name config.stylix.fonts.monospace.name @@ -235,16 +220,24 @@ in { # Settings ".config/ulauncher/extensions.json".text = extension; ".config/ulauncher/settings.json".text = - replaceStrings ["@terminal" "@theme"] ["xfce4-terminal" "arc-dark"] settings; + replaceStrings ["@terminal" "@theme"] ["xfce4-terminal" theme.name] settings; + }); - # Autostart - ".config/autostart/ulauncher.desktop".text = '' - [Desktop Entry] - Type=Application - Name=ULauncher - Exec=${pkgs.ulauncher}/bin/ulauncher --no-window + # Autostart + systemd.user.services.ulauncher = { + Unit.Description = "Start ULauncher"; + Install.WantedBy = ["graphical-session.target"]; + Service = { + Type = "Simple"; + Restart = "Always"; + RestartSec = 1; + ExecStart = pkgs.writeShellScript "ulauncher-env-wrapper.sh" '' + export PATH="''${XDG_BIN_HOME}:$HOME/.nix-profile/bin:/etc/profiles/per-user/$USER/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin" + export GDK_BACKEND=x11 + exec ${pkgs.ulauncher}/bin/ulauncher --hide-window ''; - }); + }; + }; # Dock Settings dconf.settings."net/launchpad/plank/docks/dock1" = { diff --git a/modules/gui/gtk.nix b/modules/gui/gtk.nix @@ -0,0 +1,50 @@ +{ + config, + lib, + pkgs, + files, + ... +}: let + inherit (lib) mkEnableOption mkForce mkIf; +in { + options.gui.gtk.enable = mkEnableOption "Enable GTK Configuration"; + + ## GTK Configuration ## + config = mkIf config.gui.gtk.enable { + # Environment Setup + programs.dconf.enable = true; + services.dbus.packages = [pkgs.dconf]; + xdg.portal.extraPortals = [pkgs.xdg-desktop-portal-gtk]; + + # Platform Integration + programs.gnupg.agent.pinentryFlavor = "gtk2"; + environment = { + variables."QT_STYLE_OVERRIDE" = mkForce "kvantum"; + systemPackages = [pkgs.libsForQt5.qtstyleplugin-kvantum]; + etc."xdg/Kvantum/kvantum.kvconfig".text = "[General]"; + }; + + user = { + # Configuration + persist.directories = [ + ".config/dconf" + ".config/gtk-3.0" + ".config/gtk-4.0" + ]; + + homeConfig = { + # Bookmarks + home.file.".config/gtk-3.0/bookmarks".text = files.gtk.bookmarks; + + # Theming + gtk = { + enable = true; + iconTheme = { + name = "Papirus-Dark"; + package = pkgs.papirus-icon-theme; + }; + }; + }; + }; + }; +} diff --git a/modules/gui/wayland.nix b/modules/gui/wayland.nix @@ -1,8 +1,12 @@ -{lib, ...}: { +{ + config, + lib, + ... +}: { options.gui.wayland.enable = lib.mkEnableOption "Enable Wayland Configuration"; ## Wayland Configuration ## - config = { + config = lib.mkIf config.gui.wayland.enable { # Environment Setup environment.sessionVariables = { NIXOS_OZONE_WL = "1";