mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-22 11:00:27 +10:00
Adding fixing a few things.
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
- [[#default-widget-settings][Default Widget Settings]]
|
||||
- [[#widgets][Widgets]]
|
||||
- [[#screens][Screens]]
|
||||
- [[#some-important-functions][Some Important Functions]]
|
||||
- [[#drag-floating-windows][Drag floating windows]]
|
||||
- [[#floating-windows][Floating windows]]
|
||||
- [[#startup-applications][Startup applications]]
|
||||
@@ -49,7 +50,6 @@ or substantial portions of the Software.
|
||||
- Complete remote scriptability - write scripts to set up workspaces, manipulate windows, update status bar widgets and more.
|
||||
- Qtile's remote scriptability makes it one of the most thoroughly unit-tested window managers around.
|
||||
|
||||
|
||||
* Imports
|
||||
These are python modules that must be imported for this config.
|
||||
|
||||
@@ -59,7 +59,7 @@ import os
|
||||
import re
|
||||
import socket
|
||||
import subprocess
|
||||
from libqtile.config import KeyChord. Key, Screen, Group, Drag, Click
|
||||
from libqtile.config import KeyChord, Key, Screen, Group, Drag, Click
|
||||
from libqtile.command import lazy
|
||||
from libqtile import layout, bar, widget, hook
|
||||
from libqtile.lazy import lazy
|
||||
@@ -645,6 +645,37 @@ if __name__ in ["config", "__main__"]:
|
||||
widgets_screen2 = init_widgets_screen2()
|
||||
#+END_SRC
|
||||
|
||||
* Some Important Functions
|
||||
|
||||
#+begin_src python
|
||||
def window_to_prev_group(qtile):
|
||||
if qtile.currentWindow is not None:
|
||||
i = qtile.groups.index(qtile.currentGroup)
|
||||
qtile.currentWindow.togroup(qtile.groups[i - 1].name)
|
||||
|
||||
def window_to_next_group(qtile):
|
||||
if qtile.currentWindow is not None:
|
||||
i = qtile.groups.index(qtile.currentGroup)
|
||||
qtile.currentWindow.togroup(qtile.groups[i + 1].name)
|
||||
|
||||
def window_to_previous_screen(qtile):
|
||||
i = qtile.screens.index(qtile.current_screen)
|
||||
if i != 0:
|
||||
group = qtile.screens[i - 1].group.name
|
||||
qtile.current_window.togroup(group)
|
||||
|
||||
def window_to_next_screen(qtile):
|
||||
i = qtile.screens.index(qtile.current_screen)
|
||||
if i + 1 != len(qtile.screens):
|
||||
group = qtile.screens[i + 1].group.name
|
||||
qtile.current_window.togroup(group)
|
||||
|
||||
def switch_screens(qtile):
|
||||
i = qtile.screens.index(qtile.current_screen)
|
||||
group = qtile.screens[i - 1].group
|
||||
qtile.current_screen.set_group(group)
|
||||
#+end_src
|
||||
|
||||
* Drag floating windows
|
||||
Defining some mousebindings for use with floating windows.
|
||||
|
||||
|
||||
@@ -3,9 +3,10 @@ import os
|
||||
import re
|
||||
import socket
|
||||
import subprocess
|
||||
from libqtile.config import Key, Screen, Group, Drag, Click
|
||||
from libqtile.config import KeyChord, Key, Screen, Group, Drag, Click
|
||||
from libqtile.command import lazy
|
||||
from libqtile import layout, bar, widget, hook
|
||||
from libqtile.lazy import lazy
|
||||
from typing import List # noqa: F401
|
||||
|
||||
mod = "mod4" # Sets mod key to SUPER/WINDOWS
|
||||
@@ -144,7 +145,6 @@ keys = [
|
||||
desc='Passmenu'
|
||||
),
|
||||
Key(["mod1", "control"], "r",
|
||||
lazy.spawn("./.dmenu/dmenu-reddio.sh"),
|
||||
desc='Dmenu reddio script'
|
||||
),
|
||||
Key(["mod1", "control"], "s",
|
||||
@@ -388,9 +388,8 @@ def init_widgets_list():
|
||||
background = colors[4],
|
||||
fontsize = 14
|
||||
),
|
||||
widget.CheckUpdates(
|
||||
widget.Pacman(
|
||||
update_interval = 1800,
|
||||
distro = 'Arch',
|
||||
foreground = colors[2],
|
||||
mouse_callbacks = {'Button1': lambda qtile: qtile.cmd_spawn(myTerm + ' -e sudo pacman -Syu')},
|
||||
background = colors[4]
|
||||
@@ -517,6 +516,33 @@ if __name__ in ["config", "__main__"]:
|
||||
widgets_screen1 = init_widgets_screen1()
|
||||
widgets_screen2 = init_widgets_screen2()
|
||||
|
||||
def window_to_prev_group(qtile):
|
||||
if qtile.currentWindow is not None:
|
||||
i = qtile.groups.index(qtile.currentGroup)
|
||||
qtile.currentWindow.togroup(qtile.groups[i - 1].name)
|
||||
|
||||
def window_to_next_group(qtile):
|
||||
if qtile.currentWindow is not None:
|
||||
i = qtile.groups.index(qtile.currentGroup)
|
||||
qtile.currentWindow.togroup(qtile.groups[i + 1].name)
|
||||
|
||||
def window_to_previous_screen(qtile):
|
||||
i = qtile.screens.index(qtile.current_screen)
|
||||
if i != 0:
|
||||
group = qtile.screens[i - 1].group.name
|
||||
qtile.current_window.togroup(group)
|
||||
|
||||
def window_to_next_screen(qtile):
|
||||
i = qtile.screens.index(qtile.current_screen)
|
||||
if i + 1 != len(qtile.screens):
|
||||
group = qtile.screens[i + 1].group.name
|
||||
qtile.current_window.togroup(group)
|
||||
|
||||
def switch_screens(qtile):
|
||||
i = qtile.screens.index(qtile.current_screen)
|
||||
group = qtile.screens[i - 1].group
|
||||
qtile.current_screen.set_group(group)
|
||||
|
||||
mouse = [
|
||||
Drag([mod], "Button1", lazy.window.set_position_floating(),
|
||||
start=lazy.window.get_position()),
|
||||
|
||||
Reference in New Issue
Block a user