1
0
Fork 0
mirror of https://github.com/lcpz/awesome-copycats.git synced 2026-03-22 21:45:11 +00:00

add sticky shortcut

This commit is contained in:
Crescent617 2024-08-18 11:49:55 +08:00
parent 60aa37fc76
commit ed41889d27
3 changed files with 40 additions and 19 deletions

7
.luarc.json Normal file
View file

@ -0,0 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
"workspace.library": [
"./lain",
"./awesome-wm-widgets"
]
}

36
rc.lua
View file

@ -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.

View file

@ -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,
},
},