1
0
Fork 0
mirror of https://github.com/lcpz/awesome-copycats.git synced 2026-03-23 05:55:12 +00:00

minimized/maximized windows on key press

This commit is contained in:
Toma Adrian Ionut 2022-11-02 15:19:43 +02:00
parent 88cf64a3fb
commit 3d04f87baf
2 changed files with 49 additions and 66 deletions

View file

@ -302,19 +302,17 @@ awful.key({modkey, "Ctrl"}, "Left", awful.tag.viewprev, {
description = "go back", description = "go back",
group = "tag" group = "tag"
}), -- Non-empty tag browsing }), -- Non-empty tag browsing
-- awful.key({altkey}, "Left", function() awful.key({altkey}, "Left", function()
-- lain.util.tag_view_nonempty(-1) lain.util.tag_view_nonempty(-1)
-- end, { end, {
-- description = "view previous nonempty", description = "view previous nonempty",
-- group = "tag" group = "tag"
-- }), }), awful.key({altkey}, "Right", function()
-- awful.key({altkey}, "Right", function() lain.util.tag_view_nonempty(1)
-- lain.util.tag_view_nonempty(1) end, {
-- end, { description = "view previous nonempty",
-- description = "view previous nonempty", group = "tag"
-- group = "tag" }), -- Default client focus
-- }),
-- Default client focus
awful.key({altkey}, "j", function() awful.key({altkey}, "j", function()
awful.client.focus.byidx(1) awful.client.focus.byidx(1)
end, { end, {
@ -618,50 +616,7 @@ end, {
end, { end, {
description = "volume 0%", description = "volume 0%",
group = "hotkeys" group = "hotkeys"
}), -- MPD control }), -- Copy primary to clipboard (terminals to gtk)
-- awful.key({altkey, "Control"}, "Up", function()
-- os.execute("mpc toggle")
-- beautiful.mpd.update()
-- end, {
-- description = "mpc toggle",
-- group = "widgets"
-- }), awful.key({altkey, "Control"}, "Down", function()
-- os.execute("mpc stop")
-- beautiful.mpd.update()
-- end, {
-- description = "mpc stop",
-- group = "widgets"
-- }), awful.key({altkey, "Control"}, "Left", function()
-- os.execute("mpc prev")
-- beautiful.mpd.update()
-- end, {
-- description = "mpc prev",
-- group = "widgets"
-- }), awful.key({altkey, "Control"}, "Right", function()
-- os.execute("mpc next")
-- beautiful.mpd.update()
-- end, {
-- description = "mpc next",
-- group = "widgets"
-- }), awful.key({altkey}, "0", function()
-- local common = {
-- text = "MPD widget ",
-- position = "top_middle",
-- timeout = 2
-- }
-- if beautiful.mpd.timer.started then
-- beautiful.mpd.timer:stop()
-- common.text = common.text .. lain.util.markup.bold("OFF")
-- else
-- beautiful.mpd.timer:start()
-- common.text = common.text .. lain.util.markup.bold("ON")
-- end
-- naughty.notify(common)
-- end, {
-- description = "mpc on/off",
-- group = "widgets"
-- }),
-- Copy primary to clipboard (terminals to gtk)
awful.key({modkey}, "c", function() awful.key({modkey}, "c", function()
awful.spawn.with_shell("xsel | xsel -i -b") awful.spawn.with_shell("xsel | xsel -i -b")
end, { end, {
@ -673,12 +628,40 @@ awful.key({modkey}, "v", function()
end, { end, {
description = "copy gtk to terminal", description = "copy gtk to terminal",
group = "hotkeys" group = "hotkeys"
}), -- User programs }), awful.key({modkey}, 'd', function()
awful.key({modkey}, "d", function() for _, cl in ipairs(mouse.screen.selected_tag:clients()) do
awful.spawn(browser) local c = cl
if c then
if _G.client.focus then
c.minimized = true
else
c.minimized = false
end
end
end
end, { end, {
description = "run browser", description = "min/max all windows",
group = "launcher" group = "client"
}), awful.key({altkey, "Control"}, "m", function()
for _, cl in ipairs(mouse.screen.selected_tag:clients()) do
local c = cl
if c then
c.minimized = true
end
end
end, {
description = "minimize all windows in current tag",
group = "client"
}), awful.key({altkey, "Control"}, "n", function()
for _, cl in ipairs(mouse.screen.selected_tag:clients()) do
local c = cl
if c then
c.minimized = false
end
end
end, {
description = "maximize all windows in current tag",
group = "client"
}), -- Default }), -- Default
--[[ Menubar --[[ Menubar
awful.key({ modkey }, "p", function() menubar.show() end, awful.key({ modkey }, "p", function() menubar.show() end,

View file

@ -108,13 +108,14 @@ theme.widget_cpu = theme.icon_dir .. "/cpu.png"
theme.widget_mem = theme.icon_dir .. "/mem.png" theme.widget_mem = theme.icon_dir .. "/mem.png"
-- http://fontawesome.io/cheatsheet -- http://fontawesome.io/cheatsheet
awful.util.tagnames = {"", "", "", "", "", ""} awful.util.tagnames = {"", "", "", "", "", ""}
local markup = lain.util.markup local markup = lain.util.markup
-- Clock -- Clock
-- os.setlocale(os.getenv("LANG")) -- to localize the clock -- os.setlocale(os.getenv("LANG")) -- to localize the clock
local mytextclock = wibox.widget.textclock(markup("#FFFFFF", "| %a %d %b | %H:%M |")) -- local mytextclock = wibox.widget.textclock(markup("#FFFFFF", "| %a %d %b | %H:%M |"))
local mytextclock = wibox.widget.textclock(markup("#FFFFFF", "| %H:%M |"))
mytextclock.font = theme.font mytextclock.font = theme.font
theme.cal = lain.widget.cal({ theme.cal = lain.widget.cal({
attach_to = {mytextclock}, attach_to = {mytextclock},
@ -494,8 +495,7 @@ function theme.at_screen_connect(s)
hspace, hspace,
s.mypromptbox, s.mypromptbox,
hspace, hspace,
s.mytasklist, s.mytasklist
hspace
}, },
{ -- Middle widgets { -- Middle widgets
layout = wibox.layout.flex.horizontal, layout = wibox.layout.flex.horizontal,