add: desktop entry for google calendar
This commit is contained in:
parent
8c739b17f1
commit
3a0bd5f83a
2 changed files with 66 additions and 47 deletions
|
|
@ -8,10 +8,18 @@ let
|
||||||
browser = "firefox";
|
browser = "firefox";
|
||||||
iconPrefix = ".local/share/icons/hicolor/scalable/apps";
|
iconPrefix = ".local/share/icons/hicolor/scalable/apps";
|
||||||
newWindow = "${browser} --new-window";
|
newWindow = "${browser} --new-window";
|
||||||
mkIconPkg = pkgs.callPackage ../../utils/make-icon.nix { };
|
googleCalendarIcon = pkgs.callPackage (import ../../utils/make-icon.nix {
|
||||||
|
name = "google-calendar";
|
||||||
|
url = "https://ssl.gstatic.com/calendar/images/dynamiclogo_2020q4/calendar_6_2x.png";
|
||||||
|
sha256 = "sha256-IODUWX9m0iwunJWPJv1kw5gfgDPvAZtmD8vcSTEBjsQ=";
|
||||||
|
}) { };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# Update icon cache
|
home.packages = [
|
||||||
|
googleCalendarIcon
|
||||||
|
];
|
||||||
|
|
||||||
|
# UpdamkIconPkg te icon cache
|
||||||
home.activation = {
|
home.activation = {
|
||||||
updateIconCache = lib.hm.dag.entryAfter [ "linkGeneration" ] ''
|
updateIconCache = lib.hm.dag.entryAfter [ "linkGeneration" ] ''
|
||||||
$DRY_RUN_CMD ${pkgs.gtk3}/bin/gtk-update-icon-cache -t -f ~/.local/share/icons/hicolor
|
$DRY_RUN_CMD ${pkgs.gtk3}/bin/gtk-update-icon-cache -t -f ~/.local/share/icons/hicolor
|
||||||
|
|
@ -22,7 +30,7 @@ in
|
||||||
"${iconPrefix}/notion.svg".text = ''
|
"${iconPrefix}/notion.svg".text = ''
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?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">
|
<svg class="wordmark_wordmark__gPyj1" viewBox="-1 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<g clip-path="url(#a)">
|
<g clip-path="url(c.com/calendar/images/dynamiclogo_2020q4/calendar_6_2x.png#a)">
|
||||||
<mask id="b" width="29" height="30" x="0" y="0" maskUnits="userSpaceOnUse">
|
<mask id="b" width="29" height="30" x="0" y="0" maskUnits="userSpaceOnUse">
|
||||||
<path fill="#fff" d="M28.714 0H0v29.995h28.714V0Z">
|
<path fill="#fff" d="M28.714 0H0v29.995h28.714V0Z">
|
||||||
</path>
|
</path>
|
||||||
|
|
@ -57,5 +65,17 @@ in
|
||||||
"Utility"
|
"Utility"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
google-calendar = {
|
||||||
|
name = "Google Calendar";
|
||||||
|
genericName = "Calendar";
|
||||||
|
exec = "${pkgs.xdg-utils}/bin/xdg-open https://calendar.google.com/u/2/r";
|
||||||
|
comment = "Google Calendar";
|
||||||
|
icon = "google-calendar";
|
||||||
|
terminal = false;
|
||||||
|
categories = [
|
||||||
|
"Office"
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,52 +1,51 @@
|
||||||
{
|
{
|
||||||
pkgs ? import <nixpkgs> { },
|
name,
|
||||||
|
url,
|
||||||
|
sha256,
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
imagemagick,
|
imagemagick,
|
||||||
file,
|
file,
|
||||||
stdenvNoCC,
|
stdenvNoCC,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
makeIconPkg =
|
appName = name;
|
||||||
{
|
|
||||||
name,
|
|
||||||
url,
|
|
||||||
sha256,
|
|
||||||
}:
|
|
||||||
stdenvNoCC.mkDerivation rec {
|
|
||||||
inherit name;
|
|
||||||
pname = name;
|
|
||||||
|
|
||||||
src = pkgs.fetchurl {
|
|
||||||
inherit url sha256;
|
|
||||||
};
|
|
||||||
|
|
||||||
dontUnpack = true;
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
imagemagick
|
|
||||||
file
|
|
||||||
];
|
|
||||||
|
|
||||||
buildPhase = ''
|
|
||||||
mkdir -p $out/share/icons/hicolor/256x256/apps
|
|
||||||
mkdir -p $out/share/icons/hicolor/scalable/apps
|
|
||||||
|
|
||||||
fileType=$(file -b --mime-type $src)
|
|
||||||
if [ "$fileType" = "image/png" ]; then
|
|
||||||
echo "Processing PNG image..."
|
|
||||||
magick $src -resize 256x256 $out/share/icons/hicolor/256x256/apps/${name}.png
|
|
||||||
elif [ "$fileType" = "image/svg+xml" ]; then
|
|
||||||
echo "Processing SVG image..."
|
|
||||||
cp $src $out/share/icons/hicolor/scalable/apps/${name}.svg
|
|
||||||
else
|
|
||||||
echo "Unsupported image type: $fileType"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
|
|
||||||
pathsToLink = [
|
|
||||||
"/share/icons"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
makeIconPkg
|
stdenvNoCC.mkDerivation rec {
|
||||||
|
pname = "${appName}-icon";
|
||||||
|
name = pname;
|
||||||
|
|
||||||
|
src = pkgs.fetchurl {
|
||||||
|
inherit url sha256;
|
||||||
|
};
|
||||||
|
|
||||||
|
dontUnpack = true;
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
imagemagick
|
||||||
|
file
|
||||||
|
];
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
mkdir -p $out/share/icons/hicolor/256x256/apps
|
||||||
|
mkdir -p $out/share/icons/hicolor/scalable/apps
|
||||||
|
|
||||||
|
fileType=$(file -b --mime-type $src)
|
||||||
|
if [ "$fileType" = "image/png" ]; then
|
||||||
|
echo "Processing PNG image..."
|
||||||
|
magick $src -resize 256x256 $out/share/icons/hicolor/256x256/apps/${appName}.png
|
||||||
|
elif [ "$fileType" = "image/svg+xml" ]; then
|
||||||
|
echo "Processing SVG image..."
|
||||||
|
cp $src $out/share/icons/hicolor/scalable/apps/${appName}.svg
|
||||||
|
else
|
||||||
|
echo "Unsupported image type: $fileType"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
|
pathsToLink = [
|
||||||
|
"/share/icons"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue