From e07ff152f4bbfb99bebd04028c55a21105d99e35 Mon Sep 17 00:00:00 2001 From: Mark Date: Fri, 4 Nov 2022 21:20:18 -0700 Subject: [PATCH] Improve rofi config Closes #15 --- modules/launcher/launcher.rasi | 106 ++++++++++++++++++++------------- modules/launcher/util.lua | 8 ++- 2 files changed, 71 insertions(+), 43 deletions(-) diff --git a/modules/launcher/launcher.rasi b/modules/launcher/launcher.rasi index fddd076..2e27cf7 100755 --- a/modules/launcher/launcher.rasi +++ b/modules/launcher/launcher.rasi @@ -1,40 +1,52 @@ +// Some values in this configuration will be overriden by +// options when awesome runs rofi. +// +// See util.lua in this module. + +* { + // Basic colors + transparent: #00000000; + background: #000000FF; + foreground: #F2F2F2EE; + + // lightening transparency + overlay-white: #F2F2F211; + + background-selected: #F2F2F245; + background-active: #F2F2F230; + urgent: #E91E6366; + urgent-selected: #E91E6377; +} + configuration { - font: "Inter Regular 25"; + font: "Astra Sans 25"; + show-icons: true; icon-theme: "Papirus"; drun-display-format: "{name}"; fullscreen: false; - threads: 0; matching: "fuzzy"; scroll-method: 1; disable-history: false; fullscreen: false; window-thumbnail: true; -} - -* { - transparent: #00000000; - background: #000000FF; - foreground: #F2F2F2EE; - background-selected: #F2F2F245; - background-active: #F2F2F230; - background-white: #F2F2F211; - background-black: #00000066; - urgent: #E91E6366; - urgent-selected: #E91E6377; + drun-match-fields: "exec, name"; } window { + // Overridden by awesome + y-offset: -50px; + + height: 50%; + width: 25%; + transparency: "real"; background-color: @background; location: southwest; anchor: southwest; - x-offset: 4px; - y-offset: -50px; - height: 800px; - width: 800px; orientation: vertical; - border-radius: 5px; + border-radius: 0px; + x-offset: 0px; } prompt { @@ -42,9 +54,10 @@ prompt { } button { + font: "FantasqueSansMono Nerd Font 25"; + action: "ok"; str: " "; - font: "FantasqueSansMono Nerd Font 25"; expand: false; text-color: @foreground; background-color: @transparent; @@ -53,7 +66,9 @@ button { } entry { - font: "Inter Regular 25"; + // Overridden by awesome + font: "Astra Sans 25"; + background-color: @transparent; text-color: @foreground; expand: true; @@ -61,7 +76,7 @@ entry { horizontal-align: 0.5; placeholder: "Search"; placeholder-color: @foreground; - blink: true; + cursor: text; } case-indicator { @@ -74,18 +89,17 @@ case-indicator { entry-wrapper { orientation: horizontal; vertical-align: 0.5; - spacing: 4px; background-color: @transparent; children: [ button, entry, case-indicator ]; } inputbar { - background-color: @background-white; + background-color: @overlay-white; text-color: @foreground; expand: false; - border-radius: 24px; + border-radius: 2mm; margin: 0px 0px 0px 0px; - padding: 10px 10px 10px 10px; + padding: 3mm 3mm 3mm 3mm; position: north; children: [ entry-wrapper ]; } @@ -93,48 +107,56 @@ inputbar { listview { background-color: @transparent; columns: 1; - spacing: 5px; + spacing: 2mm; cycle: false; - dynamic: true; + dynamic: false; layout: vertical; + scrollbar: true; +} + +scrollbar { + background-color: @overlay-white; + handle-color: @foreground; + handle-width: 2mm; + width: 3px; + padding: 1mm; } mainbox { - background-color: @background-black; - children: [listview, inputbar ]; - spacing: 25px; - padding: 40px 25px 25px 25px; + background-color: @background; + children: [ listview, inputbar ]; + spacing: 10mm; + padding: 15mm 15mm 15mm 15mm; } element { background-color: @transparent; text-color: @foreground; orientation: horizontal; - border-radius: 6px; - padding: 5px 10px 5px 10px; + border-radius: 0mm; + padding: 2mm 2mm 2mm 2mm; } element-icon { - size: 36px; - border: 0; - background-color: @transparent; - text-color: inherit; + size: 16mm; + border: 0mm; + background-color: @transparent; + text-color: inherit; } element-text { expand: true; horizontal-align: 0; vertical-align: 0.5; - margin: 0 10px 0 10px; - background-color: @transparent; - text-color: inherit; + margin: 2mm 2mm 2mm 2mm; + background-color: @transparent; + text-color: inherit; } element normal.urgent, element alternate.urgent { background-color: @urgent; text-color: @foreground; - border-radius: 9px; } element normal.active, diff --git a/modules/launcher/util.lua b/modules/launcher/util.lua index 4f2f973..8d44660 100644 --- a/modules/launcher/util.lua +++ b/modules/launcher/util.lua @@ -3,7 +3,13 @@ local launcher = {} local conf = conf_dir .. "modules/launcher/launcher.rasi" launcher.launcher = function() - awful.spawn("rofi -show drun -theme \"" .. conf .. "\"") + awful.spawn( + "rofi -show drun " .. + "-theme \"" .. conf .. "\" " .. + -- Override y-offset so rofi + -- sits right above the bar. + "-theme-str \"#window{ y-offset: -" .. beautiful.dpi(config.core.bar_height) .. "; }\"" + ) end return launcher