diff --git a/flake.nix b/flake.nix index f3cc655..590e15b 100644 --- a/flake.nix +++ b/flake.nix @@ -71,8 +71,8 @@ }; }; nixpkgs.overlays = [ - nur.overlay - ]; + nur.overlay + ]; } # TODO: use a module instead of this. @@ -91,6 +91,7 @@ homeModules = { hyprland.enable = true; eww.enable = true; + rofi.enable = true; apps.enable = true; }; }; diff --git a/modules/home/default.nix b/modules/home/default.nix index bd68204..ba23183 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -2,6 +2,7 @@ imports = [ ./hyprland ./eww + ./rofi ./apps ]; diff --git a/modules/home/hyprland/hyprland.conf b/modules/home/hyprland/hyprland.conf index c3d9235..5b5e3ec 100644 --- a/modules/home/hyprland/hyprland.conf +++ b/modules/home/hyprland/hyprland.conf @@ -114,10 +114,11 @@ bind = $mainMod, F, fullscreen, 0 bind = $mainMod SHIFT, F, fakefullscreen, bind = $mainMod, \, togglespecialworkspace, +bind = $mainMod, V, togglefloating, bind = $mainMod, E, exec, kitty bind = $mainMod, R, exec, google-chrome-stable -bind = $mainMod, V, togglefloating, +bind = $mainMod, P, exec, rofi -show run # Move focus with mainMod + arrow keys bind = $mainMod, left, movefocus, l diff --git a/modules/home/hyprland/wallpaper.sh b/modules/home/hyprland/wallpaper.sh index b37cecf..67a31c0 100755 --- a/modules/home/hyprland/wallpaper.sh +++ b/modules/home/hyprland/wallpaper.sh @@ -5,4 +5,6 @@ export SWWW_TRANSITION_FPS=60 export SWWW_TRANSITION_STEP=2 export SWWW_TRANSITION=grow -swww img "$(find $WALLPAPERS -type f | shuf -n 1)" +WP=$(find $WALLPAPERS -type f | shuf -n 1) +ln -fs $WP ~/.cache/current-wallpaper +swww img "$WP" diff --git a/modules/home/rofi/base16.rasi b/modules/home/rofi/base16.rasi new file mode 100644 index 0000000..f68885e --- /dev/null +++ b/modules/home/rofi/base16.rasi @@ -0,0 +1,20 @@ +* { + base00: #1e1e2e; + base01: #181825; + base02: #313244; + base03: #45475a; + base04: #585b70; + base05: #cdd6f4; + base06: #f5e0dc; + base07: #b4befe; + base08: #f38ba8; + base09: #fab387; + base0A: #f9e2af; + base0B: #a6e3a1; + base0C: #94e2d5; + base0D: #89b4fa; + base0E: #cba6f7; + base0F: #f2cdcd; +} + +/* vim:ft=css diff --git a/modules/home/rofi/colors.rasi b/modules/home/rofi/colors.rasi new file mode 100644 index 0000000..ad79247 --- /dev/null +++ b/modules/home/rofi/colors.rasi @@ -0,0 +1,17 @@ +@import "base16.rasi" + +* { + background: @base00; + backgroundSolid: @base00; + backgroundAdditional: @base01; + background-alt: @base01; + foreground: @base05; + foreground-alt: @base06; + selected: @base0C; + highlight: #CB9D6D; + urgent: #8F7359; + on: #6C6559; + off: #995C38; +} + +/* vim:ft=css diff --git a/modules/home/rofi/config.rasi b/modules/home/rofi/config.rasi new file mode 100644 index 0000000..7137f73 --- /dev/null +++ b/modules/home/rofi/config.rasi @@ -0,0 +1,252 @@ +/** + * + * Author : Aditya Shakya (adi1090x) + * Github : @adi1090x + * + * Rofi Theme File + * Rofi Version: 1.7.3 + **/ + +@import "colors.rasi" + +/*****----- Configuration -----*****/ +configuration { + modi: "run,drun"; + show-icons: true; + display-drun: ""; + display-run: ""; + drun-display-format: "{name}"; + window-format: "{w} · {c} · {t}"; +} + +/*****----- Global Properties -----*****/ +* { + font: "monospace 12"; + background-alt: @background; + foreground: #FFFFFF; + active: @foreground; + urgent: @backgroundAdditional; +} + +/*****----- Main Window -----*****/ +window { + /* properties for window widget */ + transparency: "real"; + location: west; + anchor: west; + fullscreen: false; + width: 500px; + height: 86%; + x-offset: 1%; + y-offset: 0px; + + /* properties for all widgets */ + enabled: true; + border-radius: 12px; + cursor: "default"; + background-color: @background; +} + +/*****----- Main Box -----*****/ +mainbox { + enabled: true; + spacing: 0px; + background-color: transparent; + orientation: vertical; + children: [ "inputbar", "listbox", "mode-switcher"]; +} + +listbox { + spacing: 15px; + padding: 15px; + background-color: transparent; + orientation: vertical; + children: [ "message", "listview"]; +} + +/*****----- Inputbar -----*****/ +inputbar { + enabled: true; + spacing: 10px; + padding: 40px 40px 155px; + background-color: transparent; + background-image: url("~/.cache/current-wallpaper", width); + text-color: @foreground; + orientation: horizontal; + children: [ "textbox-prompt-colon", "entry"]; +} + +textbox-prompt-colon { + font: "monospace 10"; + enabled: true; + expand: false; + str: ""; + padding: 14px 17px 14px 17px; + border-radius: 10px; + background-color: @background-alt; + text-color: inherit; +} + +entry { + enabled: true; + expand: true; + padding: 12px 16px; + border-radius: 10px; + background-color: @background-alt; + text-color: inherit; + cursor: text; + placeholder: "Search"; + placeholder-color: inherit; +} + +dummy { + expand: true; + background-color: transparent; +} + +/*****----- Mode Switcher -----*****/ +mode-switcher { + enabled: true; + padding: 15px; + spacing: 10px; + background-color: transparent; + text-color: @foreground; +} + +button { + vertical-align: 0.5; + horizontal-align: 0.5; + font: "monspace 18"; + border-radius: 12px; + padding: 16px; + background-color: @background-alt; + text-color: inherit; + cursor: pointer; +} + +button selected { + background-color: @selected; + text-color: @backgroundSolid; +} + +/*****----- Listview -----*****/ +listview { + enabled: true; + columns: 1; + lines: 10; + cycle: false; + dynamic: true; + scrollbar: false; + layout: vertical; + reverse: false; + fixed-height: true; + fixed-columns: true; + + spacing: 10px; + background-color: transparent; + text-color: @foreground; + cursor: "default"; +} + +/*****----- Elements -----*****/ +element { + enabled: true; + spacing: 10px; + padding: 14px; + border-radius: 0px; + background-color: transparent; + text-color: @foreground; + cursor: pointer; +} + +element normal.normal { + border-radius: 100%; + background-color: inherit; + text-color: inherit; +} + +element normal.urgent { + border-radius: 100%; + background-color: @foreground-alt; + text-color: @backgroundSolid; +} + +element normal.active { + border-radius: 100%; + background-color: @foreground-alt; + text-color: @backgroundSolid; +} + +element alternate.normal { + border-radius: 100%; + background-color: inherit; + text-color: inherit; +} + +element alternate.urgent { + border-radius: 100%; + background-color: @foreground-alt; + text-color: @backgroundSolid; +} + +element alternate.active { + border-radius: 100%; + background-color: @foreground-alt; + text-color: @backgroundSolid; +} + +element selected.normal { + border-radius: 100%; + background-color: @selected; + text-color: @backgroundSolid; +} + +element selected.urgent { + border-radius: 100%; + background-color: @selected; + text-color: @backgroundSolid; +} + +element selected.active { + border-radius: 100%; + background-color: @selected; + text-color: @backgroundSolid; +} + +element-icon { + background-color: transparent; + text-color: inherit; + size: 24px; + cursor: inherit; +} + +element-text { + background-color: transparent; + text-color: inherit; + cursor: inherit; + vertical-align: 0.5; + horizontal-align: 0.0; +} + +/*****----- Message -----*****/ +message { + background-color: transparent; +} + +textbox { + padding: 12px; + border-radius: 0px; + background-color: @background-alt; + text-color: @foreground; + vertical-align: 0.5; + horizontal-align: 0.0; +} + +error-message { + padding: 12px; + border-radius: 0px; + background-color: @background; + text-color: @foreground; +} + +/* vim:ft=css diff --git a/modules/home/rofi/default.nix b/modules/home/rofi/default.nix new file mode 100644 index 0000000..1001bc4 --- /dev/null +++ b/modules/home/rofi/default.nix @@ -0,0 +1,17 @@ +{ + pkgs, + config, + lib, + ... +}: let + cfg = config.modules.rofi; +in { + options.modules.rofi = {enable = lib.mkEnableOption "rofi";}; + config = lib.mkIf cfg.enable { + home.packages = with pkgs; [rofi-wayland]; + home.file.".config/rofi" = { + source = ./.; + recursive = true; + }; + }; +}