diff --git a/home/config/scripts/waybarRestart.sh b/home/config/scripts/waybarRestart.sh index c4d7562..e23bace 100755 --- a/home/config/scripts/waybarRestart.sh +++ b/home/config/scripts/waybarRestart.sh @@ -2,7 +2,7 @@ #Restart Waybar and swaync XDG_CONFIG_HOME="$HOME/.dummy" # Prevent swaync use default gtk theme -killall .waybar-wrapped -killall .swaync-wrapped +pkill -f waybar +pkill -f swaync waybar -c ~/.config/waybar/config.json -s ~/.config/waybar/style.css & swaync -c ~/.config/swaync/config.json -s ~/.config/swaync/style.css & diff --git a/home/user/default.nix b/home/user/default.nix index a489f17..98aab55 100644 --- a/home/user/default.nix +++ b/home/user/default.nix @@ -13,6 +13,7 @@ ./swaync.nix ./neovim.nix ./bin.nix + ./desktops.nix inputs.hyprland.homeManagerModules.default ]; diff --git a/home/user/desktops.nix b/home/user/desktops.nix new file mode 100644 index 0000000..a223a2e --- /dev/null +++ b/home/user/desktops.nix @@ -0,0 +1,69 @@ +{ + lib, + pkgs, + config, + ... +}: +let + browser = "firefox"; + iconPrefix = ".local/share/icons/hicolor/scalable/apps"; + newWindow = "${browser} --new-window"; + mkIconPkg = import ../../utils/make-icon.nix { }; + notionIcon = mkIconPkg { + name = "notion"; + url = ""; + sha256 = ""; + }; +in +{ + # Update icon cache + home.activation = { + updateIconCache = lib.hm.dag.entryAfter [ "linkGeneration" ] '' + $DRY_RUN_CMD ${pkgs.gtk3}/bin/gtk-update-icon-cache -t -f ~/.local/share/icons/hicolor + ''; + }; + + home.file = { + "${iconPrefix}/notion.svg".text = '' + + + + + + + + + + + + + + + + + + + + + + ''; + }; + + home.packages = [ + ]; + + xdg.desktopEntries = { + notion = { + name = "Notion"; + genericName = "Note"; + exec = "${newWindow} https://notion.so"; + comment = "Note Take Application"; + icon = "${config.home.homeDirectory}/${iconPrefix}/notion.svg"; + terminal = false; + categories = [ + "Office" + "Utility" + ]; + }; + }; +} diff --git a/home/user/hypr/bind.nix b/home/user/hypr/bind.nix index ec59592..8cde772 100644 --- a/home/user/hypr/bind.nix +++ b/home/user/hypr/bind.nix @@ -1,7 +1,6 @@ { mainMod, nvidia-offload-enabled }: let prefix = if nvidia-offload-enabled then "offload " else ""; - uwsm = "uwsm app --"; browser = "${prefix}firefox"; terminal = "${prefix}ghostty"; filemanager = "nemo"; @@ -25,7 +24,7 @@ in ''${mainMod}, E, exec, ${filemanager}'' ''${mainMod}, V, togglefloating, '' ''ALT, SPACE, exec, rofi -config ~/.config/rofi/apps.rasi -show drun'' - ''${mainMod} ALT, W, exec, ${uwsm} ${scripts}/waybarRestart.sh'' + ''${mainMod} ALT, W, exec, ${scripts}/waybarRestart.sh'' ''${mainMod}, P, pseudo, # dwindle'' ''${mainMod}, S, togglesplit, # dwindle'' ''CTRL ${mainMod} SHIFT, L, exec, hyprlock'' diff --git a/home/user/hypr/exec.nix b/home/user/hypr/exec.nix index f584aec..2a30bfb 100644 --- a/home/user/hypr/exec.nix +++ b/home/user/hypr/exec.nix @@ -18,16 +18,16 @@ let dconf write /org/gnome/desktop/interface/cursor-size ${xcursor-size} & - uwsm app -- ${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1 & - uwsm app -- ${swayncScript}/bin/swaync-start & + ${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1 & + ${swayncScript}/bin/swaync-start & dbus-update-activation-environment --systemd --all & systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP & - uwsm app -- hyprpaper & - uwsm app -- waybar -c ~/.config/waybar/config.json -s ~/.config/waybar/style.css & + hyprpaper & + waybar -c ~/.config/waybar/config.json -s ~/.config/waybar/style.css & systemctl --user enable --now hypridle.service & - uwsm fcitx5 -rd & - uwsm app -- fcitx5-remote -r & - uwsm app -- hyprsunset -t 3000k + fcitx5 -rd & + fcitx5-remote -r & + hyprsunset -t 3000k ''; in ''${startupScript}/bin/start'' diff --git a/system/modules/hyprland.nix b/system/modules/hyprland.nix index 33414b9..62c47ee 100644 --- a/system/modules/hyprland.nix +++ b/system/modules/hyprland.nix @@ -6,7 +6,7 @@ { programs.hyprland = { enable = true; - withUWSM = true; + withUWSM = false; package = inputs.hyprland.packages."${pkgs.system}".hyprland; portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland; }; diff --git a/system/modules/nvidia.nix b/system/modules/nvidia.nix index d55fcc6..a64b993 100644 --- a/system/modules/nvidia.nix +++ b/system/modules/nvidia.nix @@ -101,6 +101,6 @@ lib.checkListOfEnum "Nvidia Prime Mode" validModes [ nvidia-mode ] { INTEL_GPU_MIN_FREQ_ON_AC = "500"; # If multiple monitors are connected to dGPU & iGPU, # make sure to put the iGPU first - AQ_DRM_DEVICES = "/dev/dri/card1:/dev/dri/card0"; + # AQ_DRM_DEVICES = "/dev/dri/card1:/dev/dri/card0"; }; } diff --git a/utils/make-icon.nix b/utils/make-icon.nix new file mode 100644 index 0000000..210f9be --- /dev/null +++ b/utils/make-icon.nix @@ -0,0 +1,29 @@ +{ + pkgs ? import { }, + ... +}: +let + makeIconPkg = + { + name, + url, + sha256, + }: + pkgs.stdenvNoCC.mkDerivation rec { + inherit name; + pname = name; + + src = pkgs.fetchurl { + inherit url sha256; + }; + + dontUnpack = true; + + buildInputs = [ ]; + installPhase = '' + mkdir -p $out/share/icons + cp -r $src $out/share/icons + ''; + }; +in +makeIconPkg