From 2a82a200684ee674579917410d2ca4a7bab3805b Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Fri, 3 Jan 2025 10:24:32 -0600 Subject: [PATCH] let's try to use rofi through nix --- .config/tridactyl/tridactylrc | 2 +- home/home.nix | 13 ++- home/modules/rofi.nix | 214 ++++++++++++++++++++++++++++++++++ 3 files changed, 222 insertions(+), 7 deletions(-) create mode 100644 home/modules/rofi.nix diff --git a/.config/tridactyl/tridactylrc b/.config/tridactyl/tridactylrc index a674619..b62159f 100644 --- a/.config/tridactyl/tridactylrc +++ b/.config/tridactyl/tridactylrc @@ -61,7 +61,7 @@ command org-capture composite get_current_url | js -p tri.excmds.exclaim_quiet(' "" Unbind this key to rebind it later unbind v -command mpv js -p tri.excmds.shellescape(JS_ARG).then(url => tri.excmds.exclaim_quiet('empv ' + '${url}')) +command mpv js -p tri.excmds.shellescape(JS_ARG).then(url => tri.excmds.exclaim_quiet('empv ' + "${url}")) command torrent js -p tri.excmds.shellescape(JS_ARG).then(url => tri.excmds.exclaim_quiet('transadd ' + url)) diff --git a/home/home.nix b/home/home.nix index 929d46a..8c30c7a 100644 --- a/home/home.nix +++ b/home/home.nix @@ -7,6 +7,7 @@ let in { imports = [ ./modules/hyprland.nix + ./modules/rofi.nix # ags.homeManagerModules.default # ./modules/plasma.nix ]; @@ -523,10 +524,10 @@ in { recursive = true; }; - home.file.".config/rofi" = { - source = ../.config/rofi; - recursive = true; - }; + # home.file.".config/rofi" = { + # source = ../.config/rofi; + # recursive = true; + # }; programs.firefox = { enable = true; @@ -1102,7 +1103,7 @@ in { bind -M insert '$' __history_previous_command_arguments end - # starship init fish | source + starship init fish | source ''; }; @@ -1309,7 +1310,7 @@ in { padding.y = 10; dynamic_padding = true; }; - terminal.shell.program = "nu"; + terminal.shell.program = "fish"; font = { normal = { family = "VictorMono Nerd Font"; diff --git a/home/modules/rofi.nix b/home/modules/rofi.nix new file mode 100644 index 0000000..9ab8383 --- /dev/null +++ b/home/modules/rofi.nix @@ -0,0 +1,214 @@ +{ config, lib, pkgs, ... }: + +{ + programs.rofi = { + enable = true; + font = "VictorMono Nerd Font 12"; + cycle = true; + theme = + let + inherit (config.lib.formats.rasi) mkLiteral; + in { + configuration = { + icon-theme = "Papirus"; + terminal = "konsole"; + sidebar-mode = true; + run-command = "bash -c {cmd}"; + run-list-command = "fish -c functions"; + display-drun = " "; + display-run = " "; + display-window = " "; + display-combi = " "; + drun-display-format = "{name} [({generic})]";/* - {exec}*/ + threads = 0; + scroll-method = 0; + disable-history = false; + kb-accept-entry = "Return"; + kb-remove-to-eol = "Control-D"; + kb-remove-char-back = "BackSpace"; + kb-mode-complete = "Control-M"; + kb-row-down = "Control-j"; + kb-row-up = "Control-k"; + kb-row-left = "Control-h"; + kb-row-right = "Control-l"; + font = "VictorMono Nerd Font 12.0"; + timeout = { + delay = 15; + action = "kb-cancel"; + }; + }; + + "*" = { + backgrounkd = "#12121222"; + background-color = "#00222b33"; + background-entry = "#000000"; + foreground-selected = "#ffffff"; + urgent = "#E91E63"; + urgent-selected = "#E91E63"; + transparent = "#00000000"; + base00 = "#282a36"; + base01 = "#34353e"; + base02 = "#43454f"; + base03 = "#78787e"; + base04 = "#a5a5a9"; + base05 = "#e2e4e5"; + base06 = "#eff0eb"; + base07 = "#f1f1f0"; + base08 = "#ff5c57"; + base09 = "#ff9f43"; + base0A = "#f3f99d"; + base0B = "#5af78e"; + base0C = "#9aedfe"; + base0D = "#57c7ff"; + base0E = "#ff6ac1"; + base0F = "#b2643c"; + base00t = "#282a3655"; + background-alt = "@base02"; + }; + + window = { + background-color = "@base00"; + text-color = "@base05"; + border-radius = "20px"; + border = "0px"; + width = "60%"; + location = "center"; + anchor = "center"; + x-offset = "0"; + y-offset = "0"; + margin = "0px"; + padding = "0px"; + }; + + mainbox = { + border-radius = "16"; + background-color = "@base00"; + text-color = "@base05"; + transparency = "real"; + children = [ "inputbar" "listview" "message" ]; + spacing = "5px"; + padding = "10px 10px 10px 10px"; + }; + + inputbar = { + /* background-color = @transparent; */ + background-color = "@base00"; + text-color = "@base05"; + expand = false; + border-radius = "36px"; + margin = "0px 0px 0px 0px"; + padding = "20px 6px 20px 6px"; + position = "north"; + }; + + prompt = { + enabled = true; + padding = "0px 6px 0px 5px"; + background-color = "@base00"; + text-color = "@base05"; + border = "0px"; + font = "VictorMono Nerd Font 22.0"; + }; + + entry = { + background-color = "@base00"; + color = "@base00"; + placeholder-color = "@base05"; + text-color = "@base05"; + expand = true; + horizontal-align = 0; + placeholder = ""; + blink = true; + border = "0px"; + padding = "0px 0px 0px 6px"; + font = "VictorMono Nerd Font 22.0"; + }; + + case-indicator = { + background-color = "@transparent"; + text-color = "@base05"; + spacing = 0; + border = "0px"; + }; + + sidebar = { + border = "2px 0 0"; + }; + + message = { + border = "0px 0 0"; + padding = "0px"; + background-color = "@transparent"; + }; + + textbox = { + highlight = "@base0B"; + text-color = "@base0B"; + background-color = "@transparent"; + padding = "10px 90px 10px 90px"; + }; + + listview = { + background-color = "@base00"; + columns = 1; + spacing = "4px"; + cycle = false; + dynamic = true; + layout = "vertical"; + lines = "10"; + scrollbar = false; + border = "0px"; + fixed-height = false; + }; + + element = { + background-color = "@transparent"; + text-color = "@base05"; + orientation = "horizontal"; + border-radius = "55px"; + padding = "5px 5px 5px 10px"; + }; + + element-icon = { + background-color = "@transparent"; + size = "30px"; + border = "0px"; + padding = "0px 0px 0px"; + }; + + element-text = { + expand = true; + background-color = "@transparent"; + text-color = "@base05"; + vertical-align = "0.5"; + }; + + "element normal.urgent, element alternate.urgent" = { + background-color = "@urgent"; + text-color = "@base08"; + border-radius = "9px"; + }; + + "element normal.active, element alternate.active" = { + background-color = "@background-alt"; + text-color = "@base0B"; + }; + + "element selected" = { + background-color = "@background-alt"; + text-color = "@base0A"; + }; + + "element selected.urgent" = { + background-color = "@urgent-selected"; + text-color = "@base08"; + }; + + "element selected.active" = { + background-color = "@background-alt"; + color = "@base0A"; + }; + + }; + }; +}