helm/modules/desktop/apps/rofi.nix
Henrik Lissner e05eec07ef
Remove shut down, reboot & sleep actions from rofi
Twice. I've accidentally hit "Reboot" twice, in the past two weeks.

So let's not make this so easy to do...
2020-05-02 13:07:27 -04:00

67 lines
1.8 KiB
Nix

{ config, options, lib, pkgs, ... }:
with lib;
{
options.modules.desktop.apps.rofi = {
enable = mkOption {
type = types.bool;
default = false;
};
};
config = mkIf config.modules.desktop.apps.rofi.enable {
my = {
# link recursively so other modules can link files in its folder
# home.xdg.configFile."rofi" = {
# source = <config/rofi>;
# recursive = true;
# };
packages = with pkgs; [
(writeScriptBin "rofi" ''
#!${stdenv.shell}
exec ${rofi}/bin/rofi -terminal xst -m -1 "$@"
'')
# For rapidly test changes to rofi's stylesheets
# (writeScriptBin "rofi-test" ''
# #!${stdenv.shell}
# themefile=$1
# themename=${modules.theme.name}
# shift
# exec rofi \
# -theme ~/.dotfiles/modules/themes/$themename/rofi/$themefile \
# "$@"
# '')
# Fake rofi dmenu entries
(makeDesktopItem {
name = "rofi-bookmarkmenu";
desktopName = "Open Bookmark in Browser";
icon = "bookmark-new-symbolic";
exec = "${<bin/rofi/bookmarkmenu>}";
})
(makeDesktopItem {
name = "rofi-filemenu";
desktopName = "Open Directory in Terminal";
icon = "folder";
exec = "${<bin/rofi/filemenu>}";
})
(makeDesktopItem {
name = "rofi-filemenu-scratch";
desktopName = "Open Directory in Scratch Terminal";
icon = "folder";
exec = "${<bin/rofi/filemenu>} -x";
})
(makeDesktopItem {
name = "lock-display";
desktopName = "Lock screen";
icon = "system-lock-screen";
exec = "${<bin/zzz>}";
})
];
};
};
}