c603422085
Handles both history and bookmarks. Also, rewritten in ruby.
70 lines
1.8 KiB
Nix
70 lines
1.8 KiB
Nix
{ config, options, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
with lib.my;
|
|
let cfg = config.modules.desktop.apps.rofi;
|
|
in {
|
|
options.modules.desktop.apps.rofi = {
|
|
enable = mkBoolOpt false;
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
# link recursively so other modules can link files in its folder
|
|
# home.xdg.configFile."rofi" = {
|
|
# source = <config/rofi>;
|
|
# recursive = true;
|
|
# };
|
|
|
|
user.packages = with pkgs; [
|
|
(writeScriptBin "rofi" ''
|
|
#!${stdenv.shell}
|
|
exec ${pkgs.rofi}/bin/rofi -terminal xst -m -1 "$@"
|
|
'')
|
|
|
|
# For rapidly test changes to rofi's stylesheets
|
|
# (writeScriptBin "rofi-test" ''
|
|
# #!${stdenv.shell}
|
|
# themefile=$1
|
|
# themename=${my.theme.name}
|
|
# shift
|
|
# exec rofi \
|
|
# -theme ${themesDir}/$themename/rofi/$themefile \
|
|
# "$@"
|
|
# '')
|
|
|
|
# Fake rofi dmenu entries
|
|
(makeDesktopItem {
|
|
name = "rofi-browsermenu";
|
|
desktopName = "Open Bookmark in Browser";
|
|
icon = "bookmark-new-symbolic";
|
|
exec = "${binDir}/rofi/browsermenu";
|
|
})
|
|
(makeDesktopItem {
|
|
name = "rofi-browsermenu-history";
|
|
desktopName = "Open Browser History";
|
|
icon = "accessories-clock";
|
|
exec = "${binDir}/rofi/browsermenu history";
|
|
})
|
|
(makeDesktopItem {
|
|
name = "rofi-filemenu";
|
|
desktopName = "Open Directory in Terminal";
|
|
icon = "folder";
|
|
exec = "${binDir}/rofi/filemenu";
|
|
})
|
|
(makeDesktopItem {
|
|
name = "rofi-filemenu-scratch";
|
|
desktopName = "Open Directory in Scratch Terminal";
|
|
icon = "folder";
|
|
exec = "${binDir}/rofi/filemenu -x";
|
|
})
|
|
|
|
(makeDesktopItem {
|
|
name = "lock-display";
|
|
desktopName = "Lock screen";
|
|
icon = "system-lock-screen";
|
|
exec = "${binDir}/zzz";
|
|
})
|
|
];
|
|
};
|
|
}
|