diff --git a/qtile/.config/qtile/bars.py b/qtile/.config/qtile/bars.py deleted file mode 100644 index 8175114..0000000 --- a/qtile/.config/qtile/bars.py +++ /dev/null @@ -1,79 +0,0 @@ -# coding = utf-8 -from libqtile import bar, widget -from libqtile.config import Click - -import defines - -#region custom_widgets -import psutil -class MemoryC(widget.base.ThreadedPollText): - orientations = widget.base.ORIENTATION_HORIZONTAL - defaults = [ - ("format", "{MemUsed}GB/{MemTotal}GB", "Formatting for field names."), - ("update_interval", 1.0, "Update interval for the Memory"), - ] - - def __init__(self, **config): - super().__init__(**config) - self.add_defaults(MemoryC.defaults) - - def tick(self): - self.update(self.poll()) - return self.update_interval - - def poll(self): - mem = psutil.virtual_memory() - swap = psutil.swap_memory() - val = {} - val["MemUsed"] = mem.used // 1024 // 1024 // 102.4 / 10 - val["MemTotal"] = mem.total // 1024 // 1024 // 102.4 / 10 - val["MemPercent"] = mem.percent - val["MemFree"] = mem.free // 1024 // 1024 // 102.4 / 10 - val["Buffers"] = mem.buffers // 1024 // 1024 // 102.4 / 10 - val["Active"] = mem.active // 1024 // 1024 // 102.4 / 10 - val["Inactive"] = mem.inactive // 1024 // 1024 // 102.4 / 10 - val["Shmem"] = mem.shared // 1024 // 1024 // 102.4 / 10 - val["SwapTotal"] = swap.total // 1024 // 1024 // 102.4 / 10 - val["Swapfree"] = swap.free // 1024 // 1024 // 102.4 / 10 - val["SwapUsed"] = swap.used // 1024 // 1024 // 102.4 / 10 - val["SwapPercent"] = swap.percent - return self.format.format(**val) -#endregion - -widget_defaults = dict( - font='sans', - fontsize=14, - padding=3, -) -extension_defaults = widget_defaults.copy() - - -main_bar = bar.Bar([ - widget.CurrentLayoutIcon(), - widget.GroupBox(), - widget.Prompt(), - widget.WindowName(), - widget.Systray(), - widget.TextBox("Vol:"), - widget.Volume(), - widget.CheckUpdates(), - widget.CPU(format='CPU: {load_percent}% @ {freq_current}GHz'), - MemoryC(format="RAM: {MemUsed}GB ({MemPercent}%)"), - MemoryC(format="Swap: {SwapUsed}GB ({SwapPercent}%)"), - widget.NetGraph(), - widget.Clock(format='%Y-%m-%d %H:%M'), -],24) - -left_bar = bar.Bar([ - widget.CurrentLayoutIcon(), - widget.GroupBox(), - widget.WindowName(), - widget.Clock(format='%Y-%m-%d %H:%M'), -],24) - -top_bar = bar.Bar([ - widget.CurrentLayoutIcon(), - widget.GroupBox(), - widget.WindowName(), - widget.Clock(format='%Y-%m-%d %H:%M'), -],24) \ No newline at end of file diff --git a/qtile/.config/qtile/config.py b/qtile/.config/qtile/config.py index 9606cd5..75f6e5e 100644 --- a/qtile/.config/qtile/config.py +++ b/qtile/.config/qtile/config.py @@ -1,46 +1,224 @@ -#region Copyright Notice +import os +import subprocess +import psutil -# Copyright (c) 2010 Aldo Cortesi -# Copyright (c) 2010, 2014 dequis -# Copyright (c) 2012 Randall Ma -# Copyright (c) 2012-2014 Tycho Andersen -# Copyright (c) 2012 Craig Barnes -# Copyright (c) 2013 horsik -# Copyright (c) 2013 Tao Sauvage -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. +from libqtile import layout, bar, widget +from libqtile.config import Key, Drag, Click, Group, Screen +from libqtile.command import lazy +#region defines +term = 'termite' +focus_color = '#bd93f9' +border_width = 2 +mod = 'mod4' + +#region colors +foreground_color = ['#f8f8f2','#f8f8f2'] +background_color0 = ['#000000','#000000'] +background_color8 = ['#4d4d4d','#4d4d4d'] +# red +red_color1 = ['#ff5555','#ff5555'] +red_color9 = ['#ff6e67','#ff6e67'] +# green +green_color2 = ['#50fa7b','#50fa7b'] +green_color10 = ['#5af78e','#5af78e'] +# yellow +yellow_color3 = ['#f1fa8c','#f1fa8c'] +yellow_color11 = ['#f4f99d','#f4f99d'] + +# blue +blue_color4 = ['#bd93f9','#bd93f9'] +blue_color12 = ['#caa9fa','#caa9fa'] + +# magenta +magenta_color5 = ['#ff79c6','#ff79c6'] +magenta_color13 = ['#ff92d0','#ff92d0'] + +# cyan +cyan_color6 = ['#8be9fd','#8be9fd'] +cyan_color14 = ['#9aedfe','#9aedfe'] + +# white +white_color7 = ['#bfbfbf','#bfbfbf'] +white_color15 = ['#e6e6e6','#e6e6e6'] +#endregion #endregion -import os +#region Keys +keys = [ + #moving focus aroung + Key([mod], "h", lazy.layout.left()), + Key([mod], "l", lazy.layout.right()), + Key([mod], "j", lazy.layout.down()), + Key([mod], "k", lazy.layout.up()), + Key([mod,"mod1"], "k", lazy.to_screen(0)), + Key([mod,"mod1"], "j", lazy.to_screen(1)), + Key([mod,"mod1"], "l", lazy.to_screen(1)), + Key([mod,"mod1"], "h", lazy.to_screen(2)), -#import custom files -from keys import keys, mouse -from screens import screens -from layouts import layouts + # moving windows around + Key([mod, "shift"], "h", lazy.layout.swap_left()), + Key([mod, "shift"], "l", lazy.layout.swap_right()), + Key([mod, "shift"], "j", lazy.layout.shuffle_down()), + Key([mod, "shift"], "k", lazy.layout.shuffle_up()), + + # resize windows + Key([mod], "plus", lazy.layout.grow()), + Key([mod], "minus", lazy.layout.shrink()), + Key([mod], "n", lazy.layout.normalize()), + Key([mod], "o", lazy.layout.maximize()), + Key([mod], "space", lazy.window.toggle_fullscreen()), + + # app hotkeys + Key([mod], "Return", lazy.spawn(term), desc="Launch terminal"), + Key([mod],"f", lazy.spawn("firefox"),desc="Launch firefox"), + Key([mod],"e", lazy.spawn("pcmanfm"),desc="Launch pcmanfm"), + Key([mod],"c", lazy.spawn("code"),desc="Launch visual studio code"), + + # Toggle between different layouts as defined below + Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"), + Key([mod], "BackSpace", lazy.window.kill(), desc="Kill focused window"), + + # qtile hotkeys + Key([mod, "control"], "r", lazy.restart(), desc="Restart qtile"), + Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown qtile"), + Key([mod], "r", lazy.spawncmd(),desc="Spawn a command using a prompt widget"), + + # Media hotkeys + Key([], 'XF86AudioRaiseVolume', lazy.spawn('pulseaudio-ctl up 1')), + Key([], 'XF86AudioLowerVolume', lazy.spawn('pulseaudio-ctl down 1')), + Key([], 'XF86AudioMute', lazy.spawn('pulseaudio-ctl mute')), +] + + +# Drag floating layouts. +mouse = [ + Drag([mod], "Button1", lazy.window.set_position_floating(), + start=lazy.window.get_position()), + Drag([mod], "Button3", lazy.window.set_size_floating(), + start=lazy.window.get_size()), + Click([mod], "Button2", lazy.window.bring_to_front()) +] +#endregion + +#region Groups +group_names = [("WWW", {'layout': 'monadtall'}), + ("DEV", {'layout': 'monadtall'}), + ("SYS", {'layout': 'monadtall'}), + ("DOC", {'layout': 'monadtall'}), + ("VBOX", {'layout': 'monadtall'}), + ("CHAT", {'layout': 'monadtall'}), + ("MUS", {'layout': 'monadtall'}), + ("VID", {'layout': 'monadtall'}), + ("GFX", {'layout': 'floating'})] + +groups = [Group(name, **kwargs) for name, kwargs in group_names] + +for i, (name, kwargs) in enumerate(group_names, 1): + keys.extend([ + Key(["mod1","control"], str(i), lazy.group[name].toscreen(), + desc="Switch to group {}".format(name)), + + Key(['mod1','control', "shift"], str(i), lazy.window.togroup(name), + desc="move focused window to group {}".format(name)), + ]) +#endregion + +#region Layouts +layouts = [ + layout.MonadTall( + align=1, + border_focus = focus_color, + border_width = border_width, + new_at_current = True, + ), + layout.Floating( + border_focus = focus_color, + border_width = border_width, + ), + layout.Max(), + layout.MonadWide( + border_focus = focus_color, + border_width = border_width, + new_at_current = True, + ), +] + +floating_layout = layout.Floating( + border_focus = focus_color, + border_width = border_width, + float_rules=[ + # Run the utility of `xprop` to see the wm class and name of an X client. + {'wmclass': 'confirm'}, + {'wmclass': 'dialog'}, + {'wmclass': 'download'}, + {'wmclass': 'error'}, + {'wmclass': 'file_progress'}, + {'wmclass': 'notification'}, + {'wmclass': 'splash'}, + {'wmclass': 'toolbar'}, + {'wmclass': 'confirmreset'}, # gitk + {'wmclass': 'makebranch'}, # gitk + {'wmclass': 'maketag'}, # gitk + {'wname': 'branchdialog'}, # gitk + {'wname': 'pinentry'}, # GPG key password entry + {'wmclass': 'ssh-askpass'}, # ssh-askpass +]) +#endregion + +#region Bars and Widgets +widget_defaults = dict( + font='Ubuntu Mono', + fontsize=14, + padding=3, +) +extension_defaults = widget_defaults.copy() + +main_bar = bar.Bar([ + widget.CurrentLayoutIcon(), + widget.GroupBox(), + widget.Prompt(), + widget.WindowName(), + widget.Systray(), + widget.TextBox("Vol:"), + widget.Volume(), + widget.CheckUpdates(), + widget.CPU(format='CPU: {load_percent}% @ {freq_current}GHz'), +# MemoryC(format="RAM: {MemUsed}GB ({MemPercent}%)"), +# MemoryC(format="Swap: {SwapUsed}GB ({SwapPercent}%)"), + widget.NetGraph(), + widget.Clock(format='%Y-%m-%d %H:%M'), +],24) + +left_bar = bar.Bar([ + widget.CurrentLayoutIcon(), + widget.GroupBox(), + widget.WindowName(), + widget.Clock(format='%Y-%m-%d %H:%M'), +],24) + +top_bar = bar.Bar([ + widget.CurrentLayoutIcon(), + widget.GroupBox(), + widget.WindowName(), + widget.Clock(format='%Y-%m-%d %H:%M'), +],24) +#endregion + +#region Screens +screens = [ + Screen(bottom=top_bar), + Screen(top=main_bar), + Screen(top=left_bar), +] +#endregion #region miscelanious dgroups_key_binder = None dgroups_app_rules = [] # type: List main = None # WARNING: this is deprecated and will be removed soon follow_mouse_focus = True -bring_front_click = False +bring_front_click = True cursor_warp = False auto_fullscreen = True focus_on_window_activation = "smart" diff --git a/qtile/.config/qtile/defines.py b/qtile/.config/qtile/defines.py deleted file mode 100644 index a23512c..0000000 --- a/qtile/.config/qtile/defines.py +++ /dev/null @@ -1,33 +0,0 @@ -term = 'termite' -focus_color = '#bd93f9' -border_width = 2 -mod = 'mod4' - -foreground_color = ['#f8f8f2','#f8f8f2'] -background_color0 = ['#000000','#000000'] -background_color8 = ['#4d4d4d','#4d4d4d'] -# red -red_color1 = ['#ff5555','#ff5555'] -red_color9 = ['#ff6e67','#ff6e67'] -# green -green_color2 = ['#50fa7b','#50fa7b'] -green_color10 = ['#5af78e','#5af78e'] -# yellow -yellow_color3 = ['#f1fa8c','#f1fa8c'] -yellow_color11 = ['#f4f99d','#f4f99d'] - -# blue -blue_color4 = ['#bd93f9','#bd93f9'] -blue_color12 = ['#caa9fa','#caa9fa'] - -# magenta -magenta_color5 = ['#ff79c6','#ff79c6'] -magenta_color13 = ['#ff92d0','#ff92d0'] - -# cyan -cyan_color6 = ['#8be9fd','#8be9fd'] -cyan_color14 = ['#9aedfe','#9aedfe'] - -# white -white_color7 = ['#bfbfbf','#bfbfbf'] -white_color15 = ['#e6e6e6','#e6e6e6'] \ No newline at end of file diff --git a/qtile/.config/qtile/groups.py b/qtile/.config/qtile/groups.py deleted file mode 100644 index 5c8da8a..0000000 --- a/qtile/.config/qtile/groups.py +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python - -from libqtile.config import Group#, ScratchPad, DropDown - -from defines import term - -groups = [Group(i) for i in "asdfuiop"] -#groups = [ -# Group("code", spawn="code", layout="monadtall", persist=True), -# Group("chat", spawn=["firefox https://web.whatsapp.com/","discord"],layout="monadwide",persist=True), -# Group("spot", spawn="spotify",layout="max", persist=True), -# ScratchPad("scratch",[DropDown('term',term)]) -#] diff --git a/qtile/.config/qtile/keys.py b/qtile/.config/qtile/keys.py deleted file mode 100644 index 250e00f..0000000 --- a/qtile/.config/qtile/keys.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env python -# coding = utf-8 - -import os -import subprocess - -from libqtile.config import Key, Drag, Click -from libqtile.command import lazy - -from groups import groups -from defines import mod, term - -keys = [ - #moving focus aroung - Key([mod], "h", lazy.layout.left()), - Key([mod], "l", lazy.layout.right()), - Key([mod], "j", lazy.layout.down()), - Key([mod], "k", lazy.layout.up()), - Key([mod,"mod1"], "k", lazy.to_screen(0)), - Key([mod,"mod1"], "j", lazy.to_screen(1)), - Key([mod,"mod1"], "l", lazy.to_screen(1)), - Key([mod,"mod1"], "h", lazy.to_screen(2)), - - # moving windows around - Key([mod, "shift"], "h", lazy.layout.swap_left()), - Key([mod, "shift"], "l", lazy.layout.swap_right()), - Key([mod, "shift"], "j", lazy.layout.shuffle_down()), - Key([mod, "shift"], "k", lazy.layout.shuffle_up()), - - # resize windows - Key([mod], "plus", lazy.layout.grow()), - Key([mod], "minus", lazy.layout.shrink()), - Key([mod], "n", lazy.layout.normalize()), - Key([mod], "o", lazy.layout.maximize()), - Key([mod], "space", lazy.window.toggle_fullscreen()), - - # app hotkeys - Key([mod], "Return", lazy.spawn(term), desc="Launch terminal"), - Key([mod],"f", lazy.spawn("firefox"),desc="Launch firefox"), - Key([mod],"e", lazy.spawn("pcmanfm"),desc="Launch pcmanfm"), - Key([mod],"c", lazy.spawn("code"),desc="Launch visual studio code"), - - # Toggle between different layouts as defined below - Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"), - Key([mod], "BackSpace", lazy.window.kill(), desc="Kill focused window"), - - # qtile hotkeys - Key([mod, "control"], "r", lazy.restart(), desc="Restart qtile"), - Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown qtile"), - Key([mod], "r", lazy.spawncmd(),desc="Spawn a command using a prompt widget"), - - # Media hotkeys - Key([], 'XF86AudioRaiseVolume', lazy.spawn('pulseaudio-ctl up 1')), - Key([], 'XF86AudioLowerVolume', lazy.spawn('pulseaudio-ctl down 1')), - Key([], 'XF86AudioMute', lazy.spawn('pulseaudio-ctl mute')), -] - - -# Drag floating layouts. -mouse = [ - Drag([mod], "Button1", lazy.window.set_position_floating(), - start=lazy.window.get_position()), - Drag([mod], "Button3", lazy.window.set_size_floating(), - start=lazy.window.get_size()), - Click([mod], "Button2", lazy.window.bring_to_front()) -] - -for i in groups: - keys.extend([ - Key(["mod1","control"], i.name, lazy.group[i.name].toscreen(), - desc="Switch to group {}".format(i.name)), - - #Key(["mod1","control", "shift"], i.name, lazy.window.togroup(i.name, switch_group=True), - # desc="Switch to & move focused window to group {}".format(i.name)), - # Or, use below if you prefer not to switch to that group. - Key(['mod1','control', "shift"], i.name, lazy.window.togroup(i.name), - desc="move focused window to group {}".format(i.name)), - ]) \ No newline at end of file diff --git a/qtile/.config/qtile/layouts.py b/qtile/.config/qtile/layouts.py deleted file mode 100644 index f401c53..0000000 --- a/qtile/.config/qtile/layouts.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python - -from libqtile import layout - -from defines import focus_color,border_width - -layouts = [ - layout.MonadTall( - align=1, - border_focus = focus_color, - border_width = border_width, - new_at_current = True, - ), - layout.Floating( - border_focus = focus_color, - border_width = border_width, - ), - layout.Max(), - layout.MonadWide( - border_focus = focus_color, - border_width = border_width, - new_at_current = True, - ), -] - -floating_layout = layout.Floating( - border_focus = focus_color, - border_width = border_width, - float_rules=[ - # Run the utility of `xprop` to see the wm class and name of an X client. - {'wmclass': 'confirm'}, - {'wmclass': 'dialog'}, - {'wmclass': 'download'}, - {'wmclass': 'error'}, - {'wmclass': 'file_progress'}, - {'wmclass': 'notification'}, - {'wmclass': 'splash'}, - {'wmclass': 'toolbar'}, - {'wmclass': 'confirmreset'}, # gitk - {'wmclass': 'makebranch'}, # gitk - {'wmclass': 'maketag'}, # gitk - {'wname': 'branchdialog'}, # gitk - {'wname': 'pinentry'}, # GPG key password entry - {'wmclass': 'ssh-askpass'}, # ssh-askpass -]) \ No newline at end of file diff --git a/qtile/.config/qtile/screens.py b/qtile/.config/qtile/screens.py deleted file mode 100644 index 09f3f88..0000000 --- a/qtile/.config/qtile/screens.py +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env python -# coding = utf-8 - -from libqtile.config import Screen - -from bars import main_bar, left_bar, top_bar - -screens = [ - Screen(bottom=top_bar), - Screen(top=main_bar), - Screen(top=left_bar), -] \ No newline at end of file