Added overlay for rofi menus

This commit is contained in:
2026-07-02 08:21:47 +02:00
parent e1c3745f3b
commit 379e008024
9 changed files with 105 additions and 13 deletions
+32
View File
@@ -77,6 +77,38 @@ function M.setup()
}
}
end)
-- Overlay for rofi launchers
local dim_overlay = wibox({
visible = false,
ontop = true,
type = "splash",
bg = "#00000099",
})
dim_overlay.name = "awesome_dim_overlay"
awful.screen.connect_for_each_screen(function(s)
dim_overlay.screen = s -- adjust if you want it per-screen vs spanning all
end)
-- span the primary screen's geometry (or loop over all screens if you use a multi-monitor dim)
local function update_dim_geometry()
local geo = screen.primary.geometry
dim_overlay:geometry(geo)
end
update_dim_geometry()
screen.connect_signal("property::geometry", update_dim_geometry)
-- expose functions over awesome-client
_G.show_dim = function() dim_overlay.visible = true end
_G.hide_dim = function() dim_overlay.visible = false end
-- Prime the window so X/picom register its type before first real use,
-- avoiding a one-time grow animation on the very first show_dim() call
dim_overlay.visible = true
gears.timer.delayed_call(function()
dim_overlay.visible = false
end)
end
return M
+5 -10
View File
@@ -5,13 +5,6 @@ local menubar = require("menubar")
local M = {}
-- Prefer rofi, fall back to built-in menubar
local function launcher()
awful.spawn.easy_async_with_shell("command -v rofi", function(out)
if out and out:match("%S") then awful.spawn("rofi -show drun") else menubar.show() end
end)
end
M.globalkeys = gears.table.join(
awful.key({ modkey }, "s", hotkeys_popup.show_help, { description = "show help", group = "awesome" }),
@@ -33,9 +26,8 @@ M.globalkeys = gears.table.join(
-- Launching / layout
awful.key({ modkey }, "Return", function() awful.spawn(terminal) end, { description = "open a terminal", group = "launcher" }),
awful.key({ modkey }, "space", launcher, { description = "application launcher", group = "launcher" }),
awful.key({ modkey }, "e", function() awful.spawn("thunar") end, { description = "Filemanager", group = "system" }),
awful.key({ modkey }, "b", function() awful.spawn("chromium") end, { description = "Browser", group = "internet" }),
awful.key({ modkey }, "w", function() awful.spawn("chromium") end, { description = "Browser", group = "internet" }),
awful.key({ modkey }, "t", function() awful.layout.inc(1) end, { description = "next layout", group = "layout" }),
awful.key({ modkey }, "p", function() awful.spawn("xfce4-screenshooter") end, { description = "screenshot", group = "system" }),
@@ -48,11 +40,14 @@ M.globalkeys = gears.table.join(
awful.key({ }, "XF86AudioMute", function() awful.spawn.easy_async_with_shell([[sh -c 'pactl set-sink-mute "$(pactl get-default-sink)" toggle']]) end, { description = "toggle mute", group = "media" }),
-- rofi menus
awful.key({ modkey }, "a", function() awful.spawn("/home/jason/.local/bin/audioswitch") end, { description = "audio output", group = "system" }),
awful.key({ modkey }, "space", function() awful.spawn("/home/jason/.local/bin/runrofi") end, { description = "application launcher", group = "launcher" }),
awful.key({ modkey }, "`", function() awful.spawn("/home/jason/.local/bin/powermenu") end, { description = "power menu", group = "system" }),
awful.key({ modkey }, "a", function() awful.spawn("/home/jason/.local/bin/audioswitch") end, { description = "audio output", group = "system" }),
awful.key({ modkey }, "b", function () awful.spawn("/home/jason/.local/bin/bookmarks") end, {description = "bookmarks", group = "internet"}),
-- Awesome control
awful.key({ modkey, "Shift" }, "r", awesome.restart, { description = "reload awesome", group = "awesome" })
)
-- Workspace keys 1..5: Alt+N view, Alt+Shift+N move client to tag
+2 -2
View File
@@ -71,8 +71,8 @@ function M.make_vol()
end
w:buttons(gears.table.join(
awful.button({ }, 1, function() awful.spawn.easy_async_with_shell([[sh -c 'pactl set-sink-mute "$(pactl get-default-sink)" toggle']], function() refresh() end) end),
awful.button({ }, 3, function() awful.spawn("/home/jason/.local/bin/audioswitch") end),
awful.button({ }, 1, function() awful.spawn("/home/jason/.local/bin/audioswitch") end),
awful.button({ }, 3, function() awful.spawn.easy_async_with_shell([[sh -c 'pactl set-sink-mute "$(pactl get-default-sink)" toggle']], function() refresh() end) end),
awful.button({ }, 4, function() awful.spawn.easy_async_with_shell([[sh -c 'pactl set-sink-volume "$(pactl get-default-sink)" +2%']], function() refresh() end) end),
awful.button({ }, 5, function() awful.spawn.easy_async_with_shell([[sh -c 'pactl set-sink-volume "$(pactl get-default-sink)" -2%']], function() refresh() end) end)
))
+1
View File
@@ -50,3 +50,4 @@ bling.module.wallpaper.setup {
position = "fit",
background = "#181818",
}
+7
View File
@@ -274,5 +274,12 @@ rules: (
},
);
},
{
match = "window_type = 'splash' && name = 'awesome_dim_overlay'";
animations = ();
shadow = false;
corner-radius = 0;
fade = false;
},
)