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 -- Helpers
local helpers = require("helpers") local helpers = require("helpers")
local keys = {}
-- Default modkey. -- Default modkey.
modkey = "Mod4" modkey = "Mod4"
altkey = "Mod1" altkey = "Mod1"
ctrl = "Control" ctrl = "Control"
shift = "Shift" 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 -- Client and Tabs Bindings
awful.keyboard.append_global_keybindings({ awful.keyboard.append_global_keybindings({
awful.key({"Mod1"}, "a", function() awful.key({altkey}, "a", function()
bling.module.tabbed.pick_with_dmenu() bling.module.tabbed.pick_with_dmenu()
end, end,
{description = "pick client to add to tab group", group = "tabs"}), {description = "pick client to add to tab group", group = "tabs"}),
awful.key({"Mod1"}, "s", function() awful.key({altkey}, "s", function()
bling.module.tabbed.iter() bling.module.tabbed.iter()
end, end,
{description = "iterate through tabbing group", group = "tabs"}), {description = "iterate through tabbing group", group = "tabs"}),
awful.key({"Mod1"}, "d", function() awful.key({altkey}, "d", function()
bling.module.tabbed.pop() bling.module.tabbed.pop()
end, end,
{description = "remove focused client from tabbing group",group = "tabs"}), {description = "remove focused client from tabbing group",group = "tabs"}),
@ -223,7 +215,8 @@ awful.keyboard.append_global_keybindings({
{description = "increase the number of master clients", group = "layout"}), {description = "increase the number of master clients", group = "layout"}),
awful.key({modkey, "Shift"}, "l", function() awful.key({modkey, "Shift"}, "l", function()
awful.tag.incnmaster(-1, nil, true) 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.key({modkey, "Control"}, "h", function()
awful.tag.incncol(1, nil, true) awful.tag.incncol(1, nil, true)
end, 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() client.connect_signal("request::default_mousebindings", function()
awful.mouse.append_client_mousebindings({ awful.mouse.append_client_mousebindings({
awful.button({}, 1, function(c) awful.button({}, 1, function(c)
c:activate{context = "mouse_click"} 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"} 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"} c:activate{context = "mouse_click", action = "mouse_resize"}
end) end)
}) })

View file

@ -4,16 +4,17 @@ local hotkeys_popup = require("awful.hotkeys_popup")
local beautiful = require("beautiful") local beautiful = require("beautiful")
-- Create a launcher widget and a main menu -- Create a launcher widget and a main menu
local awesomemenu = { awful.screen.connect_for_each_screen(function(s)
{
"Hotkeys", -- Submenu
function() hotkeys_popup.show_help(nil, awful.screen.focused()) end awesomemenu = {
}, {"Hotkeys", function() hotkeys_popup.show_help(nil, awful.screen.focused()) end},
{"Restart", awesome.restart}, {"Restart", awesome.restart},
{"Quit", function() awesome.quit() end} {"Quit", function() awesome.quit() end}
} }
local powermenu = { -- Powermenu
powermenu = {
{"Power OFF", function() awful.spawn.with_shell("systemctl poweroff") end}, {"Power OFF", function() awful.spawn.with_shell("systemctl poweroff") end},
{"Reboot", function() awful.spawn.with_shell("systemctl reboot") end}, {"Reboot", function() awful.spawn.with_shell("systemctl reboot") end},
{"Suspend", function() {"Suspend", function()
@ -23,7 +24,8 @@ local powermenu = {
{"Lock Screen", function() lock_screen_show() end} {"Lock Screen", function() lock_screen_show() end}
} }
local mymainmenu = awful.menu({ -- Mainmenu
mymainmenu = awful.menu({
items = { items = {
{"Terminal", terminal, beautiful.awesome_logo}, {"Terminal", terminal, beautiful.awesome_logo},
{"Code Editor", vscode}, {"Code Editor", vscode},
@ -35,6 +37,5 @@ local mymainmenu = awful.menu({
} }
}) })
awful.mouse.append_global_mousebindings({ end)
awful.button({}, 3, function() mymainmenu:toggle() end)
})

View file

@ -221,10 +221,6 @@ theme = theme_assets.recolor_layout(theme, theme.xforeground)
-- Gaps -- Gaps
theme.useless_gap = dpi(5) theme.useless_gap = dpi(5)
-- Exit Screen
theme.exit_screen_fg = theme.xforeground
theme.exit_screen_bg = theme.xbackground
-- Wibar -- Wibar
theme.wibar_height = (dpi(42) + theme.widget_border_width) * 0 theme.wibar_height = (dpi(42) + theme.widget_border_width) * 0
theme.wibar_width = dpi(42) + theme.widget_border_width 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 = { widget_template = {
{ {
awful.widget.clienticon, awful.widget.clienticon,
margins = dpi(6), margins = dpi(8),
layout = wibox.container.margin layout = wibox.container.margin
}, },
id = "background_role", id = "background_role",

View file

@ -12,31 +12,55 @@ local wibox = require("wibox")
-- Helpers -- Helpers
local helpers = require("helpers") local helpers = require("helpers")
-- Keys
local keys = require("configuration.keys")
-- Titlebar -- Titlebar
------------- -------------
awful.titlebar.enable_tooltip = false awful.titlebar.enable_tooltip = false
client.connect_signal("request::titlebars", function(c) 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 -- Side titlebar setup
awful.titlebar(c, {position = beautiful.titlebar_position, size = beautiful.titlebar_size}):setup { awful.titlebar(c, {position = beautiful.titlebar_position, size = beautiful.titlebar_size}):setup {
{ {
{ {
awful.titlebar.widget.closebutton(c), awful.titlebar.widget.closebutton(c),
awful.titlebar.widget.maximizedbutton(c),
awful.titlebar.widget.minimizebutton(c), awful.titlebar.widget.minimizebutton(c),
awful.titlebar.widget.maximizedbutton(c),
layout = wibox.layout.fixed.vertical layout = wibox.layout.fixed.vertical
}, },
{ {
buttons = buttons,
widget = wibox.widget.textbox("") widget = wibox.widget.textbox("")
}, },
layout = wibox.layout.align.vertical layout = wibox.layout.align.vertical
}, },
margins = dpi(4), top = dpi(5),
bottom = dpi(5),
right = dpi(5),
widget = wibox.container.margin widget = wibox.container.margin
} }

View file

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