Add icon to pomodoro timer

This commit is contained in:
Jakob Lechner 2025-03-13 15:08:28 +01:00
parent 2dedde53de
commit 7f489b0e5a
3 changed files with 20 additions and 3 deletions

View file

@ -5,6 +5,7 @@
, gnused
, writeShellScript
, makeDesktopItem
, imagemagick
}:
let
@ -27,12 +28,21 @@ stdenv.mkDerivation rec {
dontUnpack = true;
installPhase = ''
icon_size=64x64
dir=$out/share/icons/hicolor/scalable/apps/
mkdir -p $dir
mkdir -p \
$out/share/icons/hicolor/scalable/apps/ \
$out/share/icons/hicolor/$icon_size/apps/
cp $src $dir/pomodorotimer.svg
mkdir $out/bin
cp "${pomodoroTimer}" $out/bin/pomodoro-timer
ln -s "${desktopItem}/share/applications" $out/share/
${imagemagick}/bin/convert \
-size $icon_size \
$src \
$out/share/icons/hicolor/$icon_size/apps/pomodorotimer.png
'';
desktopItem = makeDesktopItem {

View file

@ -34,8 +34,9 @@ lib.mkIf nixosConfig.jalr.gui.enable {
};
sessions =
let
work-finished = "notify-send 'Pomodoro done! Enjoy your break.'; dnd off";
break-finished = "notify-send 'Get back to work!'; dnd on";
notify-send = "notify-send --app-name='Pomodoro timer' --icon='pomodorotimer'";
work-finished = "${notify-send} 'Pomodoro done! Enjoy your break.'; dnd off";
break-finished = "${notify-send} 'Get back to work!'; dnd on";
in
[
{ name = "Work 1"; duration = "25m"; command = work-finished; }

View file

@ -1,3 +1,5 @@
{ pkgs, ... }:
{
xdg.configFile."mako/config".text = ''
[mode=dnd]
@ -6,5 +8,9 @@
[mode=screencast]
icons=0
format=<b>%a</b>
[app-name="Pomodoro timer"]
invisible=0
icon-path="${pkgs.pomodoro-timer}/share/icons/hicolor"
'';
}