aboutsummaryrefslogtreecommitdiff
path: root/gui/pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'gui/pkgs')
-rw-r--r--gui/pkgs/tasker.nix47
1 files changed, 29 insertions, 18 deletions
diff --git a/gui/pkgs/tasker.nix b/gui/pkgs/tasker.nix
index a198cb8..2382be2 100644
--- a/gui/pkgs/tasker.nix
+++ b/gui/pkgs/tasker.nix
@@ -1,19 +1,30 @@
-{ stdenv, pkgs, ... }:
+{ pkgs, tasks, ... }:
-pkgs.writeTextFile {
- name = "tasker";
- executable = true;
- destination = "/bin/tasker";
-
- text = with pkgs; ''
- #!${fish}/bin/fish
-
- pushd ~/.local/share/tasks
- set task (find . -executable -type f | cut -c3- | rofi -dmenu -p "task")
-
- if test $status -eq 0
- eval $task
- end
- popd
- '';
-}
+pkgs.lib.mapAttrsToList (name: value: let
+ command = pkgs.writeTextFile {
+ name = "tasker_cmd_" + name;
+ executable = true;
+ destination = "/bin/tasker_cmd_" + name;
+ text = ''
+ #!/bin/sh
+ pushd ${toString value.directory}
+ exec ${toString value.command}
+ popd
+ '';
+ };
+ shortcut = pkgs.writeTextFile {
+ name = "tasker_shortcut_" + name;
+ executable = false;
+ destination = "/share/applications/tasker_shortcut_" + name + ".desktop";
+ text = ''
+ [Desktop Entry]
+ Type=Application
+ Name=${toString value.description}
+ Exec=${command}/bin/tasker_cmd_${toString name}
+ Terminal=false
+ '';
+ };
+in pkgs.symlinkJoin {
+ name = "tasker_task_" + name;
+ paths = [ shortcut ];
+}) tasks