moved to personal fennel config for awesome and added qutebrowser
This commit is contained in:
parent
403cb92b7d
commit
688748f8a6
502 changed files with 8576 additions and 9597 deletions
30
awes2/configuration/client/buttons.lua
Normal file
30
awes2/configuration/client/buttons.lua
Normal file
|
@ -0,0 +1,30 @@
|
|||
local awful = require('awful')
|
||||
|
||||
local modkey = require('configuration.keys.mod').modKey
|
||||
|
||||
return awful.util.table.join(
|
||||
awful.button(
|
||||
{},
|
||||
1,
|
||||
function(c)
|
||||
_G.client.focus = c
|
||||
c:raise()
|
||||
end
|
||||
),
|
||||
awful.button({modkey}, 1, awful.mouse.client.move),
|
||||
awful.button({modkey}, 3, awful.mouse.client.resize),
|
||||
awful.button(
|
||||
{modkey},
|
||||
4,
|
||||
function()
|
||||
awful.layout.inc(1)
|
||||
end
|
||||
),
|
||||
awful.button(
|
||||
{modkey},
|
||||
5,
|
||||
function()
|
||||
awful.layout.inc(-1)
|
||||
end
|
||||
)
|
||||
)
|
1
awes2/configuration/client/init.lua
Normal file
1
awes2/configuration/client/init.lua
Normal file
|
@ -0,0 +1 @@
|
|||
require('configuration.client.rules')
|
256
awes2/configuration/client/keys.lua
Normal file
256
awes2/configuration/client/keys.lua
Normal file
|
@ -0,0 +1,256 @@
|
|||
local awful = require('awful')
|
||||
local gears = require('gears')
|
||||
|
||||
require('awful.autofocus')
|
||||
|
||||
local modkey = require('configuration.keys.mod').modKey
|
||||
local altkey = require('configuration.keys.mod').altKey
|
||||
|
||||
local dpi = require('beautiful').xresources.apply_dpi
|
||||
|
||||
local clientKeys =
|
||||
awful.util.table.join(
|
||||
|
||||
-- toggle fullscreen
|
||||
awful.key(
|
||||
{modkey},
|
||||
'f',
|
||||
function(c)
|
||||
-- Toggle fullscreen
|
||||
c.fullscreen = not c.fullscreen
|
||||
c:raise()
|
||||
end,
|
||||
{description = 'toggle fullscreen', group = 'client'}
|
||||
),
|
||||
|
||||
-- close client
|
||||
awful.key(
|
||||
{modkey},
|
||||
'q',
|
||||
function(c)
|
||||
c:kill()
|
||||
end,
|
||||
{description = 'close', group = 'client'}
|
||||
),
|
||||
-- Default client focus
|
||||
awful.key(
|
||||
{modkey},
|
||||
'd',
|
||||
function()
|
||||
awful.client.focus.byidx(1)
|
||||
end,
|
||||
{description = 'focus next by index', group = 'client'}
|
||||
),
|
||||
awful.key(
|
||||
{modkey},
|
||||
'a',
|
||||
function()
|
||||
awful.client.focus.byidx(-1)
|
||||
end,
|
||||
{description = 'focus previous by index', group = 'client'}
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Shift" },
|
||||
"d",
|
||||
function ()
|
||||
awful.client.swap.byidx(1)
|
||||
end,
|
||||
{description = "swap with next client by index", group = "client"}
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Shift" },
|
||||
"a",
|
||||
function ()
|
||||
awful.client.swap.byidx(-1)
|
||||
end,
|
||||
{description = "swap with next client by index", group = "client"}
|
||||
),
|
||||
|
||||
awful.key(
|
||||
{modkey},
|
||||
'u',
|
||||
awful.client.urgent.jumpto,
|
||||
{description = 'jump to urgent client', group = 'client'}
|
||||
),
|
||||
awful.key(
|
||||
{modkey},
|
||||
'Tab',
|
||||
function()
|
||||
awful.client.focus.history.previous()
|
||||
if client.focus then
|
||||
client.focus:raise()
|
||||
end
|
||||
end,
|
||||
{description = 'go back', group = 'client'}
|
||||
),
|
||||
awful.key(
|
||||
{modkey},
|
||||
'n',
|
||||
function(c)
|
||||
c.minimized = true
|
||||
end,
|
||||
{description = "minimize client", group = 'client'}
|
||||
),
|
||||
-- move floating client to center
|
||||
awful.key(
|
||||
{ modkey, "Shift" },
|
||||
"c",
|
||||
function(c)
|
||||
local focused = awful.screen.focused()
|
||||
|
||||
awful.placement.centered(c, {
|
||||
honor_workarea = true
|
||||
})
|
||||
end,
|
||||
{description = 'align a client to the center of the focused screen.', group = "client"}
|
||||
),
|
||||
|
||||
-- toggle client floating mode
|
||||
awful.key(
|
||||
{modkey},
|
||||
'c',
|
||||
function(c)
|
||||
c.fullscreen = false
|
||||
c.maximized = false
|
||||
c.floating = not c.floating
|
||||
c:raise()
|
||||
end,
|
||||
{description = 'toggle floating', group = 'client'}
|
||||
),
|
||||
|
||||
-- move client position
|
||||
awful.key(
|
||||
{modkey},
|
||||
'Up',
|
||||
function(c)
|
||||
if c.floating then
|
||||
c:relative_move(0, dpi(-10), 0, 0)
|
||||
end
|
||||
end,
|
||||
{description = 'move floating client up by 10 px', group = 'client'}
|
||||
),
|
||||
awful.key(
|
||||
{modkey},
|
||||
'Down',
|
||||
function(c)
|
||||
if c.floating then
|
||||
c:relative_move(0, dpi(10), 0, 0)
|
||||
end
|
||||
end,
|
||||
{description = 'move floating client down by 10 px', group = 'client'}
|
||||
),
|
||||
awful.key(
|
||||
{modkey},
|
||||
'Left',
|
||||
function(c)
|
||||
if c.floating then
|
||||
c:relative_move(dpi(-10), 0, 0, 0)
|
||||
end
|
||||
end,
|
||||
{description = 'move floating client to the left by 10 px', group = 'client'}
|
||||
),
|
||||
awful.key(
|
||||
{modkey},
|
||||
'Right',
|
||||
function(c)
|
||||
if c.floating then
|
||||
c:relative_move(dpi(10), 0, 0, 0)
|
||||
end
|
||||
end,
|
||||
{description = 'move floating client to the right by 10 px', group = 'client'}
|
||||
),
|
||||
|
||||
-- Increasing floating client size
|
||||
awful.key(
|
||||
{modkey, 'Shift'},
|
||||
'Up',
|
||||
function(c)
|
||||
if c.floating then
|
||||
c:relative_move(0, dpi(-10), 0, dpi(10))
|
||||
end
|
||||
end,
|
||||
{description = 'increase floating client size vertically by 10 px up', group = 'client'}
|
||||
),
|
||||
awful.key(
|
||||
{modkey, 'Shift'},
|
||||
'Down',
|
||||
function(c)
|
||||
if c.floating then
|
||||
c:relative_move(0, 0, 0, dpi(10))
|
||||
end
|
||||
end,
|
||||
{description = 'increase floating client size vertically by 10 px down', group = 'client'}
|
||||
),
|
||||
awful.key(
|
||||
{modkey, 'Shift'},
|
||||
'Left',
|
||||
function(c)
|
||||
if c.floating then
|
||||
c:relative_move(dpi(-10), 0, dpi(10), 0)
|
||||
end
|
||||
end,
|
||||
{description = 'increase floating client size horizontally by 10 px left', group = 'client'}
|
||||
),
|
||||
awful.key(
|
||||
{modkey, 'Shift'},
|
||||
'Right',
|
||||
function(c)
|
||||
if c.floating then
|
||||
c:relative_move(0, 0, dpi(10), 0)
|
||||
end
|
||||
end,
|
||||
{description = 'increase floating client size horizontally by 10 px right', group = 'client'}
|
||||
),
|
||||
|
||||
-- Decreasing floating client size
|
||||
awful.key(
|
||||
{modkey, 'Control'},
|
||||
'Up',
|
||||
function(c)
|
||||
if c.floating and c.height > 10 then
|
||||
c:relative_move(0, 0, 0, dpi(-10))
|
||||
end
|
||||
end,
|
||||
{description = 'decrease floating client size vertically by 10 px up', group = 'client'}
|
||||
),
|
||||
awful.key(
|
||||
{modkey, 'Control'},
|
||||
'Down',
|
||||
function(c)
|
||||
if c.floating then
|
||||
local c_height = c.height
|
||||
c:relative_move(0, 0, 0, dpi(-10))
|
||||
if c.height ~= c_height and c.height > 10 then
|
||||
c:relative_move(0, dpi(10), 0, 0)
|
||||
end
|
||||
end
|
||||
end,
|
||||
{description = 'decrease floating client size vertically by 10 px down', group = 'client'}
|
||||
),
|
||||
awful.key(
|
||||
{modkey, 'Control'},
|
||||
'Left',
|
||||
function(c)
|
||||
if c.floating and c.width > 10 then
|
||||
c:relative_move(0, 0, dpi(-10), 0)
|
||||
end
|
||||
end,
|
||||
{description = 'decrease floating client size horizontally by 10 px left', group = 'client'}
|
||||
),
|
||||
awful.key(
|
||||
{modkey, 'Control'},
|
||||
'Right',
|
||||
function(c)
|
||||
if c.floating then
|
||||
local c_width = c.width
|
||||
c:relative_move(0, 0, dpi(-10), 0)
|
||||
if c.width ~= c_width and c.width > 10 then
|
||||
c:relative_move(dpi(10), 0 , 0, 0)
|
||||
end
|
||||
end
|
||||
end,
|
||||
{description = 'decrease floating client size horizontally by 10 px right', group = 'client'}
|
||||
)
|
||||
)
|
||||
|
||||
return clientKeys
|
415
awes2/configuration/client/rules.lua
Normal file
415
awes2/configuration/client/rules.lua
Normal file
|
@ -0,0 +1,415 @@
|
|||
local awful = require('awful')
|
||||
local gears = require('gears')
|
||||
local ruled = require("ruled")
|
||||
local beautiful = require('beautiful')
|
||||
|
||||
local client_keys = require('configuration.client.keys')
|
||||
local client_buttons = require('configuration.client.buttons')
|
||||
|
||||
ruled.client.connect_signal(
|
||||
"request::rules",
|
||||
function()
|
||||
|
||||
-- All clients will match this rule.
|
||||
ruled.client.append_rule {
|
||||
id = "global",
|
||||
rule = { },
|
||||
properties = {
|
||||
focus = awful.client.focus.filter,
|
||||
raise = true,
|
||||
floating = false,
|
||||
maximized = false,
|
||||
above = false,
|
||||
below = false,
|
||||
ontop = false,
|
||||
sticky = false,
|
||||
maximized_horizontal = false,
|
||||
maximized_vertical = false,
|
||||
round_corners = true,
|
||||
keys = client_keys,
|
||||
buttons = client_buttons,
|
||||
screen = awful.screen.preferred,
|
||||
placement = awful.placement.no_overlap + awful.placement.no_offscreen
|
||||
}
|
||||
}
|
||||
|
||||
-- Dialogs
|
||||
ruled.client.append_rule {
|
||||
id = "dialog",
|
||||
rule_any = {
|
||||
type = { "dialog" },
|
||||
class = { "Wicd-client.py", "calendar.google.com" }
|
||||
},
|
||||
properties = {
|
||||
titlebars_enabled = true,
|
||||
floating = true,
|
||||
above = true,
|
||||
draw_backdrop = true,
|
||||
skip_decoration = true,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, beautiful.client_radius)
|
||||
end,
|
||||
placement = awful.placement.centered
|
||||
}
|
||||
}
|
||||
|
||||
-- Modals
|
||||
ruled.client.append_rule {
|
||||
id = "dialog",
|
||||
rule_any = {
|
||||
type = { "modal" }
|
||||
},
|
||||
properties = {
|
||||
titlebars_enabled = true,
|
||||
floating = true,
|
||||
above = true,
|
||||
draw_backdrop = true,
|
||||
skip_decoration = true,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, beautiful.client_radius)
|
||||
end,
|
||||
placement = awful.placement.centered
|
||||
}
|
||||
}
|
||||
|
||||
-- Utilities
|
||||
ruled.client.append_rule {
|
||||
id = "utility",
|
||||
rule_any = {
|
||||
type = { "utility" }
|
||||
},
|
||||
properties = {
|
||||
titlebars_enabled = false,
|
||||
floating = true,
|
||||
hide_titlebars = true,
|
||||
draw_backdrop = false,
|
||||
skip_decoration = true,
|
||||
placement = awful.placement.centered
|
||||
}
|
||||
}
|
||||
|
||||
-- Splash
|
||||
ruled.client.append_rule {
|
||||
id = "splash",
|
||||
rule_any = {
|
||||
type = { "splash" }
|
||||
},
|
||||
properties = {
|
||||
titlebars_enabled = false,
|
||||
floating = true,
|
||||
above = true,
|
||||
hide_titlebars = true,
|
||||
draw_backdrop = false,
|
||||
skip_decoration = true,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, beautiful.client_radius)
|
||||
end,
|
||||
placement = awful.placement.centered
|
||||
}
|
||||
}
|
||||
|
||||
-- terminal emulators
|
||||
ruled.client.append_rule {
|
||||
id = "terminals",
|
||||
rule_any = {
|
||||
class = {
|
||||
"URxvt",
|
||||
"XTerm",
|
||||
"UXTerm",
|
||||
"kitty",
|
||||
"K3rmit"
|
||||
}
|
||||
},
|
||||
except_any = {
|
||||
instance = { "QuakeTerminal" }
|
||||
},
|
||||
properties = {
|
||||
tag = '1',
|
||||
switchtotag = true,
|
||||
draw_backdrop = false,
|
||||
size_hints_honor = false
|
||||
}
|
||||
}
|
||||
|
||||
-- Browsers
|
||||
ruled.client.append_rule {
|
||||
id = "web_browsers",
|
||||
rule_any = {
|
||||
class = {
|
||||
"firefox",
|
||||
"Tor Browser",
|
||||
"discord",
|
||||
"Chromium",
|
||||
"Google-chrome"
|
||||
}
|
||||
},
|
||||
properties = {
|
||||
tag = '2'
|
||||
}
|
||||
}
|
||||
|
||||
-- text editors
|
||||
ruled.client.append_rule {
|
||||
id = "text_editors",
|
||||
rule_any = {
|
||||
class = {
|
||||
"Geany",
|
||||
"Atom",
|
||||
"Subl3",
|
||||
"code-oss"
|
||||
},
|
||||
name = {
|
||||
"LibreOffice",
|
||||
"libreoffice"
|
||||
}
|
||||
},
|
||||
properties = {
|
||||
tag = '3'
|
||||
}
|
||||
}
|
||||
|
||||
-- File managers
|
||||
ruled.client.append_rule {
|
||||
id = "file_managers",
|
||||
rule_any = {
|
||||
class = {
|
||||
"dolphin",
|
||||
"ark",
|
||||
"Nemo",
|
||||
"File-roller"
|
||||
}
|
||||
},
|
||||
properties = {
|
||||
tag = '4',
|
||||
switchtotag = true
|
||||
}
|
||||
}
|
||||
|
||||
-- Multimedia
|
||||
ruled.client.append_rule {
|
||||
id = "multimedia",
|
||||
rule_any = {
|
||||
class = {
|
||||
"vlc",
|
||||
"Spotify"
|
||||
}
|
||||
},
|
||||
properties = {
|
||||
tag = '5',
|
||||
switchtotag = true,
|
||||
draw_backdrop = false
|
||||
}
|
||||
}
|
||||
|
||||
-- Gaming
|
||||
ruled.client.append_rule {
|
||||
id = "gaming",
|
||||
rule_any = {
|
||||
class = {
|
||||
"Wine",
|
||||
"dolphin-emu",
|
||||
"Steam",
|
||||
"Citra",
|
||||
"SuperTuxKart"
|
||||
},
|
||||
name = { "Steam" }
|
||||
},
|
||||
properties = {
|
||||
tag = '6',
|
||||
skip_decoration = true,
|
||||
draw_backdrop = false,
|
||||
switchtotag = true,
|
||||
floating = true,
|
||||
hide_titlebars = true,
|
||||
placement = awful.placement.centered
|
||||
}
|
||||
}
|
||||
|
||||
-- Graphics Editing
|
||||
ruled.client.append_rule {
|
||||
id = "graphics_editors",
|
||||
rule_any = {
|
||||
class = {
|
||||
"Gimp-2.10",
|
||||
"Inkscape",
|
||||
"Flowblade"
|
||||
}
|
||||
},
|
||||
properties = {
|
||||
tag = '7'
|
||||
}
|
||||
}
|
||||
|
||||
-- Sandboxes and VMs
|
||||
ruled.client.append_rule {
|
||||
id = "sandbox",
|
||||
rule_any = {
|
||||
class = {
|
||||
"VirtualBox Manage",
|
||||
"VirtualBox Machine"
|
||||
}
|
||||
},
|
||||
properties = {
|
||||
tag = '8'
|
||||
}
|
||||
}
|
||||
|
||||
-- IDEs and Tools
|
||||
ruled.client.append_rule {
|
||||
id = "ide",
|
||||
rule_any = {
|
||||
class = {
|
||||
"Oomox",
|
||||
"Unity",
|
||||
"UnityHub",
|
||||
"jetbrains-studio"
|
||||
}
|
||||
},
|
||||
properties = {
|
||||
tag = '9',
|
||||
skip_decoration = true
|
||||
}
|
||||
}
|
||||
|
||||
-- Image viewers with splash-like behaviour
|
||||
ruled.client.append_rule {
|
||||
id = "splash_like",
|
||||
rule_any = {
|
||||
class = {
|
||||
"feh",
|
||||
"Pqiv",
|
||||
"Sxiv"
|
||||
},
|
||||
name = {"Discord Updater"}
|
||||
},
|
||||
properties = {
|
||||
skip_decoration = true,
|
||||
hide_titlebars = true,
|
||||
floating = true,
|
||||
ontop = true,
|
||||
placement = awful.placement.centered
|
||||
}
|
||||
}
|
||||
|
||||
-- Splash-like but with titlebars enabled
|
||||
ruled.client.append_rule {
|
||||
id = "instances",
|
||||
rule_any = {
|
||||
instance = {
|
||||
"file_progress",
|
||||
"Popup",
|
||||
"nm-connection-editor",
|
||||
},
|
||||
class = {
|
||||
"scrcpy" ,
|
||||
"Mugshot",
|
||||
"Pulseeffects"
|
||||
}
|
||||
},
|
||||
properties = {
|
||||
skip_decoration = true,
|
||||
round_corners = true,
|
||||
ontop = true,
|
||||
floating = true,
|
||||
draw_backdrop = false,
|
||||
focus = awful.client.focus.filter,
|
||||
raise = true,
|
||||
keys = client_keys,
|
||||
buttons = client_buttons,
|
||||
placement = awful.placement.centered
|
||||
}
|
||||
}
|
||||
|
||||
-- Fullsreen
|
||||
ruled.client.append_rule {
|
||||
id = "fullscreen",
|
||||
rule_any = {
|
||||
class = {
|
||||
"SuperTuxKart"
|
||||
}
|
||||
},
|
||||
properties = {
|
||||
skip_decoration = true,
|
||||
round_corners = false,
|
||||
ontop = true,
|
||||
floating = false,
|
||||
fullscreen = true,
|
||||
draw_backdrop = false,
|
||||
raise = true,
|
||||
keys = client_keys,
|
||||
buttons = client_buttons,
|
||||
placement = awful.placement.centered
|
||||
}
|
||||
}
|
||||
|
||||
end
|
||||
)
|
||||
|
||||
|
||||
-- Normally we'd do this with a rule, but other apps like spotify and supertuxkart doesn't set its class or name
|
||||
-- until after it starts up, so we need to catch that signal.
|
||||
|
||||
-- If the application is fullscreen in its settings, make sure to set `c.fullscreen = false` first
|
||||
-- before moving to the desired tag or else the tag where the program spawn will cause panels to hide.
|
||||
-- After moving the program to specified tag you can set `c.fullscreen = true` now
|
||||
-- See what I did in `SuperTuxKart`
|
||||
|
||||
client.connect_signal(
|
||||
"property::class",
|
||||
function(c)
|
||||
if c.class == "Spotify" then
|
||||
-- Check if Spotify is already open
|
||||
local spotify = function (c)
|
||||
return ruled.client.match(c, { class = "Spotify" })
|
||||
end
|
||||
|
||||
local spotify_count = 0
|
||||
for c in awful.client.iterate(spotify) do
|
||||
spotify_count = spotify_count + 1
|
||||
end
|
||||
|
||||
-- If Spotify is already open, don't open a new instance
|
||||
if spotify_count > 1 then
|
||||
c:kill()
|
||||
-- Switch to previous instance
|
||||
for c in awful.client.iterate(spotify) do
|
||||
c:jump_to(false)
|
||||
end
|
||||
else
|
||||
-- Move the Spotify instance to "5" tag on this screen
|
||||
local t = awful.tag.find_by_name(awful.screen.focused(), "5")
|
||||
c:move_to_tag(t)
|
||||
end
|
||||
elseif c.class == "SuperTuxKart" then
|
||||
-- Disable fullscreen first
|
||||
c.fullscreen = false
|
||||
|
||||
-- Check if SuperTuxKart is already open
|
||||
local stk = function (c)
|
||||
return ruled.client.match(c, { class = "SuperTuxKart" })
|
||||
end
|
||||
|
||||
local stk_count = 0
|
||||
for c in awful.client.iterate(stk) do
|
||||
stk_count = stk_count + 1
|
||||
end
|
||||
|
||||
-- If SuperTuxKart is already open, don't open a new instance
|
||||
if stk_count > 1 then
|
||||
c:kill()
|
||||
-- Switch to previous instance
|
||||
for c in awful.client.iterate(stk) do
|
||||
c:jump_to(false)
|
||||
end
|
||||
else
|
||||
-- Move the instance to specified tag tag on this screen
|
||||
local t = awful.tag.find_by_name(awful.screen.focused(), "6")
|
||||
c:move_to_tag(t)
|
||||
t:view_only()
|
||||
-- Enable fullscreeen again
|
||||
c.fullscreen = true
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue