aboutsummaryrefslogtreecommitdiff
path: root/gui/pkgs
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-02-24 17:24:47 +0100
committerAdrian Kummerlaender2019-02-24 17:24:47 +0100
commit68e680721c875c5b677b5c60e754cdf81cc0e909 (patch)
tree7ed5c71e5ed55f4ec54b014f53ad7d8ad3fd771d /gui/pkgs
parenta9de76d55ac705e8a50decfba2f11e81fe81b294 (diff)
downloadnixos_home-68e680721c875c5b677b5c60e754cdf81cc0e909.tar
nixos_home-68e680721c875c5b677b5c60e754cdf81cc0e909.tar.gz
nixos_home-68e680721c875c5b677b5c60e754cdf81cc0e909.tar.bz2
nixos_home-68e680721c875c5b677b5c60e754cdf81cc0e909.tar.lz
nixos_home-68e680721c875c5b677b5c60e754cdf81cc0e909.tar.xz
nixos_home-68e680721c875c5b677b5c60e754cdf81cc0e909.tar.zst
nixos_home-68e680721c875c5b677b5c60e754cdf81cc0e909.zip
Define type of task entries
Diffstat (limited to 'gui/pkgs')
-rw-r--r--gui/pkgs/tasker.nix25
1 files changed, 14 insertions, 11 deletions
diff --git a/gui/pkgs/tasker.nix b/gui/pkgs/tasker.nix
index b3cf61b..bc87ee9 100644
--- a/gui/pkgs/tasker.nix
+++ b/gui/pkgs/tasker.nix
@@ -1,19 +1,22 @@
{ pkgs, tasks, ... }:
-pkgs.lib.mapAttrsToList (name: value: let
+pkgs.lib.mapAttrsToList (name: conf: let
command = pkgs.writeTextFile {
name = "tasker_cmd_" + name;
executable = true;
destination = "/bin/tasker_cmd_" + name;
- text = if value.terminal then ''
- #!/bin/sh
- exec ${pkgs.kitty}/bin/kitty -d ${value.directory} ${value.command}
- '' else ''
- #!/bin/sh
- pushd ${value.directory}
- exec ${value.command}
- popd
- '';
+ text = pkgs.lib.attrByPath [ conf.type ] "" {
+ terminal = ''
+ #!/bin/sh
+ exec ${pkgs.kitty}/bin/kitty -d ${conf.directory} ${conf.command}
+ '';
+ launcher = ''
+ #!/bin/sh
+ pushd ${conf.directory}
+ exec ${conf.command}
+ popd
+ '';
+ };
};
shortcut = pkgs.writeTextFile {
name = "tasker_shortcut_" + name;
@@ -22,7 +25,7 @@ pkgs.lib.mapAttrsToList (name: value: let
text = ''
[Desktop Entry]
Type=Application
- Name=${value.description}
+ Name=${conf.description}
GenericName=Tasker
Exec=${command}/bin/tasker_cmd_${name}
Terminal=false