1

Link rofi configs to XDG_CONFIG_DIR depending on theme

This commit is contained in:
2023-05-25 11:23:08 +02:00
parent f7a2259211
commit 6d22fcfb8e
10 changed files with 31 additions and 24 deletions

View File

@ -80,12 +80,12 @@ $mainMod = SUPER
bind = $mainMod, Q, killactive bind = $mainMod, Q, killactive
bind = $mainMod, V, togglefloating bind = $mainMod, V, togglefloating
bind = $mainMod, F, fullscreen bind = $mainMod, F, fullscreen
bind = $mainMod, C, exec, clipman pick --tool=rofi --tool-args="-theme ~/NixFlake/config/rofi/rofi.rasi" # TODO: Theme + Generate this in a include file from nixos, depending on the menu option bind = $mainMod, C, exec, clipman pick --tool=rofi # TODO: Theme + Generate this in a include file from nixos, depending on the menu option
# Rofi # Rofi
bind = $mainMod, A, exec, rofi -show drun -theme ~/NixFlake/config/rofi/rofi.rasi bind = $mainMod, A, exec, rofi -show drun
bind = $mainMod, R, exec, rofi -show run -theme ~/NixFlake/config/rofi/rofi.rasi # bind = $mainMod, R, exec, rofi -show run
bind = $mainMod, B, exec, rofi -show filebrowser -theme ~/NixFlake/config/rofi/rofi.rasi # bind = $mainMod, B, exec, rofi -show filebrowser
bind = $mainMod, D, exec, ~/NixFlake/config/rofi/menus/systemd-podman.fish bind = $mainMod, D, exec, ~/NixFlake/config/rofi/menus/systemd-podman.fish
bind = $mainMod, escape, exec, ~/NixFlake/config/rofi/menus/power.fish bind = $mainMod, escape, exec, ~/NixFlake/config/rofi/menus/power.fish
bind = $mainMod, O, exec, ~/NixFlake/config/rofi/menus/lectures.fish bind = $mainMod, O, exec, ~/NixFlake/config/rofi/menus/lectures.fish

View File

@ -1,3 +1,3 @@
#!/usr/bin/env fish #!/usr/bin/env fish
grep -E "^bind =" ~/NixFlake/config/hyprland/hyprland.conf | sd "bind = " "" | rofi -theme ~/NixFlake/config/rofi/rofi.rasi -dmenu -p "keys" -i grep -E "^bind =" ~/NixFlake/config/hyprland/hyprland.conf | sd "bind = " "" | rofi -dmenu -p " keys " -i

View File

@ -1,13 +1,13 @@
#!/usr/bin/env fish #!/usr/bin/env fish
# User chooses lecture # User chooses lecture
set LECTURE (exa -1 -D ~/Notes/TU | rofi -theme ~/NixFlake/config/rofi/rofi.rasi -dmenu -p "lecture" -i) set LECTURE (exa -1 -D ~/Notes/TU | rofi -dmenu -p " lecture " -i)
if test -z $LECTURE if test -z $LECTURE
exit exit
end end
# User chooses slides # User chooses slides
set DECK (exa -1 ~/Notes/TU/$LECTURE/Lecture | grep ".pdf" | rofi -theme ~/NixFlake/config/rofi/rofi.rasi -dmenu -p "deck" -i) set DECK (exa -1 ~/Notes/TU/$LECTURE/Lecture | grep ".pdf" | rofi -dmenu -p " deck " -i)
if test -z $DECK if test -z $DECK
exit exit
end end

View File

@ -2,7 +2,7 @@
# User chooses option # User chooses option
set OPTIONS "Poweroff" "Reboot" "Reload Hyprland" "Exit Hyprland" set OPTIONS "Poweroff" "Reboot" "Reload Hyprland" "Exit Hyprland"
set OPTION (echo -e (string join "\n" $OPTIONS) | rofi -theme ~/NixFlake/config/rofi/rofi.rasi -dmenu -p "power" -i) set OPTION (echo -e (string join "\n" $OPTIONS) | rofi -dmenu -p " power " -i)
if not contains $OPTION $OPTIONS if not contains $OPTION $OPTIONS
exit exit
end end

View File

@ -11,7 +11,7 @@ for SERVICE in $SERVICES
set PROMPT $PROMPT"<span foreground=\"green\">$SERVICE</span>\n" set PROMPT $PROMPT"<span foreground=\"green\">$SERVICE</span>\n"
end end
end end
set SERVICE (echo -e $PROMPT | rofi -theme ~/NixFlake/config/rofi/rofi.rasi -dmenu -p "pod" -i -markup-rows) set SERVICE (echo -e $PROMPT | rofi -dmenu -p " pod " -i -markup-rows)
set SERVICE (echo -e $SERVICE | sd "<.*?>" "") set SERVICE (echo -e $SERVICE | sd "<.*?>" "")
if not contains $SERVICE $SERVICES if not contains $SERVICE $SERVICES
exit exit
@ -19,7 +19,7 @@ end
# User chooses action # User chooses action
set ACTIONS "start" "stop" "restart" "status" set ACTIONS "start" "stop" "restart" "status"
set ACTION (echo -e (string join "\n" $ACTIONS) | rofi -theme ~/NixFlake/config/rofi/rofi.rasi -dmenu -p "action" -i) set ACTION (echo -e (string join "\n" $ACTIONS) | rofi -dmenu -p " action " -i)
if not contains $ACTION $ACTIONS if not contains $ACTION $ACTIONS
exit exit
end end

View File

@ -11,7 +11,7 @@ for SERVER in $SERVERS
set PROMPT $PROMPT"<span foreground=\"green\">$SERVER</span>\n" set PROMPT $PROMPT"<span foreground=\"green\">$SERVER</span>\n"
end end
end end
set SERVER (echo -e $PROMPT | rofi -theme ~/NixFlake/config/rofi/rofi.rasi -dmenu -p "vpn" -i -markup-rows) set SERVER (echo -e $PROMPT | rofi -dmenu -p " vpn " -i -markup-rows)
set SERVER (echo -e $SERVER | sd "<.*?>" "") set SERVER (echo -e $SERVER | sd "<.*?>" "")
if not contains $SERVER $SERVERS if not contains $SERVER $SERVERS
exit exit
@ -19,7 +19,7 @@ end
# User chooses action # User chooses action
set ACTIONS "start" "stop" "status" set ACTIONS "start" "stop" "status"
set ACTION (echo -e (string join "\n" $ACTIONS) | rofi -theme ~/NixFlake/config/rofi/rofi.rasi -dmenu -p "action" -i) set ACTION (echo -e (string join "\n" $ACTIONS) | rofi -dmenu -p " action " -i)
if not contains $ACTION $ACTIONS if not contains $ACTION $ACTIONS
exit exit
end end

View File

@ -16,7 +16,7 @@ configuration{
sidebar-mode: false; sidebar-mode: false;
} }
@import "colors/three-bears.rasi" @theme "colors.rasi"
element-text, element-text,
element-icon, element-icon,

View File

@ -170,6 +170,7 @@ rec {
rofi = { rofi = {
enable = true; enable = true;
theme = "Three-Bears";
}; };
vscode.enable = true; vscode.enable = true;

View File

@ -15,18 +15,18 @@ in {
options.modules.rofi = import ./options.nix {inherit lib mylib;}; options.modules.rofi = import ./options.nix {inherit lib mylib;};
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.rofi = { home.packages = with pkgs; [
enable = true; rofi-wayland
package = pkgs.rofi-wayland; ];
plugins = [
pkgs.keepmenu # TODO: Rofi KeepassXC frontend
];
# NOTE: Don't use this, use the configfile for hot-reload home.activation = {
# terminal = "${pkgs.kitty}/bin/kitty"; # NOTE: Keep the rofi config symlinked, to allow easy changes with hotreload
# font = "JetBrains Mono 14"; linkRofiConfig =
# theme = hm.dag.entryAfter ["writeBoundary"]
# extraConfig = ''''; (mkLink "~/NixFlake/config/rofi/rofi.rasi" "~/.config/rofi/config.rasi");
linkRofiColors =
hm.dag.entryAfter ["writeBoundary"]
(mkLink "~/NixFlake/config/rofi/colors/${cfg.theme}.rasi" "~/.config/rofi/colors.rasi");
}; };
}; };
} }

View File

@ -6,4 +6,10 @@
with lib; with lib;
with mylib.modules; { with mylib.modules; {
enable = mkEnableOpt "Rofi"; enable = mkEnableOpt "Rofi";
theme = mkOption {
type = types.str;
example = "Three-Bears";
description = "Color theme to use";
};
} }