update: theme & ui

This commit is contained in:
rxyhn 2022-03-11 11:07:33 +07:00
parent ced09ab95c
commit 44f198bcfe
6 changed files with 105 additions and 68 deletions

View file

@ -23,31 +23,23 @@ local machi = require("module.layout-machi")
-- Helpers
local helpers = require("helpers")
local keys = {}
-- Default modkey.
modkey = "Mod4"
altkey = "Mod1"
ctrl = "Control"
shift = "Shift"
-- Mouse Bindings
awful.mouse.append_global_mousebindings({
awful.button({}, 4, awful.tag.viewprev),
awful.button({}, 5, awful.tag.viewnext)
})
-- Client and Tabs Bindings
awful.keyboard.append_global_keybindings({
awful.key({"Mod1"}, "a", function()
awful.key({altkey}, "a", function()
bling.module.tabbed.pick_with_dmenu()
end,
{description = "pick client to add to tab group", group = "tabs"}),
awful.key({"Mod1"}, "s", function()
awful.key({altkey}, "s", function()
bling.module.tabbed.iter()
end,
{description = "iterate through tabbing group", group = "tabs"}),
awful.key({"Mod1"}, "d", function()
awful.key({altkey}, "d", function()
bling.module.tabbed.pop()
end,
{description = "remove focused client from tabbing group",group = "tabs"}),
@ -87,7 +79,7 @@ awful.keyboard.append_global_keybindings({
awful.client.swap.byidx(-1)
end,
{description = "swap with previous client by index", group = "client"}),
awful.key({modkey}, "u",
awful.key({modkey}, "u",
awful.client.urgent.jumpto,
{description = "jump to urgent client", group = "client"}),
awful.key({altkey}, "Tab", function()
@ -223,7 +215,8 @@ awful.keyboard.append_global_keybindings({
{description = "increase the number of master clients", group = "layout"}),
awful.key({modkey, "Shift"}, "l", function()
awful.tag.incnmaster(-1, nil, true)
end, {description = "decrease the number of master clients", group = "layout"}),
end,
{description = "decrease the number of master clients", group = "layout"}),
awful.key({modkey, "Control"}, "h", function()
awful.tag.incncol(1, nil, true)
end,
@ -393,13 +386,42 @@ awful.keyboard.append_global_keybindings({
}
})
-- Mouse bindings on desktop
------------------------------
awful.mouse.append_global_mousebindings({
-- Left click
awful.button({}, 1, function()
naughty.destroy_all_notifications()
if mymainmenu then
mymainmenu:hide()
end
end),
-- Right click
awful.button({}, 3, function()
mymainmenu:toggle()
end),
-- Side key
awful.button({}, 4, awful.tag.viewprev),
awful.button({}, 5, awful.tag.viewnext)
})
-- Mouse buttons on the client
--------------------------------
client.connect_signal("request::default_mousebindings", function()
awful.mouse.append_client_mousebindings({
awful.button({}, 1, function(c)
c:activate{context = "mouse_click"}
end), awful.button({modkey}, 1, function(c)
end),
awful.button({modkey}, 1, function(c)
c:activate{context = "mouse_click", action = "mouse_move"}
end), awful.button({modkey}, 3, function(c)
end),
awful.button({modkey}, 3, function(c)
c:activate{context = "mouse_click", action = "mouse_resize"}
end)
})

View file

@ -4,37 +4,38 @@ local hotkeys_popup = require("awful.hotkeys_popup")
local beautiful = require("beautiful")
-- Create a launcher widget and a main menu
local awesomemenu = {
{
"Hotkeys",
function() hotkeys_popup.show_help(nil, awful.screen.focused()) end
},
{"Restart", awesome.restart},
{"Quit", function() awesome.quit() end}
}
awful.screen.connect_for_each_screen(function(s)
local powermenu = {
{"Power OFF", function() awful.spawn.with_shell("systemctl poweroff") end},
{"Reboot", function() awful.spawn.with_shell("systemctl reboot") end},
{"Suspend", function()
lock_screen_show()
awful.spawn.with_shell("systemctl suspend")
end},
{"Lock Screen", function() lock_screen_show() end}
}
local mymainmenu = awful.menu({
items = {
{"Terminal", terminal, beautiful.awesome_logo},
{"Code Editor", vscode},
{"File Manager", filemanager},
{"Web Browser", browser},
{"Discord", discord},
{"AwesomeWM", awesomemenu},
{"Power Menu", powermenu}
-- Submenu
awesomemenu = {
{"Hotkeys", function() hotkeys_popup.show_help(nil, awful.screen.focused()) end},
{"Restart", awesome.restart},
{"Quit", function() awesome.quit() end}
}
})
awful.mouse.append_global_mousebindings({
awful.button({}, 3, function() mymainmenu:toggle() end)
})
-- Powermenu
powermenu = {
{"Power OFF", function() awful.spawn.with_shell("systemctl poweroff") end},
{"Reboot", function() awful.spawn.with_shell("systemctl reboot") end},
{"Suspend", function()
lock_screen_show()
awful.spawn.with_shell("systemctl suspend")
end},
{"Lock Screen", function() lock_screen_show() end}
}
-- Mainmenu
mymainmenu = awful.menu({
items = {
{"Terminal", terminal, beautiful.awesome_logo},
{"Code Editor", vscode},
{"File Manager", filemanager},
{"Web Browser", browser},
{"Discord", discord},
{"AwesomeWM", awesomemenu},
{"Power Menu", powermenu}
}
})
end)

View file

@ -221,10 +221,6 @@ theme = theme_assets.recolor_layout(theme, theme.xforeground)
-- Gaps
theme.useless_gap = dpi(5)
-- Exit Screen
theme.exit_screen_fg = theme.xforeground
theme.exit_screen_bg = theme.xbackground
-- Wibar
theme.wibar_height = (dpi(42) + theme.widget_border_width) * 0
theme.wibar_width = dpi(42) + theme.widget_border_width

View file

@ -284,7 +284,7 @@ screen.connect_signal("request::desktop_decoration", function(s)
widget_template = {
{
awful.widget.clienticon,
margins = dpi(6),
margins = dpi(8),
layout = wibox.container.margin
},
id = "background_role",

View file

@ -12,31 +12,55 @@ local wibox = require("wibox")
-- Helpers
local helpers = require("helpers")
-- Keys
local keys = require("configuration.keys")
-- Titlebar
-------------
awful.titlebar.enable_tooltip = false
client.connect_signal("request::titlebars", function(c)
-- Hide default titlebar
awful.titlebar.hide(c, beautiful.titlebar_pos)
-- Buttons for the titlebar
local buttons = gears.table.join(
-- Left click
awful.button({}, 1, function()
c:emit_signal("request::activate", "titlebar", {raise = true})
awful.mouse.client.move(c)
end),
-- Middle click
awful.button({}, 2, nil, function(c)
c:kill()
end),
-- Right click
awful.button({}, 3, function()
c:emit_signal("request::activate", "titlebar", {raise = true})
awful.mouse.client.resize(c)
end)
)
-- Side titlebar setup
awful.titlebar(c, {position = beautiful.titlebar_position, size = beautiful.titlebar_size}):setup {
{
{
awful.titlebar.widget.closebutton(c),
awful.titlebar.widget.maximizedbutton(c),
awful.titlebar.widget.minimizebutton(c),
awful.titlebar.widget.maximizedbutton(c),
layout = wibox.layout.fixed.vertical
},
{
widget = wibox.widget.textbox("")
buttons = buttons,
widget = wibox.widget.textbox("")
},
layout = wibox.layout.align.vertical
},
margins = dpi(4),
top = dpi(5),
bottom = dpi(5),
right = dpi(5),
widget = wibox.container.margin
}

View file

@ -12,7 +12,6 @@ local wibox = require("wibox")
-- Helpers
local helpers = require("helpers")
-- Pop up
------------
@ -101,15 +100,10 @@ awesome.connect_signal("signal::volume", function(value, muted)
end
end)
local bri_first_time = true
awesome.connect_signal("signal::brightness", function(value)
if bri_first_time then
bri_first_time = false
else
pop_icon.markup = ""
pop_bar.value = value
pop_bar.color = beautiful.pop_brightness_color
pop_icon.markup = ""
pop_bar.value = value
pop_bar.color = beautiful.pop_brightness_color
toggle_pop()
end
toggle_pop()
end)