From fcd7bb539aa6930d7cba8381bc9a3b6608ad6393 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Thu, 21 Feb 2019 22:07:25 +0100 Subject: Improvise rofi task launcher `tasker` opens a rofi selection of all scripts found in `~/.local/share/tasks`. This is useful for launching e.g. project specific nix-shells, vim instances and so on. Actual tasks are not included at this point as they are still quite rudimentary. This vision is that this develops into a Nix and XMonad integrated project manager that: * Automatically clones the project repository if it is not already available * Allows for (optional) central management of nix-shell derivations * Allows for easy isolation of project-specific UI utilities * Enables convenient launching of build and test scripts --- gui/conf/xmonad.hs | 1 + gui/kitty.nix | 2 ++ gui/pkgs/tasker.nix | 19 +++++++++++++++++++ gui/xmonad.nix | 6 +++++- 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 gui/pkgs/tasker.nix diff --git a/gui/conf/xmonad.hs b/gui/conf/xmonad.hs index 668d818..f1222a7 100644 --- a/gui/conf/xmonad.hs +++ b/gui/conf/xmonad.hs @@ -145,6 +145,7 @@ commonKeybindings host = , ("C-M1-l" , spawn "i3lock -c 000000") -- application launchers , ("M-" , spawn "rofi -show combi") + , ("C-" , spawn "tasker") , ("M-" , spawn "kitty") , ("M-S-" , spawn "nvim-qt --no-ext-tabline") , ("" , spawn "flameshot gui") diff --git a/gui/kitty.nix b/gui/kitty.nix index cca1b60..8528eb7 100644 --- a/gui/kitty.nix +++ b/gui/kitty.nix @@ -5,6 +5,8 @@ packages = [ pkgs.kitty ]; file.".config/kitty/kitty.conf".text = '' + allow_remote_control yes + font_family Iosevka font_size 9 font_size_delta 1 diff --git a/gui/pkgs/tasker.nix b/gui/pkgs/tasker.nix new file mode 100644 index 0000000..a198cb8 --- /dev/null +++ b/gui/pkgs/tasker.nix @@ -0,0 +1,19 @@ +{ stdenv, pkgs, ... }: + +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 + ''; +} diff --git a/gui/xmonad.nix b/gui/xmonad.nix index 52de48d..f265278 100644 --- a/gui/xmonad.nix +++ b/gui/xmonad.nix @@ -26,9 +26,13 @@ in { }; }; - home.packages = with pkgs; [ + home.packages = let + tasker = pkgs.lib.callPackageWith pkgs ./pkgs/tasker.nix { }; + in with pkgs; [ # lockscreen i3lock + # task launcher + tasker ]; services.screen-locker = { -- cgit v1.2.3