Added launcher module
This commit is contained in:
5
modules/launcher/init.lua
Normal file
5
modules/launcher/init.lua
Normal file
@ -0,0 +1,5 @@
|
||||
return {
|
||||
widgets = {
|
||||
launcher = require("modules.launcher.widget").widget
|
||||
}
|
||||
}
|
159
modules/launcher/launcher.rasi
Executable file
159
modules/launcher/launcher.rasi
Executable file
@ -0,0 +1,159 @@
|
||||
configuration {
|
||||
font: "Inter Regular 10";
|
||||
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;
|
||||
}
|
||||
|
||||
window {
|
||||
transparency: "real";
|
||||
background-color: @background;
|
||||
location: southwest;
|
||||
anchor: southwest;
|
||||
x-offset: 4px;
|
||||
y-offset: -50px;
|
||||
height: 500px;
|
||||
width: 400px;
|
||||
orientation: vertical;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
prompt {
|
||||
enabled: false;
|
||||
}
|
||||
|
||||
button {
|
||||
action: "ok";
|
||||
str: " ";
|
||||
font: "FantasqueSansMono Nerd Font 11";
|
||||
expand: false;
|
||||
text-color: @foreground;
|
||||
background-color: @transparent;
|
||||
vertical-align: 0.7;
|
||||
horizontal-align: 0.5;
|
||||
}
|
||||
|
||||
entry {
|
||||
font: "Inter Regular 11";
|
||||
background-color: @transparent;
|
||||
text-color: @foreground;
|
||||
expand: true;
|
||||
vertical-align: 0.5;
|
||||
horizontal-align: 0.5;
|
||||
placeholder: "Search";
|
||||
placeholder-color: @foreground;
|
||||
blink: true;
|
||||
}
|
||||
|
||||
case-indicator {
|
||||
background-color: @transparent;
|
||||
text-color: @foreground;
|
||||
vertical-align: 0.5;
|
||||
horizontal-align: 0.5;
|
||||
}
|
||||
|
||||
entry-wrapper {
|
||||
orientation: horizontal;
|
||||
vertical-align: 0.5;
|
||||
spacing: 4px;
|
||||
background-color: @transparent;
|
||||
children: [ button, entry, case-indicator ];
|
||||
}
|
||||
|
||||
inputbar {
|
||||
background-color: @background-white;
|
||||
text-color: @foreground;
|
||||
expand: false;
|
||||
border-radius: 24px;
|
||||
margin: 0px 0px 0px 0px;
|
||||
padding: 10px 10px 10px 10px;
|
||||
position: north;
|
||||
children: [ entry-wrapper ];
|
||||
}
|
||||
|
||||
listview {
|
||||
background-color: @transparent;
|
||||
columns: 1;
|
||||
spacing: 5px;
|
||||
cycle: false;
|
||||
dynamic: true;
|
||||
layout: vertical;
|
||||
}
|
||||
|
||||
mainbox {
|
||||
background-color: @background-black;
|
||||
children: [listview, inputbar ];
|
||||
spacing: 25px;
|
||||
padding: 40px 25px 25px 25px;
|
||||
}
|
||||
|
||||
element {
|
||||
background-color: @transparent;
|
||||
text-color: @foreground;
|
||||
orientation: horizontal;
|
||||
border-radius: 6px;
|
||||
padding: 5px 10px 5px 10px;
|
||||
}
|
||||
|
||||
element-icon {
|
||||
size: 36px;
|
||||
border: 0;
|
||||
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;
|
||||
}
|
||||
|
||||
element normal.urgent,
|
||||
element alternate.urgent {
|
||||
background-color: @urgent;
|
||||
text-color: @foreground;
|
||||
border-radius: 9px;
|
||||
}
|
||||
|
||||
element normal.active,
|
||||
element alternate.active {
|
||||
background-color: @background-active;
|
||||
text-color: @foreground;
|
||||
}
|
||||
|
||||
element selected {
|
||||
background-color: @background-selected;
|
||||
text-color: @foreground;
|
||||
}
|
||||
|
||||
element selected.urgent {
|
||||
background-color: @urgent-selected;
|
||||
text-color: @foreground;
|
||||
}
|
||||
|
||||
element selected.active {
|
||||
background-color: @background-active;
|
||||
color: @foreground-selected;
|
||||
}
|
9
modules/launcher/util.lua
Normal file
9
modules/launcher/util.lua
Normal file
@ -0,0 +1,9 @@
|
||||
local launcher = {}
|
||||
|
||||
local conf = configuration_dir .. "modules/launcher/launcher.rasi"
|
||||
|
||||
launcher.launcher = function()
|
||||
awful.spawn("rofi -show drun -theme \"" .. conf .. "\"")
|
||||
end
|
||||
|
||||
return launcher
|
50
modules/launcher/widget.lua
Normal file
50
modules/launcher/widget.lua
Normal file
@ -0,0 +1,50 @@
|
||||
local launcher = req_rel(..., "util")
|
||||
local widget = {}
|
||||
|
||||
|
||||
widget.icon = wibox.widget {
|
||||
resize = true,
|
||||
image = beautiful.icons.launcher,
|
||||
widget = wibox.widget.imagebox
|
||||
}
|
||||
|
||||
widget.widget = wibox.widget {
|
||||
{
|
||||
{ -- Right space
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.color.transparent,
|
||||
forced_width = beautiful.dpi(3)
|
||||
},
|
||||
{
|
||||
widget.icon,
|
||||
top = beautiful.dpi(2),
|
||||
bottom = beautiful.dpi(2),
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
{ -- Left space
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.color.transparent,
|
||||
forced_width = beautiful.dpi(3)
|
||||
},
|
||||
layout = wibox.layout.align.horizontal,
|
||||
},
|
||||
layout = wibox.container.background,
|
||||
}
|
||||
|
||||
widget.widget:connect_signal("mouse::enter", function(result)
|
||||
widget.widget.bg = beautiful.color.bar.hover_bg
|
||||
|
||||
end)
|
||||
|
||||
widget.widget:connect_signal("mouse::leave", function(result)
|
||||
widget.widget.bg = beautiful.color.transparent
|
||||
end)
|
||||
|
||||
widget.widget:connect_signal("button::press",
|
||||
function(_, _, _, button, mods)
|
||||
if (button == 1) then
|
||||
launcher.launcher()
|
||||
end
|
||||
end
|
||||
)
|
||||
return widget
|
Reference in New Issue
Block a user