Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniDiazTech committed Nov 23, 2020
1 parent 817e206 commit 9343e96
Show file tree
Hide file tree
Showing 26 changed files with 704 additions and 0 deletions.
Empty file added .idea/.gitignore
Empty file.
6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/qtile.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
MIT License

Copyright (c) 2020 Daniel Diaz

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
Binary file added __pycache__/config.cpython-38.pyc
Binary file not shown.
Binary file added __pycache__/functions.cpython-38.pyc
Binary file not shown.
Binary file added __pycache__/groups.cpython-38.pyc
Binary file not shown.
Binary file added __pycache__/keybindings.cpython-38.pyc
Binary file not shown.
Binary file added __pycache__/layouts.cpython-38.pyc
Binary file not shown.
Binary file added __pycache__/widgets.cpython-38.pyc
Binary file not shown.
4 changes: 4 additions & 0 deletions autostart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#! /bin/bash
picom &
nitrogen --restore &
megasync &
131 changes: 131 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
###############################################
### QTILE CONFIGURATION FILE OF DANIEL DIAZ ###
#
# ____ ____
# | _ \ | _ \ Copyright (c) 2020 Daniel Diaz
# | | | || | | |
# | |_| || |_| | http://www.github.com/Daniel1404/
# |____/ |____/
#

# 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.

####### IMPORTS #########
import os
import subprocess


# from typing import List # noqa: F401

from libqtile import hook, layout
from libqtile.config import Group

# Local Files
from keybindings import Keybindings, Mouse
from widgets import MyWidgets
from layouts import Layouts
from groups import CreateGroups

group_icons = ["B  ",
"D  ",
"T  ",
"V  ",
"M  ",
"C  ",
"E  "]


###### MAIN ######
if __name__ in ["config", "__main__"]:
# Initializes objects
obj_keys = Keybindings()
obj_mouse = Mouse()
obj_widgets = MyWidgets()
obj_layouts = Layouts()
obj_groups = CreateGroups()
# Initializes qtile variables
keys = obj_keys.init_keys()
mouse = obj_mouse.init_mouse()
layouts = obj_layouts.init_layouts()
groups = obj_groups.init_groups()

# Append group keys for groups
keys += obj_keys.init_keys_groups(group_icons)

### DISPLAYS WIDGETS IN THE SCREEN ####

screens = obj_widgets.init_screen()
main_widgets_list = obj_widgets.init_widgets_list()
widgets_screen1 = obj_widgets.init_widgets_screen()


dgroups_key_binder = None
dgrups_app_rules = []
main = None # WARNING: this is deprecated and will be removed soon
follow_mouse_focus = True
bring_front_click = False
cursor_warp = False
floating_layout = layout.Floating(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
])
auto_fullscreen = True
focus_on_window_activation = "smart"


@hook.subscribe.startup_once
def start_once():
home = os.path.expanduser('~')
subprocess.call([home + '/.config/qtile/autostart.sh'])

@hook.subscribe.client_new
def dialogs(window):
if(window.window.get_wm_type() == 'dialog' or window.window.get_wm_transient_for()):
window.floating = True

# XXX: Gasp! We're lying here. In fact, nobody really uses or cares about this
# string besides java UI toolkits; you can see several discussions on the
# mailing lists, GitHub issues, and other WM documentation that suggest setting
# this string if your java app doesn't work correctly. We may as well just lie
# and say that we're a working one by default.
#
# We choose LG3D to maximize irony: it is a 3D non-reparenting WM written in,
# java that happens to be on java's whitelist.
wmname = "LG3D"
50 changes: 50 additions & 0 deletions functions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
from libqtile.command import lazy

class Functions(object):

##### MOVE WINDOW IN GROUPS #####
@staticmethod
def window_to_prev_group():
@lazy.function
def __inner(qtile):
i = qtile.groups.index(qtile.current_group)

if qtile.current_window and i != 0:
group = qtile.groups[i - 1].name
qtile.current_window.togroup(group, switch_group=True)
return __inner

@staticmethod
def window_to_next_group():
@lazy.function
def __inner(qtile):
i = qtile.groups.index(qtile.current_group)

if qtile.current_window and i != len(qtile.groups):
group = qtile.groups[i + 1].name
qtile.current_window.togroup(group, switch_group=True)
return __inner


##### KILL ALL WINDOWS #####

@staticmethod
def kill_all_windows():
@lazy.function
def __inner(qtile):
for window in qtile.current_group.windows:
window.kill()
return __inner

@staticmethod
def kill_all_windows_minus_current():
@lazy.function
def __inner(qtile):
for window in qtile.current_group.windows:
if window != qtile.current_window:
window.kill()
return __inner


if __name__ == "__main__":
pass
23 changes: 23 additions & 0 deletions groups.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from libqtile.config import Group


class CreateGroups:
def __init__(self):
self.group_names = ["B  ",
"D  ",
"T  ",
"V  ",
"M  ",
"C  ",
"E  "]

def init_groups(self):
"""
Return the groups of Qtile
"""
#### First and last
groups = [Group(name, layout="max") if name == self.group_names[0]
else Group(name, layout="floating")
if name == self.group_names[-1] else Group(name, layout="monadtall")
for name in self.group_names]
return groups
Binary file added icons/layout-floating.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/layout-max.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/layout-monadtall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/layout-tile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/layout-treetab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/python.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 9343e96

Please sign in to comment.