def TERMINAL(command=None, name=None, _class=None): term = os.getenv("TERMINAL") if not term: term = guess_terminal() if _check_dependency(term): if name: term = term + ' -T %s'%name if _class: term = term + ' -c %s'%_class if command: term = term + ' -e %s'%command return term
def init_scratchpad(self): terminal = guess_terminal() # Configuration height = 0.5 y_position = 0.2 warp_pointer = False on_focus_lost_hide = True opacity = 0.8 return [ ScratchPad( "SPD", dropdowns=[ # Drop down terminal with tmux session DropDown("term", terminal + " -e tmux new-session -A -s 'dd'", opacity=opacity, y=y_position, height=height, on_focus_lost_hide=on_focus_lost_hide, warp_pointer=warp_pointer), # Another terminal exclusively for music player DropDown("music", terminal + " -e ncmpcpp", opacity=opacity, y=y_position, height=height, on_focus_lost_hide=on_focus_lost_hide, warp_pointer=warp_pointer), # Another terminal exclusively for file manager DropDown("fileman", terminal + " -e ranger", opacity=opacity, y=y_position, height=height, on_focus_lost_hide=on_focus_lost_hide, warp_pointer=warp_pointer) # Another terminal exclusively for qshell # DropDown("qshell", # terminal + " -e qshell", # opacity = opacity, # y = y_position, # height = height, # on_focus_lost_hide = on_focus_lost_hide, # warp_pointer = warp_pointer) ]), ]
from libqtile.lazy import lazy from libqtile.utils import guess_terminal from libqtile import hook import os import subprocess # At this time I'm loading everything in xinitrc. May enable this once I # determine what applications are best to start with xinit and which are best to # here #@hook.subscribe.startup_once #def autostart(): # home = os.path.expanduser('~/.config/qtile/autostart.sh') # subprocess.call([home]) mod = "mod1" terminal = guess_terminal() keys = [ # Switch between windows in current stack pane Key([mod], "k", lazy.layout.down(), desc="Move focus down in stack pane"), Key([mod], "j", lazy.layout.up(), desc="Move focus up in stack pane"), # Screen Swap Key([mod], "period", lazy.to_screen(0)), Key([mod], "comma", lazy.to_screen(1)), # RESIZE UP, DOWN, LEFT, RIGHT Key( [mod, "control"], "l", lazy.layout.grow_right(), lazy.layout.grow(),
from libqtile.utils import guess_terminal # default mod key, mod4 = win key mod = "mod4" # default terminal terminal = guess_terminal(preference="alacritty")
from libqtile.utils import guess_terminal MOD = "mod4" TERM = guess_terminal()
def init_keys(self): terminal = guess_terminal() # Key alias mod = "mod4" modalt = "mod1" altgr = "mod5" return [ # On root Key([mod, "shift"], "r", lazy.restart()), # Restart Qtile Key([mod, "shift"], "q", lazy.shutdown()), # Shutdown Qtile # Key([modalt], "r", lazy.spawncmd()), # Launch Qtile prompt # On window # Key([mod], "Home", # lazy.window.bring_to_front()), # Bring window to front # Key([mod], "End", # lazy.group[""].toscreen()), # Go to minimized windows gruop # Key([mod, "shift"], "End", # lazy.window.togroup("")), # Move to minimized windows group # Key([mod, "control"], "End", # lazy.window.togroup(""), # lazy.group[""].toscreen()), # Move with to minimized windows group # Key([mod, alt], "End", # lazy.window.toggle_minimize()), # Toogle minimize Key([mod], "h", lazy.layout.left()), # Switch to window on left Key([mod], "l", lazy.layout.right()), # Switch to window on right Key([mod], "j", lazy.layout.down()), # Switch to window below Key([mod], "k", lazy.layout.up()), # Switch to window above Key([mod, "shift"], "j", lazy.layout.shuffle_down() ), # Move windows down in current stack Key([mod, "shift"], "k", lazy.layout.shuffle_up()), # Move windows up in current stack Key([mod, "shift"], "h", lazy.layout.swap_left()), # Move window to the left Key([mod, "shift"], "l", lazy.layout.swap_right()), # Move window to the right # Key([mod, "control"], "j", # lazy.layout.client_to_previous()), # Move window to previous stack side # Key([mod, "control"], "k", # lazy.layout.client_to_next()), # Move window to next stack side # Key([mod], "Tab", # lazy.group.next_window()), # Switch focus to other window # Key([mod, "shift"], "Tab", # lazy.group.prev_window()), # Switch focus to other window # Key([mod, altgr], "Tab", # lazy.group.next_window(), # lazy.window.bring_to_front()), # Switch focus to other window + front # Key([mod, altgr, "shift"], "Tab", # lazy.group.prev_window(), # lazy.window.bring_to_front()), # Switch focus to other window + front Key([mod], "q", lazy.window.kill()), # Kill active window # Key([mod, alt], "w", # lazy.spawn("xkill")), # Terminate program # Key([mod, "shift"], "w", # Function.kill_all_windows_minus_current()), # Kill all windows except current # Key([mod, "control"], "w", # Function.kill_all_windows()), # Kill all windows Key([mod], "f", lazy.window.toggle_floating()), # Toggle floating Key([mod, "shift"], "f", lazy.window.toggle_fullscreen()), # Toggle fullscreen # On layout Key([mod], "m", lazy.layout.swap_main() ), # Swap current window to main pane (Xmonad) # Key([mod], "m", # lazy.layout.next()), # Move focus to another stack (Stack) Key([mod, "control", "shift"], "h", lazy.layout.shrink()), # Shrink size of window (Xmonad) Key([mod, "control", "shift"], "l", lazy.layout.grow()), # Grow size of window (Xmonad) Key([mod], "n", lazy.layout.normalize() ), # Restore all windows to default size ratios Key([mod], "m", lazy.layout.maximize() ), # Toggle a window between min and max sizes # Key([mod, "shift"], "space", # lazy.layout.rotate(), # Swap panes of split stack (Stack) # lazy.layout.flip()), # Switch side main pane occupies (Xmonad) # Key([mod, "shift"], "Return", # lazy.layout.toggle_split()), # Toggle between split and unsplit (Stack) Key([mod], "Tab", lazy.prev_layout()), # Toggle through layouts Key([mod, "shift"], "Tab", lazy.next_layout()), # Toggle through layouts # On group # Key([mod], "z", # lazy.screen.togglegroup()), # Move to previous visited group # Key([mod, "shift"], "i", # lazy.next_urgent()), # Move to next urgent group # Key([mod], "Left", # lazy.screen.prev_group()), # Move to previous group # Key([mod], "Right", # lazy.screen.next_group()), # Move to next group # Key([mod, "shift"], "Left", # Function.window_to_prev_group()), # Move window to previous group # Key([mod, "shift"], "Right", # Function.window_to_next_group()), # Move window to next group # Key([mod, "control"], "Left", # Function.window_to_prev_group(), # lazy.screen.prev_group()), # Move with window to previous group # Key([mod, "control"], "Right", # Function.window_to_next_group(), # lazy.screen.next_group()), # Move with window to next group # On screen # Key([modalt], "1", # lazy.to_screen(0)), # Switch to screen 0 # Key([modalt], "2", # lazy.to_screen(2)), # Switch to screen 2 # Key([modalt], "3", # lazy.to_screen(1)), # Switch to screen 1 # Key([modalt], "h", # lazy.to_screen(0)), # Switch to screen 0 # Key([modalt], "k", # lazy.to_screen(0)), # Switch to screen 0 # Key([modalt], "j", # lazy.to_screen(1)), # Switch to screen 1 # Key([modalt], "l", # lazy.to_screen(2)), # Switch to screen 2 # Hardware keys Key([], "XF86AudioRaiseVolume", lazy.spawn("amixer -D pulse sset Master 5%+")), # Volume up Key([], "XF86AudioLowerVolume", lazy.spawn("amixer -D pulse sset Master 5%-")), # Volume down Key([], "XF86AudioMute", lazy.spawn("amixer -c 0 -q set Master toggle")), # Volume mute Key( [], "XF86MonBrightnessUp", # Brightness up lazy.spawn("brightnessctl set 5%+")), Key( [], "XF86MonBrightnessDown", # Brightness down lazy.spawn("brightnessctl set 5%-")), # Launchers Key([mod], "Return", lazy.spawn(terminal)), Key([mod, "shift"], "Return", lazy.spawn(terminal + " -e tmux new-session -A -s 'Default'")), Key([ mod, ], "r", lazy.spawn(terminal + " -e ranger")), Key([mod], "e", lazy.spawn("emacs")), Key([mod], "space", lazy.spawn(expanduser("~/.config/rofi/scripts/launcher"))), Key([mod], "0", lazy.spawn(expanduser("~/.config/rofi/scripts/powermenu"))), Key([mod, "shift"], "w", lazy.spawn(expanduser("~/.config/rofi/scripts/windows"))), Key([mod, "shift"], "0", lazy.spawn(expanduser("~/.config/rofi/scripts/calc"))), Key([mod, "shift"], "n", lazy.spawn( expanduser( "~/.config/rofi/scripts/networkmanager-dmenu"))), Key([mod, "shift"], "c", lazy.spawn(expanduser("~/.config/rofi/scripts/clipmenu"))), Key([mod, "shift"], "b", lazy.spawn(expanduser("~/.config/rofi/scripts/bwmenu"))), Key([mod, "shift"], "space", lazy.spawn(expanduser("~/.config/rofi/scripts/filebrowser"))), Key([modalt, "shift"], "s", lazy.spawn("gnome-screenshot --interactive")), ]
# # Use o pywal para pegar a paleta de cores do seu wallpaper: # # wal -i ~/.Wallpapers/seu-papel-de-parede.jpg # ################################################################################################################ ################################################################################## # CONFIGURAÇÃO DOS ATALHOS PARA ABRIR APLICATIVOS E COMPORTAMENTO DAS JANELAS # ################################################################################## mod = 'mod4' ctrl = 'control' alt = 'mod1' shift = 'shift' terminal = guess_terminal() # default qtile keys = [ # MOVIMENTO DAS TELAS Key([alt], 'h', lazy.spawn('qtile-cmd -o cmd -f next_screen')), Key([alt], 'l', lazy.spawn('qtile-cmd -o cmd -f previous_screen')), # FOCUS DA JANELA Key([mod], 'j', lazy.layout.down(), desc='Foco na janela de baixo'), Key([mod], 'k', lazy.layout.up(), desc='Foco na janela de cima'), Key([mod], 'h', lazy.layout.left(), desc='Foco na janela da esquerda'), Key([mod], 'l', lazy.layout.right(), desc='Foco na janela da direita'), Key([mod], "space", lazy.layout.next(), desc='Foco na próxima janela'), # MOVIMENTO DA JANELA FOCADA
from libqtile import layout from libqtile.config import Match from libqtile.utils import guess_terminal # Set SCREEN: str = 'extend' # extend, mirror DYNAMIC_COLORS: bool = True if DYNAMIC_COLORS: ROFI_THEME = 'qtile-dynamic-solid' THEME = 'Green' else: ROFI_THEME = 'qtile-dynamic-solid' THEME = 'Pink' # Red Pink Purple Voilet Indigo Blue Pink # Applications TERMINAL = guess_terminal() BROWSER = "brave" BROWSER_2 = "chromium" FILE_MANAGER = "dolphin" FILE_MANAGER_2 = "nautilus" EDITOR_GUI = "code" MODKEY = "mod4" # Enviroment HOME = os.environ["HOME"] CONFIG = os.path.join(HOME, ".config") SCRIPTS = os.path.join(CONFIG, "shell-files") # Config bar_config = { "size": 25,
def test_guess_terminal_falls_back_to_defaults(path): Path(path, 'kitty').touch(mode=0o777) assert utils.guess_terminal(['nutty', 'witty', 'petty']) == 'kitty'
def test_guess_terminal_accepts_a_list_of_preferences(path): term = 'shitty' Path(path, term).touch(mode=0o777) assert utils.guess_terminal(['nutty', term]) == term
def test_guess_terminal_accepts_a_preference(path): term = 'shitty' Path(path, term).touch(mode=0o777) assert utils.guess_terminal(term) == term
def test_guess_terminal_falls_back_to_defaults(path): Path(path, "kitty").touch(mode=0o777) assert utils.guess_terminal(["nutty", "witty", "petty"]) == "kitty"
import subprocess import os from libqtile import bar, layout, widget, hook from libqtile.config import Click, Drag, Group, Key, Match, Screen from libqtile.lazy import lazy from libqtile.utils import guess_terminal @hook.subscribe.startup def autostart(): subprocess.call(["/home/alex/.config/qtile/autostart.sh"]) mod = "mod4" terminal = guess_terminal( ) # I use alacritty but just in case to be nice to others keys = [ # Switch between windows in current stack pane Key([mod], "k", lazy.layout.down(), desc="Move focus down in stack pane"), Key([mod], "j", lazy.layout.up(), desc="Move focus up in stack pane"), # Move windows up or down in current stack Key([mod, "shift"], "k", lazy.layout.shuffle_down(), desc="Move window down in current stack "), Key([mod, "shift"], "j", lazy.layout.shuffle_up(), desc="Move window up in current stack "),