feat: add tofi module
This commit is contained in:
parent
ac9b136e6c
commit
006c4394f3
5 changed files with 67 additions and 1 deletions
|
|
@ -30,7 +30,7 @@ in
|
|||
programs = {
|
||||
wallpaper.enable = true;
|
||||
foot.enable = true;
|
||||
rofi.enable = true;
|
||||
tofi.enable = true;
|
||||
};
|
||||
wallpapers.enable = true;
|
||||
services = {
|
||||
|
|
@ -59,6 +59,7 @@ in
|
|||
"Super Q" = "close";
|
||||
"Super Return" = "spawn footclient";
|
||||
"Super+Shift Return" = "spawn foot";
|
||||
"Super R" = ''spawn 'exec $(tofi-run --fuzzy-match=true)' '';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
44
modules/programs/tofi.nix
Normal file
44
modules/programs/tofi.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.programs.tofi;
|
||||
|
||||
configText =
|
||||
let
|
||||
settingsStrings = mapAttrsToList (name: value: "${name} = ${value}") cfg.settings;
|
||||
in
|
||||
concatLines settingsStrings;
|
||||
in
|
||||
{
|
||||
options.my.programs.tofi = {
|
||||
enable = mkEnableOption "tofi";
|
||||
settings = mkOption {
|
||||
type = with types; attrsOf str;
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
(lib.mkIf config.networking.networkmanager.enable networkmanager_dmenu)
|
||||
# (lib.mkIf config.hardware.bluetooth.enable rofi-bluetooth)
|
||||
# rofi-power-menu
|
||||
];
|
||||
home-manager.users.moritz = {
|
||||
home.packages = with pkgs; [ tofi ];
|
||||
xdg = {
|
||||
enable = true;
|
||||
configFile."tofi/config".text = configText;
|
||||
configFile."networkmanager-dmenu/config.ini".text = ''
|
||||
[dmenu]
|
||||
dmenu_command = tofi
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue