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, V, togglefloating
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
bind = $mainMod, A, exec, rofi -show drun -theme ~/NixFlake/config/rofi/rofi.rasi
bind = $mainMod, R, exec, rofi -show run -theme ~/NixFlake/config/rofi/rofi.rasi
bind = $mainMod, B, exec, rofi -show filebrowser -theme ~/NixFlake/config/rofi/rofi.rasi
bind = $mainMod, A, exec, rofi -show drun
# bind = $mainMod, R, exec, rofi -show run
# bind = $mainMod, B, exec, rofi -show filebrowser
bind = $mainMod, D, exec, ~/NixFlake/config/rofi/menus/systemd-podman.fish
bind = $mainMod, escape, exec, ~/NixFlake/config/rofi/menus/power.fish
bind = $mainMod, O, exec, ~/NixFlake/config/rofi/menus/lectures.fish

View File

@ -1,3 +1,3 @@
#!/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
# 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
exit
end
# 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
exit
end

View File

@ -2,7 +2,7 @@
# User chooses option
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
exit
end

View File

@ -11,7 +11,7 @@ for SERVICE in $SERVICES
set PROMPT $PROMPT"<span foreground=\"green\">$SERVICE</span>\n"
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 "<.*?>" "")
if not contains $SERVICE $SERVICES
exit
@ -19,7 +19,7 @@ end
# User chooses action
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
exit
end

View File

@ -11,7 +11,7 @@ for SERVER in $SERVERS
set PROMPT $PROMPT"<span foreground=\"green\">$SERVER</span>\n"
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 "<.*?>" "")
if not contains $SERVER $SERVERS
exit
@ -19,7 +19,7 @@ end
# User chooses action
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
exit
end

View File

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

View File

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

View File

@ -15,18 +15,18 @@ in {
options.modules.rofi = import ./options.nix {inherit lib mylib;};
config = mkIf cfg.enable {
programs.rofi = {
enable = true;
package = pkgs.rofi-wayland;
plugins = [
pkgs.keepmenu # TODO: Rofi KeepassXC frontend
home.packages = with pkgs; [
rofi-wayland
];
# NOTE: Don't use this, use the configfile for hot-reload
# terminal = "${pkgs.kitty}/bin/kitty";
# font = "JetBrains Mono 14";
# theme =
# extraConfig = '''';
home.activation = {
# NOTE: Keep the rofi config symlinked, to allow easy changes with hotreload
linkRofiConfig =
hm.dag.entryAfter ["writeBoundary"]
(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 mylib.modules; {
enable = mkEnableOpt "Rofi";
theme = mkOption {
type = types.str;
example = "Three-Bears";
description = "Color theme to use";
};
}