Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mode_vertical/horizontal #12

Closed
nazar-pc opened this issue Mar 1, 2018 · 3 comments
Closed

mode_vertical/horizontal #12

nazar-pc opened this issue Mar 1, 2018 · 3 comments

Comments

@nazar-pc
Copy link

nazar-pc commented Mar 1, 2018

Following methods from readme seem to be either not implemented or not working properly:

  • lazy.layout.mode_horizontal()
  • lazy.layout.mode_vertical()
  • lazy.layout.mode_horizontal_split()
  • lazy.layout.mode_vertical_split()
2018-03-02 00:03:29,686 libqtile manager.py:handle_KeyPress():L933  KB command error mode_horizontal: No such command.
2018-03-02 00:03:29,939 libqtile manager.py:handle_KeyPress():L933  KB command error mode_vertical: No such command.
2018-03-02 00:03:31,850 libqtile manager.py:handle_KeyPress():L933  KB command error mode_horizontal_split: No such command.
2018-03-02 00:03:32,068 libqtile manager.py:handle_KeyPress():L933  KB command error mode_vertical_split: No such command.
@numirias
Copy link
Owner

numirias commented Mar 1, 2018

The commands are implemented and tested. Could you share your config (and in particular, your configured layouts)? This might happen because you execute the plasma-specific layout commands while having another layout activated.

@nazar-pc
Copy link
Author

nazar-pc commented Mar 1, 2018

Sure, here is the whole thing as it is right now:

#!/usr/bin/env python3
from libqtile.config import EzDrag, EzKey, EzClick, Screen, Group, Match
from libqtile.command import lazy
from libqtile import layout, hook
from plasma import Plasma
import subprocess
import os

# from plasma import Plasma

@hook.subscribe.startup_once
def dbus_register ():
	id = os.environ.get('DESKTOP_AUTOSTART_ID')
	if not id:
		return
	subprocess.Popen([
		'dbus-send',
		'--session',
		'--print-reply',
		'--dest=org.gnome.SessionManager',
		'/org/gnome/SessionManager',
		'org.gnome.SessionManager.RegisterClient',
		'string:qtile',
		'string:' + id
	])

@hook.subscribe.client_name_updated
def move_cerebro_to_current_group (window):
	if window.window.get_name() == 'Cerebro':
		window.togroup()

show_current_group_notification = lazy.function(
	lambda qtile:
		qtile.cmd_spawn('notify-send -h string:x-canonical-private-synchronous:qtile -t 50 "' + qtile.currentGroup.name + ': ' + qtile.currentLayout.name + '"')
)

mod = 'mod4'

keymap = {
	'M-<Left>'     : lazy.layout.left(),
	'M-<Down>'     : lazy.layout.down(),
	'M-<Up>'       : lazy.layout.up(),
	'M-<Right>'    : lazy.layout.right(),
	'M-S-<Left>'   : [lazy.layout.move_left(), lazy.layout.shuffle_up()],
	'M-S-<Down>'   : [lazy.layout.move_down(), lazy.layout.shuffle_down()],
	'M-S-<Up>'     : [lazy.layout.move_up(), lazy.layout.shuffle_up()],
	'M-S-<Right>'  : [lazy.layout.move_right(), lazy.layout.shuffle_down()],
	'M-A-<Left>'   : lazy.layout.integrate_left(),
	'M-A-<Down>'   : lazy.layout.integrate_down(),
	'M-A-<Up>'     : lazy.layout.integrate_up(),
	'M-A-<Right>'  : lazy.layout.integrate_right(),
	'A-S-<Tab>'    : lazy.layout.prev(),
	'A-<Tab>'      : lazy.layout.next(),
	'M-h'          : lazy.layout.mode_horizontal(),
	'M-v'          : lazy.layout.mode_vertical(),
	'M-S-h'        : lazy.layout.mode_horizontal_split(),
	'M-S-v'        : lazy.layout.mode_vertical_split(),
	'M-<End>'      : lazy.layout.grow_width(30),
	'M-<Home>'     : lazy.layout.grow_width(-30),
	'M-<Page_Up>'  : lazy.layout.grow_height(30),
	'M-<Page_Down>': lazy.layout.grow_height(-30),
	'M-<Tab>'      : [lazy.next_layout(), show_current_group_notification],
	'C-A-<Up>'     : [lazy.screen.prev_group(), show_current_group_notification],
	'C-A-<Down>'   : [lazy.screen.next_group(), show_current_group_notification],
	'M-w'          : lazy.window.kill(),
	'C-A-t'        : lazy.spawn('terminator'),
	'C-A-c'        : lazy.spawn('gnome-calculator'),
	'C-A-s'        : lazy.spawn('env XDG_CURRENT_DESKTOP=GNOME gnome-system-monitor'),
	'M-n'          : lazy.spawn('env XDG_CURRENT_DESKTOP=GNOME nemo'),
	'M-S-c'        : lazy.spawn('killall -9 cerebro'),
	'M-c'          : lazy.spawn('cerebro'),
	'M-a'          : lazy.spawn('pavucontrol'),
	'<XF86Tools>'  : lazy.spawn('clementine'),
	'<Print>'      : lazy.spawn('gnome-screenshot'),
	'A-<Print>'    : lazy.spawn('gnome-screenshot --window'),
	'S-<Print>'    : lazy.spawn('gnome-screenshot --area'),
	'<Caps_Lock>'  : lazy.spawn('xdotool key Alt+F2'),
	'M-C-r'        : lazy.restart(),
	'M-r'          : lazy.layout.reset_size(),
}

# Drag floating layouts.
mouse = [
	EzDrag('M-1', lazy.window.set_position_floating(), start = lazy.window.get_position()),
	EzDrag('M-3', lazy.window.set_size_floating(), start = lazy.window.get_size()),
	EzClick('M-2', lazy.window.bring_to_front()),
	EzClick('9', lazy.screen.prev_group()),
	EzClick('8', lazy.screen.next_group()),
]

layouts = [
	layout.MonadTall(name = 'MonadTall'),
	layout.Max(name = 'Max'),
	layout.Matrix(name = 'Matrix'),
	layout.Stack(name = 'Stack'),
	Plasma(name = 'Plasma')
]

groups = [
	Group('1', layout = 'MonadTall', matches = [Match(wm_class = ['Thunderbird'])]),
	Group('2', layout = 'MonadTall', matches = [Match(wm_class = ['Firefox', 'qBittorrent'])]),
	Group('3', layout = 'Max', matches = [Match(wm_class = ['jetbrains-idea'])]),
	Group('4', layout = 'Matrix', matches = [Match(wm_class = ['Clementine', 'Pavucontrol', 'Synaptic'])]),
	Group('5', layout = 'Matrix')
]

for i in groups:
	keymap['M-' + i.name] = [
		lazy.group[i.name].toscreen(),
		show_current_group_notification
	]
	keymap['M-S-' + i.name] = [
		lazy.window.togroup(i.name),
		lazy.group[i.name].toscreen(),
		show_current_group_notification
	]

keys = []
for k, v in keymap.items():
	if type(v) is list:
		keys.append(EzKey(k, *v))
	else:
		keys.append(EzKey(k, v))

screens = [
	Screen(),
]

follow_mouse_focus = True
bring_front_click = False
cursor_warp = False
floating_layout = layout.Floating()
auto_fullscreen = True
focus_on_window_activation = 'smart'

wmname = 'LG3D'

@nazar-pc
Copy link
Author

nazar-pc commented Mar 1, 2018

Indeed, I was on different layout, sorry about that.

@nazar-pc nazar-pc closed this as completed Mar 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants