From ed41889d2739c8e692e3e9f17767225719d98a8a Mon Sep 17 00:00:00 2001 From: Crescent617 Date: Sun, 18 Aug 2024 11:49:55 +0800 Subject: [PATCH] add sticky shortcut --- .luarc.json | 7 +++++++ rc.lua | 36 ++++++++++++++++++++---------------- themes/multicolor/theme.lua | 16 +++++++++++++--- 3 files changed, 40 insertions(+), 19 deletions(-) create mode 100644 .luarc.json diff --git a/.luarc.json b/.luarc.json new file mode 100644 index 0000000..7536827 --- /dev/null +++ b/.luarc.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json", + "workspace.library": [ + "./lain", + "./awesome-wm-widgets" + ] +} diff --git a/rc.lua b/rc.lua index 1ed6681..bcbd904 100644 --- a/rc.lua +++ b/rc.lua @@ -23,6 +23,11 @@ require "awful.hotkeys_popup.keys" local mytable = awful.util.table or gears.table -- 4.{0,1} compatibility local volume_widget = require "awesome-wm-widgets.volume-widget.volume" +-- }}} +-- {{{ Notification +naughty.config.defaults.position = "top_middle" +naughty.config.defaults.border_width = 2 +naughty.config.defaults.timeout = 10 -- }}} -- {{{ Error handling @@ -328,7 +333,7 @@ globalkeys = mytable.join( end, { description = "clipboard", group = "hotkeys" }), -- Show help - awful.key({ modkey }, "s", hotkeys_popup.show_help, { description = "show help", group = "awesome" }), + awful.key({ modkey }, "/", hotkeys_popup.show_help, { description = "show help", group = "awesome" }), -- Tag browsing awful.key({ modkey }, "Left", awful.tag.viewprev, { description = "view previous", group = "tag" }), @@ -602,19 +607,14 @@ globalkeys = mytable.join( clientkeys = mytable.join( awful.key({ altkey, "Shift" }, "m", lain.util.magnify_client, { description = "magnify client", group = "client" }), - awful.key({ modkey }, "f", function(c) - c.fullscreen = not c.fullscreen - c:raise() - end, { description = "toggle fullscreen", group = "client" }), + -- awful.key({ modkey }, "f", function(c) + -- c.fullscreen = not c.fullscreen + -- c:raise() + -- end, { description = "toggle fullscreen", group = "client" }), awful.key({ modkey }, "q", function(c) c:kill() end, { description = "close", group = "client" }), - awful.key( - { modkey, "Control" }, - "space", - awful.client.floating.toggle, - { description = "toggle floating", group = "client" } - ), + awful.key({ modkey }, "f", awful.client.floating.toggle, { description = "toggle floating", group = "client" }), awful.key({ modkey, "Shift" }, "Return", function(c) c:swap(awful.client.getmaster()) end, { description = "move to master", group = "client" }), @@ -624,6 +624,10 @@ clientkeys = mytable.join( awful.key({ modkey }, "t", function(c) c.ontop = not c.ontop end, { description = "toggle keep on top", group = "client" }), + awful.key({ modkey }, "s", function(c) + -- sticky + c.sticky = not c.sticky + end, { description = "toggle keep on top", group = "client" }), awful.key({ modkey }, "n", function(c) -- The client currently has the input focus, so it cannot be -- minimized, since minimized clients can't have the focus. @@ -756,6 +760,7 @@ awful.rules.rules = { "xtightvncviewer", "Clash for Windows", "eudic", + "flameshot", }, -- Note that the name property shown in xprop might be set slightly after creation of the client @@ -804,11 +809,10 @@ client.connect_signal("manage", function(c) if is_floating_layout() then c.floating = true end - if c.floating then - -- awful.placement.centered(c) - awful.placement.bottom_right(c) - - end + -- if c.floating then + -- awful.placement.centered(c) + -- awful.placement.bottom_right(c) + -- end end) -- Add a titlebar if titlebars_enabled is set to true in the rules. diff --git a/themes/multicolor/theme.lua b/themes/multicolor/theme.lua index e232711..7d7b2e0 100644 --- a/themes/multicolor/theme.lua +++ b/themes/multicolor/theme.lua @@ -78,7 +78,17 @@ theme.left_panel_width = dpi(55) theme.top_panel_height = dpi(26) -- Notification Sizing --- theme.notification_max_width = dpi(350) +theme.notification_width = dpi(500) +theme.notification_height = dpi(125) +theme.notification_icon_size = dpi(125) +-- round corners +theme.notification_shape = function(cr, width, height) + gears.shape.rounded_rect(cr, width, height, dpi(10)) +end +-- opacity +theme.notification_opacity = 0.9 +theme.notification_border_color = theme.border_marked + -- System Tray theme.bg_systray = theme.bg_normal @@ -126,7 +136,7 @@ local markup = lain.util.markup -- Textclock os.setlocale(os.getenv "LANG") -- to localize the clock -local mytextclock = wibox.widget.textclock(markup("#a7aaff", "%A %d %B ") .. markup("#de6eae", "%H:%M ")) +local mytextclock = wibox.widget.textclock(markup("#a7aaff", "%Y-%m-%d ") .. markup(focus_fg, "%H:%M ")) mytextclock.font = theme.font -- Calendar @@ -228,7 +238,7 @@ function theme.at_screen_connect(s) awful.spawn.with_shell "slock" end, onsuspend = function() - awful.spawn.with_shell "slock systemctl suspend" + awful.spawn.with_shell "systemctl suspend" end, }, },