dotfiles

My PC Dotfiles & Website
commit f91dbc7b70472e5f679a58d0a1008677da6aa1c5
parent 5319a4ca0cfd8c76c22764d78d18be8da8ffbd68
Author: maydayv7 <maydayv7@gmail.com>
Date:   Sun, 18 Feb 2024 17:24:51 +0530

fix(Hyprland): QOL Improvements

+ Package `nwg-clipman`
+ Update to latest VS Code

Diffstat:

14 files changed, 134 insertions(+), 39 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml @@ -51,4 +51,7 @@ jobs: name: maydayv7-dotfiles authToken: "${{ secrets.CACHIX_TOKEN }}" - name: Build Configuration - run: nix build .#nixosConfigurations.${{ matrix.device }}.config.system.build.toplevel -L --show-trace + run: | + export LC_ALL=C.UTF-8 + ulimit -n 2048 + nix build .#nixosConfigurations.${{ matrix.device }}.config.system.build.toplevel -L --show-trace diff --git a/files/ulauncher/extensions/com.github.friday.ulauncher-clipboard.db b/files/ulauncher/extensions/com.github.friday.ulauncher-clipboard.db Binary files differ. diff --git a/files/waybar/style.css b/files/waybar/style.css @@ -44,37 +44,41 @@ background-color: @base0A; } +#custom-logo { + color: #ffffff; +} + +#custom-dunst { + color: @base0A; +} + #mpris { color: @base00; background-color: @base05; } -.modules-left #user { - border-top-left-radius: 0px; - border-bottom-left-radius: 0px; +#custom-weather { + color: @base00; + background-color: @base06; } .modules-left image { - padding-left: 6px; + padding-left: 5px; background-color: @base0F; border-top-right-radius: 0px; border-bottom-right-radius: 0px; } -#custom-logo { - color: @base00; - background-color: @base06; -} - -#custom-weather { - color: @base00; - background-color: @base06; +.modules-left #user { + border-top-left-radius: 0px; + border-bottom-left-radius: 0px; } #backlight, #battery, #bluetooth, #clock, +#custom-dunst, #custom-logo, #custom-weather, #keyboard-state, @@ -86,5 +90,5 @@ #window, #wireplumber, #workspaces { - padding: 3px 6px 3px 6px; + padding: 2px 5px 2px 5px; } diff --git a/flake.lock b/flake.lock @@ -999,11 +999,11 @@ }, "unstable": { "locked": { - "lastModified": 1706550542, - "narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=", + "lastModified": 1708118438, + "narHash": "sha256-kk9/0nuVgA220FcqH/D2xaN6uGyHp/zoxPNUmPCMmEE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "97b17f32362e475016f942bbdfda4a4a72a8a652", + "rev": "5863c27340ba4de8f83e7e3c023b9599c3cb3c80", "type": "github" }, "original": { diff --git a/modules/apps/vscode.nix b/modules/apps/vscode.nix @@ -12,8 +12,8 @@ with files.vscode; let font = head config.fonts.fontconfig.defaultFonts.monospace; in { ## Visual Studio Code Editor Configuration ## - config = lib.mkIf enable { - environment.systemPackages = with pkgs; [nil vscode]; + config = lib.mkIf enable rec { + environment.systemPackages = [pkgs.nil user.homeConfig.programs.vscode.package]; user = { persist.directories = [".config/Code" ".vscode"]; @@ -24,7 +24,7 @@ in { programs.vscode = { enable = true; - package = pkgs.vscode; + package = pkgs.unstable.vscode; # Keyboard Shortcuts inherit keybindings; diff --git a/modules/configuration.nix b/modules/configuration.nix @@ -121,6 +121,7 @@ in # Localization time.timeZone = timezone; i18n.defaultLocale = "en_${locale}"; + environment.variables."LC_ALL" = "en_${locale}.UTF-8"; # Package Configuration nixpkgs = {inherit pkgs;}; diff --git a/modules/gui/desktop/hyprland/apps/bar.nix b/modules/gui/desktop/hyprland/apps/bar.nix @@ -75,6 +75,7 @@ in rec { "battery" "custom/weather" "clock" + "custom/dunst" ]; "custom/logo" = { @@ -94,9 +95,9 @@ in rec { all-outputs = true; show-special = true; format = "{icon}"; - on-scroll-up = "hyprctl dispatch workspace e+1"; - on-scroll-down = "hyprctl dispatch workspace e-1"; - persistent-workspaces."*" = 3; + on-scroll-up = "hyprctl dispatch workspace m+1"; + on-scroll-down = "hyprctl dispatch workspace m-1"; + persistent-workspaces."eDP-1" = 3; format-icons = { default = ""; "1" = ""; @@ -121,6 +122,8 @@ in rec { "bash" = "Terminal"; "zsh" = "Terminal"; "(.*) - kitty" = "Terminal"; + "nwg-clipman" = "Clipboard"; + "nwg-displays" = "Displays"; "Ulauncher(.*)" = "Launcher"; "(.*) - Geany" = "Text Editor"; "(.*) - Thunar" = "File Manager"; @@ -151,7 +154,7 @@ in rec { tooltip-format = " {status}"; tooltip-format-connected = "{device_enumerate}"; tooltip-format-enumerate-connected = " {device_alias} 󰂄 {device_battery_percentage}%"; - on-click = "blueberry"; + on-click = "overskride"; }; network = { @@ -191,7 +194,8 @@ in rec { max-volume = 150; scroll-step = 1; reverse-scrolling = 1; - format = "{icon} {volume}%"; + format = "{icon}"; + tooltip-format = "Volume: {volume}\nDevice: {node_name}"; format-muted = " Mute"; format-icons = ["" "" "󰕾" ""]; on-click = "pavucontrol"; @@ -199,7 +203,7 @@ in rec { backlight = { format = "{icon}"; - tooltip-format = "Backlight {percent}%"; + tooltip-format = "Backlight: {percent}%"; format-icons = ["" "" "" "" "" "" "" "" ""]; on-scroll-down = "${pkgs.brillo}/bin/brillo -u 300000 -A 5"; on-scroll-up = "${pkgs.brillo}/bin/brillo -u 300000 -U 5"; @@ -211,7 +215,7 @@ in rec { align = 0; rotate = 0; format = "{icon}"; - tooltip-format = "Battery {capacity}%"; + tooltip-format = "Battery: {capacity}%"; format-charging = ""; format-icons = ["" "" "" "" ""]; states = { @@ -256,6 +260,24 @@ in rec { on-scroll-down = "shift_up"; }; }; + + "custom/dunst" = { + tooltip = false; + on-click = "dunstctl history-pop"; + on-click-right = "dunstctl set-paused toggle"; + restart-interval = 1; + exec = with pkgs; "${writeShellApplication { + name = "notify"; + runtimeInputs = [coreutils dunst]; + text = '' + COUNT=$(dunstctl count waiting) + ENABLED="" + DISABLED="" + if [ "$COUNT" != 0 ]; then DISABLED=" $COUNT"; fi + if dunstctl is-paused | grep -q "false" ; then echo "$ENABLED"; else echo "$DISABLED"; fi + ''; + }}/bin/notify"; + }; } ]; }; diff --git a/modules/gui/desktop/hyprland/apps/default.nix b/modules/gui/desktop/hyprland/apps/default.nix @@ -14,6 +14,7 @@ with files; let in { apps.list = ["firefox"]; gui.launcher.terminal = "kitty"; + xdg.portal.extraPortals = [pkgs.xdg-desktop-portal-gtk]; # File Manager services.tumbler.enable = true; @@ -23,7 +24,6 @@ in { enable = true; plugins = with pkgs.xfce; [ thunar-archive-plugin - thunar-dropbox-plugin thunar-volman ]; }; @@ -37,16 +37,19 @@ in { lollypop mate.atril mission-center + custom.nwg-clipman nwg-displays + unstable.overskride playerctl qalculate-gtk shotwell transmission-gtk # Utilities - blueberry + cliphist grim grimblast + hyprkeys pavucontrol slurp wev @@ -65,6 +68,7 @@ in { ".config/Thunar" ".local/share/lollypop" ".local/share/shotwell" + ".cache/cliphist" ".cache/shotwell" ]; @@ -89,6 +93,7 @@ in { "$mod, F, exec, thunar" "$mod, T, exec, kitty" "$mod, W, exec, firefox" + "$mod, V, exec, nwg-clipman -nw" "$mod, Return, exec, missioncenter" "$mod, N, exec, dunstctl history-pop" "$mod, slash, exec, ulauncher-toggle" @@ -96,6 +101,12 @@ in { "$mod, Escape, exec, wlogout -p layer-shell" ]; + # Clipboard + wayland.windowManager.hyprland.settings.exec-once = [ + "wl-paste --type text --watch cliphist store" + "wl-paste --type image --watch cliphist store" + ]; + # Utilities services.playerctld.enable = true; diff --git a/modules/gui/desktop/hyprland/apps/rules.nix b/modules/gui/desktop/hyprland/apps/rules.nix @@ -9,6 +9,9 @@ _: { ## Window Rules windowrulev2 = [ + # Clipboard + "float, title:^(nwg-clipman)$" + # PiP Window "float, title:^(Picture-in-Picture)$" "pin, title:^(Picture-in-Picture)$" diff --git a/modules/gui/desktop/hyprland/settings/default.nix b/modules/gui/desktop/hyprland/settings/default.nix @@ -20,6 +20,7 @@ settings = { debug.disable_logs = false; env = ["QT_WAYLAND_DISABLE_WINDOWDECORATION,1"]; + exec-once = ["dbus-update-activation-environment --systemd --all"]; # Display monitor = ",preferred,auto,1"; diff --git a/modules/gui/desktop/hyprland/settings/keybindings.nix b/modules/gui/desktop/hyprland/settings/keybindings.nix @@ -1,7 +1,8 @@ -_: { +{sys, ...}: { ## Keybindings wayland.windowManager.hyprland.settings = { "$mod" = "SUPER"; + env = ["SLURP_ARGS, -dc ${sys.lib.stylix.colors.base0A}"]; bind = [ ("$mod SHIFT, slash, exec, xdg-open " + ../README.md) diff --git a/modules/gui/launcher.nix b/modules/gui/launcher.nix @@ -38,13 +38,10 @@ in { ## ULauncher Configuration ## config = mkIf cfg.enable { # Launcher Package - environment.systemPackages = with pkgs; [ulauncher clipman]; + environment.systemPackages = [pkgs.ulauncher]; user = { - persist = { - files = [".local/share/clipman.json"]; - directories = [".config/ulauncher" ".local/share/ulauncher"]; - }; + persist.directories = [".config/ulauncher" ".local/share/ulauncher"]; # Customisation homeConfig = { diff --git a/packages/flake.nix b/packages/flake.nix @@ -15,6 +15,9 @@ in { pkgs, ... }: (let + # Repository Configuration + config = import ../modules/nix/config.nix; + # Package Calling Function call = rec { __functor = _: name: pkg name {}; @@ -41,9 +44,9 @@ in { inherit src patches; name = "nixpkgs-patched-${src.shortRev}"; }) - ) { - inherit system; - config = import ../modules/nix/config.nix; + ) rec { + inherit system config; + overlays = [ nur.overlay vscode-catppuccin.overlays.default @@ -51,7 +54,7 @@ in { nixFlakes = prev.nixVersions.nix_2_19; custom = self.packages."${system}"; - unstable = import unstable {inherit system;}; + unstable = import unstable {inherit system config;}; chaotic = chaotic.packages."${system}"; code = vscode.extensions."${system}"; diff --git a/packages/nwg-clipman.nix b/packages/nwg-clipman.nix @@ -0,0 +1,49 @@ +{ + lib, + pkgs, + ... +}: +with pkgs; + python310Packages.buildPythonApplication rec { + pname = "nwg-clipman"; + version = "0.2.1"; + + src = fetchFromGitHub { + owner = "nwg-piotr"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-nOLd1GmaXflBAZlx4SVxr6PLbXJrQnNN6yUTpeNUd/E="; + }; + + buildInputs = [gtk3]; + nativeBuildInputs = [ + gobject-introspection + wrapGAppsHook + ]; + + propagatedBuildInputs = [ + atk + gdk-pixbuf + gtk-layer-shell + pango + python310Packages.pygobject3 + cliphist + wl-clipboard + xdg-utils + ]; + + dontWrapGApps = true; + doCheck = false; + preFixup = '' + makeWrapperArgs+=("''${gappsWrapperArgs[@]}"); + ''; + + meta = with lib; { + mainProgram = pname; + homepage = "https://github.com/nwg-piotr/nwg-clipman"; + description = "GTK3-based GUI for cliphist"; + license = licenses.mit; + platforms = platforms.linux; + maintainers = ["maydayv7"]; + }; + }