This repository has been archived by the owner on Jun 17, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c24ff34
commit 925c91b
Showing
14 changed files
with
1,013 additions
and
619 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
|
||
-- =================================================================== | ||
-- Initialization | ||
-- =================================================================== | ||
|
||
local awful = require("awful") | ||
local gears = require("gears") | ||
|
||
-- =================================================================== | ||
-- Create Widget | ||
-- =================================================================== | ||
|
||
-- Create a titlebar for the client. | ||
-- By default, awful.rules will create one, but all it does is to call this | ||
-- function. | ||
local top_titlebar = awful.titlebar(c, { | ||
height = 20, | ||
bg_normal = '#13111a', | ||
}) | ||
-- buttons for the titlebar | ||
local buttons = gears.table.join( | ||
awful.button({}, 1, function() | ||
client.focus = c | ||
c:raise() | ||
awful.mouse.client.move(c) | ||
end), | ||
awful.button({}, 3, function() | ||
client.focus = c | ||
c:raise() | ||
awful.mouse.client.resize(c) | ||
end)) | ||
top_titlebar : setup { | ||
{-- Left | ||
buttons = buttons, | ||
awful.titlebar.widget.floatingbutton (c), | ||
|
||
layout = wibox.layout.fixed.horizontal | ||
}, | ||
{-- Middle | ||
{-- Title | ||
align = 'center', | ||
awful.titlebar.widget.iconwidget(c), | ||
|
||
widget = awful.titlebar.widget.titlewidget(c)}, | ||
buttons = buttons, | ||
layout = wibox.layout.flex.horizontal | ||
}, | ||
{-- Right | ||
awful.titlebar.widget.maximizedbutton(c), | ||
awful.titlebar.widget.stickybutton (c), | ||
awful.titlebar.widget.ontopbutton (c), | ||
awful.titlebar.widget.closebutton (c), | ||
layout = wibox.layout.fixed.horizontal()}, | ||
layout = wibox.layout.align.horizontal | ||
} | ||
|
||
-- Add a titlebar if titlebars_enabled is set to true in the rules. | ||
client.connect_signal( | ||
"request::titlebars", | ||
function(c) | ||
if c.titlebars_enabled == false then | ||
return | ||
end | ||
local title_widget = awful.titlebar.widget.titlewidget(c) | ||
title_widget.font = beautiful.titlebar_font | ||
local top_titlebar = | ||
awful.titlebar( | ||
c, | ||
{ | ||
size = 5, | ||
position = "top" | ||
}) | ||
local bottom_titlebar = | ||
awful.titlebar( | ||
c, | ||
{ | ||
size = 5, | ||
position = "bottom" | ||
}) | ||
local left_titlebar = | ||
awful.titlebar( | ||
c, | ||
{ | ||
size = 5, | ||
position = "left" | ||
}) | ||
local right_titlebar = | ||
awful.titlebar( | ||
c, | ||
{ | ||
size = 5, | ||
position = "right" | ||
}) | ||
|
||
c:connect_signal( | ||
"focus", | ||
function(c) | ||
top_titlebar:set_bg(beautiful.titlebar_bg_focus) | ||
bottom_titlebar:set_bg(beautiful.titlebar_bg_focus) | ||
left_titlebar:set_bg(beautiful.titlebar_bg_focus) | ||
right_titlebar:set_bg(beautiful.titlebar_bg_focus) | ||
end | ||
) | ||
c:connect_signal( | ||
"unfocus", | ||
function(c) | ||
top_titlebar:set_bg(beautiful.titlebar_bg_normal) | ||
bottom_titlebar:set_bg(beautiful.titlebar_bg_normal) | ||
left_titlebar:set_bg(beautiful.titlebar_bg_normal) | ||
right_titlebar:set_bg(beautiful.titlebar_bg_normal) | ||
end | ||
) | ||
end | ||
) | ||
|
||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
local menubar = require("menubar") | ||
local awful = require("awful") | ||
local environment = require("maf.environment") | ||
local hotkeys_popup = require("awful.hotkeys_popup") | ||
|
||
local moudle = | ||
awful.menu( | ||
{ | ||
{ | ||
"Terminal", | ||
environment.terminal | ||
-- menubar.utils.lookup_icon('utilities-terminal') | ||
}, | ||
{ | ||
"Browser", | ||
environment.browser | ||
-- menubar.utils.lookup_icon('internet-web-browser') | ||
}, | ||
{ | ||
"Files", | ||
environment.filemanager | ||
-- menubar.utils.lookup_icon('system-file-manager') | ||
}, | ||
{ | ||
"Awesome", | ||
{ | ||
{ | ||
"hotkeys", | ||
function() | ||
return false, hotkeys_popup.show_help | ||
end | ||
-- menubar.utils.lookup_icon('preferences-desktop-keyboard-shortcuts') | ||
}, | ||
{ | ||
"manual", | ||
environment.terminal .. " -e man awesome" | ||
-- menubar.utils.lookup_icon('system-help') | ||
}, | ||
{ | ||
"edit config", | ||
environment.gui_editor .. " " .. awesome.conffile | ||
-- menubar.utils.lookup_icon('accessories-text-editor') | ||
}, | ||
{ | ||
"restart", | ||
awesome.restart | ||
-- menubar.utils.lookup_icon('system-restart') | ||
}}, | ||
nil | ||
}, | ||
{ | ||
"System", | ||
{ | ||
{ | ||
"Lock", | ||
"slimlock" | ||
-- menubar.utils.lookup_icon("system-lock") | ||
}, | ||
{ | ||
"Logout", | ||
function() | ||
awesome.quit() | ||
end | ||
-- menubar.utils.lookup_icon("system-log-out") | ||
}, | ||
{ | ||
"Suspend", | ||
"systemctl suspend" | ||
-- menubar.utils.lookup_icon("system-suspend") | ||
}, | ||
-- { 'hibernate', 'systemctl hibernate', menubar.utils.lookup_icon('system-suspend-hibernate') }, | ||
{ | ||
"Reboot", | ||
"systemctl reboot" | ||
-- menubar.utils.lookup_icon("system-reboot") | ||
}, | ||
{ | ||
"Shutdown", | ||
"poweroff" | ||
-- menubar.utils.lookup_icon("system-shutdown") | ||
}}, | ||
nil | ||
}}) | ||
|
||
return moudle | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
-- ██████╗ ██╗ ██╗██╗ ███████╗███████╗ | ||
-- ██╔══██╗██║ ██║██║ ██╔════╝██╔════╝ | ||
-- ██████╔╝██║ ██║██║ █████╗ ███████╗ | ||
-- ██╔══██╗██║ ██║██║ ██╔══╝ ╚════██║ | ||
-- ██║ ██║╚██████╔╝███████╗███████╗███████║ | ||
-- ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚══════╝╚══════╝ | ||
|
||
-- =================================================================== | ||
-- Initialization | ||
-- =================================================================== | ||
|
||
local awful = require("awful") | ||
local beautiful = require("beautiful") | ||
|
||
-- define screen height and width | ||
local screen_height = awful.screen.focused().geometry.height | ||
local screen_width = awful.screen.focused().geometry.width | ||
|
||
-- define module table | ||
local rules = {} | ||
|
||
-- =================================================================== | ||
-- Rules | ||
-- =================================================================== | ||
|
||
-- return a table of client rules including provided keys / buttons | ||
function rules.create(clientkeys, clientbuttons) | ||
return { | ||
-- All clients will match this rule. | ||
{ | ||
rule = {}, | ||
properties = { | ||
border_width = beautiful.border_width, | ||
border_color = beautiful.border_normal, | ||
focus = awful.client.focus.filter, | ||
raise = true, | ||
keys = clientkeys, | ||
buttons = clientbuttons, | ||
screen = awful.screen.preferred, | ||
placement = awful.placement.centered, | ||
titlebars_enabled = true | ||
|
||
}, | ||
}, | ||
-- Floating clients. | ||
{ | ||
rule_any = { | ||
instance = { | ||
"DTA", | ||
"copyq", | ||
}, | ||
class = { | ||
"Nm-connection-editor" | ||
}, | ||
name = { | ||
"Event Tester", | ||
"Steam Guard - Computer Authorization Required" | ||
}, | ||
role = { | ||
"pop-up", | ||
"GtkFileChooserDialog" | ||
}, | ||
type = { | ||
"dialog" | ||
}}, properties = {floating = true}}, | ||
|
||
-- Fullscreen clients | ||
{ | ||
rule_any = { | ||
class = { | ||
"Terraria.bin.x86", | ||
}, | ||
}, properties = {fullscreen = true}}, | ||
|
||
-- "Switch to tag" | ||
-- These clients make you switch to their tag when they appear | ||
{ | ||
rule_any = { | ||
class = { | ||
"Firefox" | ||
}, | ||
}, properties = {switchtotag = true}}, | ||
|
||
-- Visualizer | ||
{ | ||
rule_any = {name = {"cava"}}, | ||
properties = { | ||
floating = true, | ||
maximized_horizontal = true, | ||
sticky = true, | ||
ontop = false, | ||
skip_taskbar = true, | ||
below = true, | ||
focusable = false, | ||
height = screen_height * 0.40, | ||
opacity = 0.6 | ||
}, | ||
callback = function (c) | ||
decorations.hide(c) | ||
awful.placement.bottom(c) | ||
end | ||
}, | ||
|
||
-- Rofi | ||
{ | ||
rule_any = {name = {"rofi"}}, | ||
properties = {maximized = true, ontop = true}}, | ||
|
||
-- File chooser dialog | ||
{ | ||
rule_any = {role = {"GtkFileChooserDialog"}}, | ||
properties = {floating = true, width = screen_width * 0.55, height = screen_height * 0.65}}, | ||
|
||
-- Pavucontrol & Bluetooth Devices | ||
{ | ||
rule_any = {class = {"Pavucontrol"}, name = {"Bluetooth Devices"}}, | ||
properties = {floating = true, width = screen_width * 0.55, height = screen_height * 0.45}}, | ||
} | ||
end | ||
|
||
-- return module table | ||
return rules | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
-- luacheck: globals client screen awesome | ||
local awful = require("awful") | ||
local beautiful = require("beautiful") | ||
local gears = require("gears") | ||
-- Autofocus a new client when previously focused one is closed | ||
require("awful.autofocus") | ||
local signals = {} | ||
|
||
-- Focus clients under mouse | ||
client.connect_signal("mouse::enter", function(c) | ||
c:emit_signal("request::activate", "mouse_enter", {raise = false}) | ||
end) | ||
|
||
local function do_sloppy_focus(c) | ||
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier and | ||
awful.client.focus.filter(c) then client.focus = c end | ||
end | ||
|
||
local function fixed_maximized_geometry(c, context) | ||
if c.maximized and context ~= "fullscreen" then | ||
c:geometry({ | ||
x = c.screen.workarea.x, | ||
y = c.screen.workarea.y, | ||
height = c.screen.workarea.height - 2 * c.border_width, | ||
width = c.screen.workarea.width - 2 * c.border_width | ||
}) | ||
end | ||
end | ||
|
||
function signals:init() | ||
-- actions on every application start | ||
client.connect_signal("manage", function(c) | ||
awful.client.setslave(c) | ||
client.connect_signal("manage", function(c) | ||
c.shape = function(cr, w, h) | ||
gears.shape.rounded_rect(cr, w, h, 12) | ||
end | ||
end) | ||
|
||
-- startup placement | ||
if awesome.startup and not c.size_hints.user_position and | ||
not c.size_hints.program_position then | ||
awful.placement.no_offscreen(c) | ||
end | ||
end) | ||
|
||
-- add missing borders to windows that get unmaximized | ||
client.connect_signal("property::maximized", function(c) | ||
if not c.maximized then c.border_width = beautiful.border_width end | ||
end) | ||
|
||
-- don't allow maximized windows move/resize themselves | ||
client.connect_signal("request::geometry", fixed_maximized_geometry) | ||
|
||
client.connect_signal("mouse::enter", do_sloppy_focus) | ||
client.connect_signal("focus", function(c) | ||
c.border_color = beautiful.border_focus | ||
end) | ||
client.connect_signal("unfocus", function(c) | ||
c.border_color = beautiful.border_normal | ||
end) | ||
|
||
screen.connect_signal("list", awesome.restart) | ||
end | ||
|
||
return signals |
Oops, something went wrong.