From 9dac733319bce3684636f1cdf6565859024e9df1 Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Mon, 14 Oct 2024 15:00:53 +0200 Subject: [PATCH] Rofi: Update colorscheme + menus --- config/rofi/colors/Foggy-Lake.rasi | 7 - config/rofi/colors/Three-Bears.rasi | 16 -- config/rofi/rofi.rasi | 100 ------------ config/stablediffusion/launch.sh | 14 -- home/modules/rofi/default.nix | 144 ++++++++++++++++-- .../modules}/rofi/menus/keybinds.fish | 0 .../modules}/rofi/menus/lectures.fish | 0 {config => home/modules}/rofi/menus/vpn.fish | 0 8 files changed, 134 insertions(+), 147 deletions(-) delete mode 100644 config/rofi/colors/Foggy-Lake.rasi delete mode 100644 config/rofi/colors/Three-Bears.rasi delete mode 100644 config/rofi/rofi.rasi delete mode 100755 config/stablediffusion/launch.sh rename {config => home/modules}/rofi/menus/keybinds.fish (100%) rename {config => home/modules}/rofi/menus/lectures.fish (100%) rename {config => home/modules}/rofi/menus/vpn.fish (100%) diff --git a/config/rofi/colors/Foggy-Lake.rasi b/config/rofi/colors/Foggy-Lake.rasi deleted file mode 100644 index e69edb54..00000000 --- a/config/rofi/colors/Foggy-Lake.rasi +++ /dev/null @@ -1,7 +0,0 @@ -* { - bg-col-op: rgba(239, 241, 245, 100%); - bg-col: rgba(239, 241, 245, 60%); - fg-col: #4c4f69; - pink: #d20f39; - trans: rgba(255, 255, 255, 0); -} \ No newline at end of file diff --git a/config/rofi/colors/Three-Bears.rasi b/config/rofi/colors/Three-Bears.rasi deleted file mode 100644 index 48bd320b..00000000 --- a/config/rofi/colors/Three-Bears.rasi +++ /dev/null @@ -1,16 +0,0 @@ -* { - dark: #2A231C; - light: #EBEBE5; - accent-dark: #463A2E; - accent-light: #865E43; - - pastel-a: #797D62; - pastel-b: #9B9B7A; - pastel-c: #D9AE94; - pastel-d: #E5C59E; - pastel-e: #F1DCA7; - pastel-f: #F8D488; - pastel-g: #E4B074; - pastel-h: #D08C60; - pastel-i: #997B66; -} diff --git a/config/rofi/rofi.rasi b/config/rofi/rofi.rasi deleted file mode 100644 index 0ac060b7..00000000 --- a/config/rofi/rofi.rasi +++ /dev/null @@ -1,100 +0,0 @@ -/*See https://github.com/davatorium/rofi/blob/1.7.3/doc/rofi-theme.5.markdown#basic-structure-1*/ - -configuration{ - modi: "run,drun,ssh,filebrowser"; - font: "JetBrainsMono Nerd Font Mono 14"; - show-icons: true; - icon-theme: "Papirus"; - /*terminal: "alacritty -o font.size=12";*/ - terminal: "kitty"; - drun-display-format: "{icon} {name}"; - disable-history: false; - hide-scrollbar: true; - display-drun: " apps "; - display-run: " run "; - display-filebrowser: " file "; - display-ssh: " ssh "; - sidebar-mode: false; -} - -@theme "colors.rasi" - -element-text, -element-icon, -mode-switcher { - background-color: inherit; - text-color: inherit; -} - -window { - height: 500px; - width: 700px; - border-radius: 0px; - background-color: @bg-col; -} - -mainbox { - background-color: @trans; -} - -message { - background-color: @trans; -} - -error-message { - background-color: @trans; - margin: 0px 0px 20px 0px; -} - -textbox { - background-color: @trans; - padding: 6px; - margin: 20px 20px 0px 20px; - border-radius: 3; -} - -inputbar { - children: [prompt,entry]; - background-color: @trans; -} - -prompt { - background-color: @pink; - padding: 6px; - text-color: @bg-col-op; - border-radius: 3px; - margin: 20px 0px 0px 20px; -} - -entry { - padding: 6px; - margin: 20px 20px 0px 10px; - text-color: @fg-col; - background-color: @trans; - border-radius: 3px; -} - -listview { - border: 0px 0px 0px; - padding: 6px 0px 0px; - margin: 10px 0px 0px 20px; - columns: 1; - background-color: @trans; -} - -element { - padding: 5px; - margin: 0px 20px 0px 0px; - background-color: @trans; - text-color: @pink; - border-radius: 3px; -} - -element-icon { - size: 25px; -} - -element selected { - background-color: @pink; - text-color: @bg-col-op; -} diff --git a/config/stablediffusion/launch.sh b/config/stablediffusion/launch.sh deleted file mode 100755 index c5e1f65d..00000000 --- a/config/stablediffusion/launch.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -# NOTE: This script is used in conjunction with the rocm/python docker image - -# Install if necessary -if [[ ! -f "/webui-data/stable-diffusion-webui/launch.py" ]]; then - cd /webui-data - git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui - cd stable-diffusion-webui - python -m pip install --upgrade pip wheel -fi - -cd /webui-data/stable-diffusion-webui -REQS_FILE='requirements.txt' python launch.py --precision full --no-half diff --git a/home/modules/rofi/default.nix b/home/modules/rofi/default.nix index 9d4799e1..8fc09b7c 100644 --- a/home/modules/rofi/default.nix +++ b/home/modules/rofi/default.nix @@ -7,14 +7,134 @@ pkgs, ... }: let - cfg = config.modules.rofi; + inherit (config.modules) rofi color; in { options.modules.rofi = import ./options.nix {inherit lib mylib;}; - config = lib.mkIf cfg.enable { - home.packages = with pkgs; [ - rofi-wayland - ]; + config = lib.mkIf rofi.enable { + programs.rofi = { + enable = true; + package = pkgs.rofi-wayland; + terminal = "kitty"; + font = "${color.font} 14"; + location = "center"; + cycle = true; + + extraConfig = { + modi = "run,drun,ssh,filebrowser"; + show-icons = true; + icon-theme = "Papirus"; + drun-display-format = "{icon} {name}"; + disable-history = false; + hide-scrollbar = true; + display-drun = " apps "; + display-run = " run "; + display-filebrowser = " file "; + display-ssh = " ssh "; + sidebar-mode = false; + }; + + # bg-col: rgba(239, 241, 245, 60%); + theme = let + inherit (config.lib.formats.rasi) mkLiteral; + + mkColor = color: mkLiteral "#{color}"; + in { + "*" = { + bg = mkLiteral "rgba(239, 241, 245, 0.3)"; + hl-lavender = mkLiteral "#${color.dark.lavender}"; + hl-pink = mkLiteral "#${color.dark.pink}"; + text = mkLiteral "#${color.dark.base}"; + trans = mkLiteral "rgba(255, 255, 255, 0)"; + }; + + "element-text,element-icon,mode-switcher" = { + background-color = mkLiteral "inherit"; + text-color = mkLiteral "inherit"; + }; + + "window" = { + height = 480; + width = 700; + # border-style = mkLiteral "solid"; + border = mkLiteral "2 solid 2 solid 2 solid 2 solid"; + border-radius = 6; + border-color = mkLiteral "@hl-lavender"; + background-color = mkLiteral "@bg"; + }; + + "mainbox" = { + background-color = mkLiteral "@trans"; + }; + + "message" = { + background-color = mkLiteral "@trans"; + }; + + "error-message" = { + background-color = mkLiteral "@trans"; + margin = mkLiteral "0px 0px 20px 0px"; + }; + + "textbox" = { + background-color = mkLiteral "@trans"; + padding = 6; + margin = mkLiteral "20px 20px 0px 20px"; + border-radius = 3; + }; + + "inputbar" = { + children = builtins.map mkLiteral ["prompt" "entry"]; + background-color = mkLiteral "@trans"; + }; + + "prompt" = { + background-color = mkLiteral "@hl-pink"; + padding = 6; + text-color = mkLiteral "@text"; + border-radius = 3; + margin = mkLiteral "20px 0px 0px 20px"; + }; + + "entry" = { + padding = 6; + margin = mkLiteral "20px 20px 0px 10px"; + text-color = mkLiteral "@text"; + background-color = mkLiteral "@trans"; + border = mkLiteral "2 solid 2 solid 2 solid 2 solid"; + border-radius = 3; + border-color = mkLiteral "@hl-pink"; + }; + + "listview" = { + # border = mkLiteral "0px 0px 0px"; + padding = 0; + margin = mkLiteral "10px 20px 20px 20px"; + columns = 1; + background-color = mkLiteral "@trans"; + border = mkLiteral "2 solid 2 solid 2 solid 2 solid"; + border-radius = 3; + border-color = mkLiteral "@hl-pink"; + }; + + "element" = { + padding = 5; + margin = 0; + background-color = mkLiteral "@trans"; + text-color = mkLiteral "@text"; + border-radius = 3; + }; + + "element-icon" = { + size = 25; + }; + + "element selected" = { + background-color = mkLiteral "@hl-pink"; + text-color = mkLiteral "@text"; + }; + }; + }; modules.hyprland.keybindings = let power-menu = @@ -26,15 +146,19 @@ in { "Reload Hyprland" = "hyprctl reload"; "Exit Hyprland" = "hyprctl dispatch exit"; }; + + vpn-menu = pkgs.writeScript "rofi-menu-vpn" (builtins.readFile ./menus/vpn.fish); + keybinds-menu = pkgs.writeScript "rofi-menu-keybinds" (builtins.readFile ./menus/keybinds.fish); + + # TODO: Expand on that + lectures-menu = pkgs.writeScript "rofi-menu-lectures" (builtins.readFile ./menus/lectures.fish); in { bindings = { "$mainMod, escape" = ["exec, \"${power-menu}\""]; + "$mainMod, O" = ["exec, \"${lectures-menu}\""]; + "$mainMod, M" = ["exec, \"${keybinds-menu}\""]; + "$mainMod, U" = ["exec, \"${vpn-menu}\""]; }; }; - - home.file = { - ".config/rofi/config.rasi".source = ../../../config/rofi/rofi.rasi; - ".config/rofi/colors.rasi".source = ../../../config/rofi/colors/${cfg.theme}.rasi; - }; }; } diff --git a/config/rofi/menus/keybinds.fish b/home/modules/rofi/menus/keybinds.fish similarity index 100% rename from config/rofi/menus/keybinds.fish rename to home/modules/rofi/menus/keybinds.fish diff --git a/config/rofi/menus/lectures.fish b/home/modules/rofi/menus/lectures.fish similarity index 100% rename from config/rofi/menus/lectures.fish rename to home/modules/rofi/menus/lectures.fish diff --git a/config/rofi/menus/vpn.fish b/home/modules/rofi/menus/vpn.fish similarity index 100% rename from config/rofi/menus/vpn.fish rename to home/modules/rofi/menus/vpn.fish