diff options
Diffstat (limited to '.config')
-rw-r--r-- | .config/qtile/config.py | 204 |
1 files changed, 6 insertions, 198 deletions
diff --git a/.config/qtile/config.py b/.config/qtile/config.py index 15caee0..6f963bd 100644 --- a/.config/qtile/config.py +++ b/.config/qtile/config.py @@ -35,11 +35,9 @@ from libqtile import layout, bar, widget, hook from libqtile.config import Click, Drag, Group, Key, Match, Screen, Rule from libqtile.command import lazy from libqtile.widget import Spacer - -#mod4 or mod = super key -mod = "mod4" -mod1 = "alt" -mod2 = "control" +from keys import MyKeys +from libqtile.dgroups import simple_key_binder +#from widgets import * @hook.subscribe.startup_once def start_once(): @@ -59,187 +57,14 @@ def window_to_next_group(qtile): i = qtile.groups.index(qtile.currentGroup) qtile.currentWindow.togroup(qtile.groups[i + 1].name) -mod = "mod4" # Sets mod key to SUPER/WINDOWS -myTerm = "alacritty" # My terminal of choice -myBrowser = "qutebrowser" # My browser of choice - -keys = [ - ### The essentials - Key([mod], "Return", - lazy.spawn(myTerm), - desc='Launches My Terminal' - ), - Key([mod, "shift"], "a", - lazy.spawn('anki'), - desc='Launch anki'), - Key([mod, "shift"], "m", - lazy.spawn("spotify"), - desc="Laucnh spotify"), - Key([mod], "Tab", - lazy.spawn("dmenu_run -p 'Run: '"), - desc='Run Launcher' - ), - Key([mod], "p", - lazy.spawn("passmenu -p 'Password for: '"), - ), - Key([mod], "b", - lazy.spawn(myBrowser), - desc='Qutebrowser' - ), - Key([mod, "shift"], "c", - lazy.next_layout(), - desc='Toggle through layouts' - ), - Key([mod], "q", - lazy.window.kill(), - desc='Kill active window' - ), - Key([mod, "shift"], "r", - lazy.restart(), - desc='Restart Qtile' - ), - Key([mod, "shift"], "0", - lazy.shutdown(), - desc='Shutdown Qtile' - ), - Key([mod, "shift"], "e", - lazy.spawn("emacsclient -c -a 'emacs'"), - desc='Doom Emacs' - ), - ### Switch focus of monitors - Key([mod], "period", - lazy.next_screen(), - desc='Move focus to next monitor' - ), - Key([mod], "comma", - lazy.prev_screen(), - desc='Move focus to prev monitor' - ), - ### Treetab controls - Key([mod, "shift"], "h", - lazy.layout.move_left(), - desc='Move up a section in treetab' - ), - Key([mod, "shift"], "l", - lazy.layout.move_right(), - desc='Move down a section in treetab' - ), - ### Window controls - Key([mod], "j", - lazy.layout.down(), - desc='Move focus down in current stack pane' - ), - Key([mod], "k", - lazy.layout.up(), - desc='Move focus up in current stack pane' - ), - Key([mod, "shift"], "j", - lazy.layout.shuffle_down(), - lazy.layout.section_down(), - desc='Move windows down in current stack' - ), - Key([mod, "shift"], "k", - lazy.layout.shuffle_up(), - lazy.layout.section_up(), - desc='Move windows up in current stack' - ), - Key([mod], "h", - lazy.layout.shrink(), - lazy.layout.decrease_nmaster(), - desc='Shrink window (MonadTall), decrease number in master pane (Tile)' - ), - Key([mod], "l", - lazy.layout.grow(), - lazy.layout.increase_nmaster(), - desc='Expand window (MonadTall), increase number in master pane (Tile)' - ), - Key([mod], "n", - lazy.layout.normalize(), - desc='normalize window size ratios' - ), - Key([mod], "m", - lazy.layout.maximize(), - desc='toggle window between minimum and maximum sizes' - ), - Key([mod, "shift"], "f", - lazy.window.toggle_floating(), - desc='toggle floating' - ), - Key([mod], "f", - lazy.window.toggle_fullscreen(), - desc='toggle fullscreen' - ), - ### Stack controls - Key([mod, "shift"], "Tab", - lazy.layout.rotate(), - lazy.layout.flip(), - desc='Switch which side main pane occupies (XmonadTall)' - ), - Key([mod, "shift"], "space", - lazy.layout.toggle_split(), - desc='Toggle between split and unsplit sides of stack' - ), - ### Volume controls - Key([], "XF86AudioLowerVolume", - lazy.spawn('amixer sset Master 5%-'), - desc="Decrease volume" - ), - Key([], "XF86AudioRaiseVolume", - lazy.spawn('amixer sset Master 5%+'), - desc="Increase volume" - ), - ### Spotify - Key([mod, "shift"], "p", - lazy.spawn("spotify-control play-pause"), - desc="play/pause music" - ), - Key([mod, "shift"], "n", - lazy.spawn("spotify-control next"), - desc="next song" - ), - Key([mod, "shift"], "b", - lazy.spawn("spotify-control previous"), - desc="previous song" - ), - ### Change languages - Key([mod], "F1", - lazy.spawn("setxkbmap us -option caps:swapescape"), - desc= "change to US layout" - ), - Key([mod],"F2", - lazy.spawn("setxkbmap gr"), - desc= "change to greek layout" - ), - - ] - - -def window_to_previous_screen(qtile, switch_group=False, switch_screen=False): - i = qtile.screens.index(qtile.current_screen) - if i != 0: - group = qtile.screens[i - 1].group.name - qtile.current_window.togroup(group, switch_group=switch_group) - if switch_screen == True: - qtile.cmd_to_screen(i - 1) - -def window_to_next_screen(qtile, switch_group=False, switch_screen=False): - 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, switch_group=switch_group) - if switch_screen == True: - qtile.cmd_to_screen(i + 1) - +my_keys = MyKeys() +keys = my_keys.init_keys() +dgroups_key_binder = simple_key_binder("mod4") groups = [] - group_names = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0",] - -#group_labels = ["1 ", "2 ", "3 ", "4 ", "5 ", "6 ", "7 ", "8 ", "9 ", "0",] group_labels = ["Ⅰ", "Ⅱ", "Ⅲ", "Ⅳ", "Ⅴ", "Ⅵ", "Ⅶ", "Ⅷ", "Ⅸ", "Ⅹ",] - group_layouts = ["monadtall", "monadtall", "monadtall", "monadtall", "monadtall", "monadtall", "monadtall", "monadtall", "monadtall", "monadtall",] -#group_layouts = ["monadtall", "matrix", "monadtall", "bsp", "monadtall", "matrix", "monadtall", "bsp", "monadtall", "monadtall",] for i in range(len(group_names)): groups.append( @@ -249,20 +74,6 @@ for i in range(len(group_names)): label=group_labels[i], )) -for i in groups: - keys.extend([ - -#CHANGE WORKSPACES - Key([mod], i.name, lazy.group[i.name].toscreen()), - -# MOVE WINDOW TO SELECTED WORKSPACE 1-10 AND STAY ON WORKSPACE - Key([mod, "shift"], i.name, lazy.window.togroup(i.name)), - -# MOVE WINDOW TO SELECTED WORKSPACE 1-10 AND FOLLOW MOVED WINDOW TO WORKSPACE -# Key([mod, "shift"], i.name, lazy.window.togroup(i.name) , lazy.group[i.name].toscreen()), - ]) - - def init_layout_theme(): return {"margin":5, "border_width":2, @@ -284,9 +95,6 @@ layouts = [ # layout.RatioTile(**layout_theme), layout.Max(**layout_theme) ] - -# COLORS FOR THE BAR - def init_colors(): return [ ["#2F343F", "#2F343F"], # color 0 |