Compare commits
No commits in common. "e36f3889d8c8766ec9b9c61f95c6af0b1bcff06c" and "1c4697ace70fc8fcdcb414f4f50dcdccf4170cde" have entirely different histories.
e36f3889d8
...
1c4697ace7
|
@ -38,7 +38,7 @@ end
|
||||||
|
|
||||||
-- Resize client in given direction
|
-- Resize client in given direction
|
||||||
local floating_resize_amount = dpi(20)
|
local floating_resize_amount = dpi(20)
|
||||||
local tiling_resize_factor = 0.01
|
local tiling_resize_factor = 0.05
|
||||||
|
|
||||||
local function resize_client(c, direction)
|
local function resize_client(c, direction)
|
||||||
if awful.layout.get(mouse.screen) == awful.layout.suit.floating or (c and c.floating) then
|
if awful.layout.get(mouse.screen) == awful.layout.suit.floating or (c and c.floating) then
|
||||||
|
@ -379,31 +379,17 @@ keys.globalkeys = gears.table.join(
|
||||||
-- =========================================
|
-- =========================================
|
||||||
|
|
||||||
-- Gap control
|
-- Gap control
|
||||||
-- awful.key({modkey, :Shift"}, "minus",
|
awful.key({modkey, "Shift"}, "minus",
|
||||||
-- function()
|
function()
|
||||||
-- awful.tag.incgap(5, nil)
|
awful.tag.incgap(5, nil)
|
||||||
-- end,
|
|
||||||
-- {description = "increment gaps size for the current tag", group = "gaps"}
|
|
||||||
-- ),
|
|
||||||
-- awful.key({modkey}, "minus",
|
|
||||||
-- function()
|
|
||||||
-- awful.tag.incgap(-5, nil)
|
|
||||||
-- end,
|
|
||||||
-- {description = "decrement gap size for the current tag", group = "gaps"}
|
|
||||||
-- ),
|
|
||||||
|
|
||||||
awful.key({ modkey }, "=",
|
|
||||||
function ()
|
|
||||||
awful.tag.incncol( 1, nil, true)
|
|
||||||
end,
|
end,
|
||||||
{description = "increase the number of columns", group = "layout"}
|
{description = "increment gaps size for the current tag", group = "gaps"}
|
||||||
),
|
),
|
||||||
|
awful.key({modkey}, "minus",
|
||||||
awful.key({ modkey }, "minus",
|
function()
|
||||||
function ()
|
awful.tag.incgap(-5, nil)
|
||||||
awful.tag.incncol(-1, nil, true)
|
|
||||||
end,
|
end,
|
||||||
{description = "decrease the number of columns", group = "layout"}
|
{description = "decrement gap size for the current tag", group = "gaps"}
|
||||||
),
|
),
|
||||||
|
|
||||||
-- =========================================
|
-- =========================================
|
||||||
|
|
|
@ -6,8 +6,6 @@ from libqtile.utils import guess_terminal
|
||||||
from qtile_extras.widget.decorations import PowerLineDecoration
|
from qtile_extras.widget.decorations import PowerLineDecoration
|
||||||
from widgets.volume import Volume
|
from widgets.volume import Volume
|
||||||
|
|
||||||
import traverse
|
|
||||||
|
|
||||||
class Colors:
|
class Colors:
|
||||||
background = "#1f2430"
|
background = "#1f2430"
|
||||||
accent = "#002F5F"
|
accent = "#002F5F"
|
||||||
|
@ -37,9 +35,6 @@ screens = [
|
||||||
highlight_method="block",
|
highlight_method="block",
|
||||||
highlight_color=Colors.accent,
|
highlight_color=Colors.accent,
|
||||||
this_current_screen_border=Colors.accent,
|
this_current_screen_border=Colors.accent,
|
||||||
other_current_screen_border=Colors.accent,
|
|
||||||
this_screen_border="#00000000",
|
|
||||||
other_screen_border="#00000000",
|
|
||||||
font="Ubuntu bold",
|
font="Ubuntu bold",
|
||||||
padding=9,
|
padding=9,
|
||||||
hide_unused=True
|
hide_unused=True
|
||||||
|
@ -81,10 +76,10 @@ keys = [
|
||||||
# A list of available commands that can be bound to keys can be found
|
# A list of available commands that can be bound to keys can be found
|
||||||
# at https://docs.qtile.org/en/latest/manual/config/lazy.html
|
# at https://docs.qtile.org/en/latest/manual/config/lazy.html
|
||||||
# Switch between windows
|
# Switch between windows
|
||||||
Key([mod], 'k', lazy.function(traverse.up)),
|
Key([mod], "h", lazy.layout.left(), desc="Move focus to left"),
|
||||||
Key([mod], 'j', lazy.function(traverse.down)),
|
Key([mod], "l", lazy.layout.right(), desc="Move focus to right"),
|
||||||
Key([mod], 'h', lazy.function(traverse.left)),
|
Key([mod], "j", lazy.layout.down(), desc="Move focus down"),
|
||||||
Key([mod], 'l', lazy.function(traverse.right)),
|
Key([mod], "k", lazy.layout.up(), desc="Move focus up"),
|
||||||
Key([mod], "f", lazy.window.toggle_floating(), desc="Move focus up"),
|
Key([mod], "f", lazy.window.toggle_floating(), desc="Move focus up"),
|
||||||
Key([mod], "m", lazy.window.toggle_fullscreen(), desc="Move focus up"),
|
Key([mod], "m", lazy.window.toggle_fullscreen(), desc="Move focus up"),
|
||||||
Key([mod], "space", lazy.layout.next(), desc="Move window focus to other window"),
|
Key([mod], "space", lazy.layout.next(), desc="Move window focus to other window"),
|
||||||
|
@ -122,8 +117,9 @@ keys = [
|
||||||
]
|
]
|
||||||
|
|
||||||
groups = []
|
groups = []
|
||||||
for i in list(range(1, 10)) + [0]:
|
for s in screens:
|
||||||
groups.append(Group(str(i)))
|
for i in list(range(1, 10)) + [0]:
|
||||||
|
groups.append(Group(str(i), screen_affinity=s))
|
||||||
|
|
||||||
for i in groups[:10]:
|
for i in groups[:10]:
|
||||||
keys.extend(
|
keys.extend(
|
||||||
|
@ -132,7 +128,7 @@ for i in groups[:10]:
|
||||||
Key(
|
Key(
|
||||||
[mod],
|
[mod],
|
||||||
i.name,
|
i.name,
|
||||||
lazy.group[i.name].toscreen(),
|
lazy.group[i.name].toscreen(0),
|
||||||
desc="Switch to group {}".format(i.name),
|
desc="Switch to group {}".format(i.name),
|
||||||
),
|
),
|
||||||
# mod1 + shift + letter of group = switch to & move focused window to group
|
# mod1 + shift + letter of group = switch to & move focused window to group
|
||||||
|
@ -159,14 +155,13 @@ layout_settings = {
|
||||||
}
|
}
|
||||||
|
|
||||||
mouse = [
|
mouse = [
|
||||||
Drag([mod], "Button1", lazy.window.set_position(),
|
Drag([mod], "Button1", lazy.window.set_position(), start=lazy.window.get_position()),
|
||||||
start=lazy.window.get_position()),
|
|
||||||
Drag([mod], "Button3", lazy.window.set_position(), start=lazy.window.get_size())
|
Drag([mod], "Button3", lazy.window.set_position(), start=lazy.window.get_size())
|
||||||
]
|
]
|
||||||
|
|
||||||
layouts = [
|
layouts = [
|
||||||
layout.Columns(**layout_settings),
|
|
||||||
layout.Tile(**layout_settings),
|
layout.Tile(**layout_settings),
|
||||||
|
layout.Columns(**layout_settings),
|
||||||
layout.Max(),
|
layout.Max(),
|
||||||
# Try more layouts by unleashing below layouts.
|
# Try more layouts by unleashing below layouts.
|
||||||
# layout.Stack(num_stacks=2),
|
# layout.Stack(num_stacks=2),
|
||||||
|
|
|
@ -1,100 +0,0 @@
|
||||||
"""
|
|
||||||
This plugin exports four functions - up, down, left and right - that when called will
|
|
||||||
move window focus to the first window in that general direction. Focussing is based
|
|
||||||
entirely on position and geometry, so is independent of screens, layouts and whether
|
|
||||||
windows are floating or tiled. It can also move focus to and from empty screens.
|
|
||||||
|
|
||||||
Example usage:
|
|
||||||
|
|
||||||
import traverse
|
|
||||||
|
|
||||||
keys.extend([
|
|
||||||
Key([mod], 'k', lazy.function(traverse.up)),
|
|
||||||
Key([mod], 'j', lazy.function(traverse.down)),
|
|
||||||
Key([mod], 'h', lazy.function(traverse.left)),
|
|
||||||
Key([mod], 'l', lazy.function(traverse.right)),
|
|
||||||
])
|
|
||||||
|
|
||||||
Qtile versions known to work: 0.16 - 0.18
|
|
||||||
"""
|
|
||||||
|
|
||||||
from libqtile.config import Screen
|
|
||||||
|
|
||||||
|
|
||||||
def up(qtile):
|
|
||||||
_focus_window(qtile, -1, 'y')
|
|
||||||
|
|
||||||
|
|
||||||
def down(qtile):
|
|
||||||
_focus_window(qtile, 1, 'y')
|
|
||||||
|
|
||||||
|
|
||||||
def left(qtile):
|
|
||||||
_focus_window(qtile, -1, 'x')
|
|
||||||
|
|
||||||
|
|
||||||
def right(qtile):
|
|
||||||
_focus_window(qtile, 1, 'x')
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def get_window_in_direction(qtile, dir, axis):
|
|
||||||
win = None
|
|
||||||
win_wide = None
|
|
||||||
dist = 10000
|
|
||||||
dist_wide = 10000
|
|
||||||
cur = qtile.current_window
|
|
||||||
if not cur:
|
|
||||||
cur = qtile.current_screen
|
|
||||||
|
|
||||||
if axis == 'x':
|
|
||||||
dim = 'width'
|
|
||||||
band_axis = 'y'
|
|
||||||
band_dim = 'height'
|
|
||||||
cur_pos = cur.x
|
|
||||||
band_min = cur.y
|
|
||||||
band_max = cur.y + cur.height
|
|
||||||
else:
|
|
||||||
dim = 'height'
|
|
||||||
band_axis = 'x'
|
|
||||||
band_dim = 'width'
|
|
||||||
band_min = cur.x
|
|
||||||
cur_pos = cur.y
|
|
||||||
band_max = cur.x + cur.width
|
|
||||||
|
|
||||||
cur_pos += getattr(cur, dim) / 2
|
|
||||||
|
|
||||||
windows = [w for g in qtile.groups if g.screen for w in g.windows]
|
|
||||||
windows.extend([s for s in qtile.screens if not s.group.windows])
|
|
||||||
|
|
||||||
if cur in windows:
|
|
||||||
windows.remove(cur)
|
|
||||||
|
|
||||||
for w in windows:
|
|
||||||
if isinstance(w, Screen) or not w.minimized:
|
|
||||||
pos = getattr(w, axis) + getattr(w, dim) / 2
|
|
||||||
gap = dir * (pos - cur_pos)
|
|
||||||
if gap > 5:
|
|
||||||
band_pos = getattr(w, band_axis) + getattr(w, band_dim) / 2
|
|
||||||
if band_min < band_pos < band_max:
|
|
||||||
if gap < dist:
|
|
||||||
dist = gap
|
|
||||||
win = w
|
|
||||||
else:
|
|
||||||
if gap < dist_wide:
|
|
||||||
dist_wide = gap
|
|
||||||
win_wide = w
|
|
||||||
|
|
||||||
if not win:
|
|
||||||
win = win_wide
|
|
||||||
|
|
||||||
return win
|
|
||||||
|
|
||||||
|
|
||||||
def _focus_window(qtile, dir, axis):
|
|
||||||
win = get_window_in_direction(qtile, dir, axis)
|
|
||||||
if win:
|
|
||||||
qtile.focus_screen(win.group.screen.index)
|
|
||||||
win.group.focus(win, True)
|
|
||||||
if not isinstance(win, Screen):
|
|
||||||
win.focus(False)
|
|
Loading…
Reference in New Issue