feat: add notion desktop entry

This commit is contained in:
DACHXY 2025-01-14 12:00:16 +08:00
parent c8ef495a63
commit 21be3b127f
8 changed files with 111 additions and 13 deletions

View file

@ -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 &

View file

@ -13,6 +13,7 @@
./swaync.nix
./neovim.nix
./bin.nix
./desktops.nix
inputs.hyprland.homeManagerModules.default
];

69
home/user/desktops.nix Normal file
View file

@ -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 = ''
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg class="wordmark_wordmark__gPyj1" viewBox="-1 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#a)">
<mask id="b" width="29" height="30" x="0" y="0" maskUnits="userSpaceOnUse">
<path fill="#fff" d="M28.714 0H0v29.995h28.714V0Z">
</path>
</mask>
<g mask="url(#b)">
<path fill="#fff" d="M1.805 1.29 18.403.069c2.038-.175 2.563-.057 3.844.873l5.298 3.724c.874.64 1.166.815 1.166 1.513v20.424c0 1.28-.467 2.037-2.097 2.153L7.34 29.919c-1.224.058-1.806-.116-2.447-.931L.99 23.925c-.7-.931-.99-1.628-.99-2.444V3.326c0-1.046.466-1.92 1.805-2.035Z">
</path>
<path class="wordmark_fill__RZFeq" fill="#000" fill-rule="evenodd" d="M18.403.068 1.805 1.291C.466 1.406 0 2.28 0 3.326v18.155c0 .816.29 1.513.99 2.444l3.902 5.063c.64.815 1.223.99 2.447.93l19.275-1.163c1.63-.116 2.097-.873 2.097-2.153V6.178c0-.662-.262-.853-1.034-1.416a89.567 89.567 0 0 1-.132-.097L22.247.941C20.966.011 20.44-.107 18.403.068ZM7.776 5.843c-1.574.106-1.931.13-2.825-.596L2.678 3.443c-.232-.233-.115-.524.467-.581l15.957-1.164c1.339-.117 2.038.35 2.562.756l2.737 1.979c.116.058.407.407.058.407l-16.48.99-.203.013ZM5.94 26.427V9.087c0-.756.233-1.105.932-1.164l18.926-1.105c.642-.058.933.35.933 1.105v17.223c0 .758-.117 1.398-1.166 1.456L7.455 27.65c-1.05.058-1.515-.29-1.515-1.223Zm17.88-16.41c.116.525 0 1.049-.526 1.108l-.872.174v12.8c-.758.408-1.457.64-2.039.64-.932 0-1.165-.29-1.864-1.163l-5.707-8.96v8.67l1.806.407s0 1.047-1.458 1.047l-4.017.233c-.117-.233 0-.815.408-.931l1.048-.29V12.287l-1.456-.117c-.116-.524.174-1.28.99-1.338l4.31-.29 5.94 9.077v-8.03l-1.514-.174c-.117-.641.349-1.107.931-1.164l4.02-.234Z" clip-rule="evenodd">
</path>
</g>
</g>
<defs>
<clipPath id="a">
<path fill="#fff" d="M0 0h104.229v30H0z">
</path>
</clipPath>
</defs>
</svg>
'';
};
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"
];
};
};
}

View file

@ -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''

View file

@ -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''

View file

@ -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;
};

View file

@ -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";
};
}

29
utils/make-icon.nix Normal file
View file

@ -0,0 +1,29 @@
{
pkgs ? import <nixpkgs> { },
...
}:
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