diff options
author | Adrian Kummerlaender | 2019-02-21 22:07:25 +0100 |
---|---|---|
committer | Adrian Kummerlaender | 2019-02-21 22:08:42 +0100 |
commit | fcd7bb539aa6930d7cba8381bc9a3b6608ad6393 (patch) | |
tree | 7edf1abd0975deb7479e958d379376fe90c3642e | |
parent | ace68795852046efab4918bfe25572c1978d5ed7 (diff) | |
download | nixos_home-fcd7bb539aa6930d7cba8381bc9a3b6608ad6393.tar nixos_home-fcd7bb539aa6930d7cba8381bc9a3b6608ad6393.tar.gz nixos_home-fcd7bb539aa6930d7cba8381bc9a3b6608ad6393.tar.bz2 nixos_home-fcd7bb539aa6930d7cba8381bc9a3b6608ad6393.tar.lz nixos_home-fcd7bb539aa6930d7cba8381bc9a3b6608ad6393.tar.xz nixos_home-fcd7bb539aa6930d7cba8381bc9a3b6608ad6393.tar.zst nixos_home-fcd7bb539aa6930d7cba8381bc9a3b6608ad6393.zip |
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
-rw-r--r-- | gui/conf/xmonad.hs | 1 | ||||
-rw-r--r-- | gui/kitty.nix | 2 | ||||
-rw-r--r-- | gui/pkgs/tasker.nix | 19 | ||||
-rw-r--r-- | gui/xmonad.nix | 6 |
4 files changed, 27 insertions, 1 deletions
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-<Space>" , spawn "rofi -show combi") + , ("C-<Space>" , spawn "tasker") , ("M-<Return>" , spawn "kitty") , ("M-S-<Return>" , spawn "nvim-qt --no-ext-tabline") , ("<Print>" , 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 = { |