aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rw-r--r--share/hm-modules/tofi.nix57
-rw-r--r--share/home/eww/config/eww.yuck2
-rw-r--r--share/home/hyprdesktop.nix11
-rw-r--r--share/home/tofi.nix26
4 files changed, 90 insertions, 6 deletions
diff --git a/share/hm-modules/tofi.nix b/share/hm-modules/tofi.nix
new file mode 100644
index 0000000..4d6dbee
--- /dev/null
+++ b/share/hm-modules/tofi.nix
@@ -0,0 +1,57 @@
+{ config, lib, pkgs, ... }:
+with lib;
+let
+ cfg = config.programs.tofi;
+
+ format = pkgs.formats.keyValue {
+ mkKeyValue = generators.mkKeyValueDefault
+ {
+ mkValueString = v:
+ if builtins.isBool v then
+ if v then "true" else "false"
+ else if builtins.isString v then
+ ''"${v}"''
+ else generators.mkValueStringDefault { } v;
+ } "=";
+ };
+
+ configFile = format.generate "config" cfg.settings;
+in
+{
+ options.programs.tofi = {
+ enable = mkEnableOption
+ "tofi - An extremely fast and simple dmenu/rofi.";
+
+ package = mkOption {
+ default = pkgs.tofi;
+ defaultText = literalExpression "pkgs.tofi";
+ type = types.package;
+ example = literalExpression "pkgs.tofi";
+ description = "The package to use for the tofi binaries.";
+ };
+
+ settings = mkOption {
+ inherit (format) type;
+ default = { };
+ description = lib.mdDoc ''
+ Tofi configuration. Refer to tofi(5) for supported values.
+ '';
+ example = {
+ font = "Fira Code";
+ font-size = "22";
+
+ width = "1920";
+ terminal = "kitty";
+ };
+ };
+ };
+
+ config = mkIf cfg.enable {
+ home.packages = [ cfg.package ];
+ xdg.configFile.tofi-config = {
+ enable = true;
+ target = "tofi/config";
+ source = configFile;
+ };
+ };
+}
diff --git a/share/home/eww/config/eww.yuck b/share/home/eww/config/eww.yuck
index 1e1a812..6b5b719 100644
--- a/share/home/eww/config/eww.yuck
+++ b/share/home/eww/config/eww.yuck
@@ -2,7 +2,7 @@
(centerbox :orientation "v"
:class "bar"
(workspaces)
- ;; TODO - add a rofi button here
+ ;; TODO - add a command runner button here
""
(sidestuff)))
diff --git a/share/home/hyprdesktop.nix b/share/home/hyprdesktop.nix
index 13701d6..1b66a02 100644
--- a/share/home/hyprdesktop.nix
+++ b/share/home/hyprdesktop.nix
@@ -6,10 +6,12 @@
imports = [
# Custom home manager modules
../hm-modules/wpaperd.nix
+ ../hm-modules/tofi.nix
# Config
./minimal.nix
./wpaperd.nix
+ ./tofi.nix
./eww
./git.nix
./mpv.nix
@@ -29,8 +31,8 @@
};
screenshot = ''grim -g "$(slurp)" -t png - | wl-copy --type image/png'';
cmd = {
- run = "rofi -show run";
- drun = "rofi -show drun";
+ run = "tofi-run";
+ drun = "tofi-drun";
};
brightness = {
increase = "brightnessctl set +5%";
@@ -71,8 +73,8 @@
bind = $mod SHIFT, C, killactive
bind = $mod SHIFT, F, togglefloating
bind = $mod SHIFT, Q, exit
- bind = $mod, P, exec, ${commands.cmd.run}
- bind = $mod SHIFT, P, exec, ${commands.cmd.drun}
+ bind = $mod, P, exec, ${commands.cmd.drun}
+ bind = $mod SHIFT, P, exec, ${commands.cmd.run}
bind = $mod, H, cyclenext, prev
bind = $mod, L, cyclenext
@@ -156,7 +158,6 @@
];
services.dunst.enable = true;
- programs.rofi.enable = true;
programs.direnv = {
enable = true;
diff --git a/share/home/tofi.nix b/share/home/tofi.nix
new file mode 100644
index 0000000..c2cfb93
--- /dev/null
+++ b/share/home/tofi.nix
@@ -0,0 +1,26 @@
+# IMPORTANT: this is the config for a custom module that's located at
+# /share/hm-modules/tofi.nix. In order to use this config you have to also
+# import that module.
+{ ... }: {
+ programs.tofi = {
+ enable = true;
+ settings = {
+ anchor = "top";
+ width = "100%";
+ height = 30;
+ horizontal = true;
+ font-size = 14;
+ prompt-text = " run: ";
+ font = "monospace";
+ outline-width = 0;
+ border-width = 0;
+ background-color = "#000000";
+ min-input-width = 120;
+ result-spacing = 15;
+ padding-top = 0;
+ padding-right = 0;
+ padding-bottom = 0;
+ padding-left = 0;
+ };
+ };
+}