diff options
| -rw-r--r-- | README.md | 65 | ||||
| -rw-r--r-- | autostart.sh_example | 25 | ||||
| -rw-r--r-- | config.py | 29 | ||||
| -rwxr-xr-x | cusmodules/colors.py | 9 | ||||
| -rwxr-xr-x | cusmodules/cuswidgets/ticker_gecko.py | 2 | ||||
| -rwxr-xr-x | cusmodules/wallpaper.py | 12 | 
6 files changed, 88 insertions, 54 deletions
| @@ -1,24 +1,37 @@  ## Mike's Custom Qtile Config -### Features +## Important! +--- +Qtile has changed to the `uv` package manager and done away with the old entry point. Use the guide [here](https://docs.qtile.org/en/latest/manual/install/index.html), installing with widget dependencies, and run `uv pip install requests` in the directory where you cloned the qtile repository. I start qtile using `startx` with `$HOME/git/qtile/.venv/bin/python $HOME/git/qtile/.venv/bin/qtile start` in my `~/.xinitrc`. + +## Features  ---  - Pywal Integration.  - Window Swallowing.  - Cryptocurrency Widget. -Automatic reloads from wallpaper.py and colors.py assumes that the `qtile` script is located in `$HOME/git/qtile/bin/`. I use the master branch of qtile from github. +Automatic reloads from wallpaper.py and colors.py assumes that the `qtile` script is located in `$HOME/git/qtile/.venv/bin/`. I use the master branch of qtile from GitHub.  ### Dependencies  --- +- Zsh.  - [Mpd2](https://pypi.org/project/python-mpd2/). Host is ~/.mpd/socket. Port is 6600.  - [Ario](https://ario-player.sourceforge.net/).  - Imagemagick.  - [Pywal.](https://github.com/dylanaraps/pywal) +- [OpenRazer.](https://openrazer.github.io)  - [Xsnow.](https://www.ratrabbit.nl/ratrabbit/xsnow/)  - Xautolock. Uses [slock](https://tools.suckless.org/slock/) with xres and message patches. I might put my fork up in the future.  - [Dmenu.](https://github.com/LukeSmithxyz/dmenu)  - [Flameshot.](https://flameshot.org/) +- [Dunst.](https://github.com/dunst-project/dunst)  - Powerline Symbols. +- Nimbus Sans. +- Liberation Sans. + +### Usage +--- +Copy `autostart.sh_example` to `autostart.sh` in the same directory. Make any necessary changes.  ### Defaults  --- @@ -27,7 +40,7 @@ Default programs are located at the top of `config.py`.  - Terminal Emulator: [Alacritty.](https://github.com/alacritty/alacritty)  - Browser: [Librewolf.](https://librewolf.net/) -### Key Bindings +## Key Bindings  ---  |Binding|Action|  |-|-| @@ -91,29 +104,7 @@ Default programs are located at the top of `config.py`.  |MODKEY + SHIFT + Y|Send window to 'hidden' group.|  |MODKEY + CONTROL + Y|Send window to 'hidden' group and follow.|  |MODKEY + Q|Display clipboard contents as a QR code.| -|MODKEY + CONTROL + E|Open the hammer editor.| - -### Copyright ---- -Copyright (c) 2012-2015 Tycho Andersen, -Copyright (c) 2013 xarvh, -Copyright (c) 2013 horsik, -Copyright (c) 2013-2014 roger, -Copyright (c) 2013 Tao Sauvage, -Copyright (c) 2014 ramnes, -Copyright (c) 2014 Sean Vig, -Copyright (c) 2014 Adi Sieker. - -Modified by Michael Kantor - -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. +|MODKEY + CONTROL + E|Open the hammer++ editor.|  ## Custom Modules @@ -164,3 +155,25 @@ Gets the price of a cryptocurrency from [CoinGecko](https://www.coingecko.com/).  - DOGE  More can be added to the "currencies" variable in the "match" function. + +## Copyright +--- +Copyright (c) 2012-2015 Tycho Andersen, +Copyright (c) 2013 xarvh, +Copyright (c) 2013 horsik, +Copyright (c) 2013-2014 roger, +Copyright (c) 2013 Tao Sauvage, +Copyright (c) 2014 ramnes, +Copyright (c) 2014 Sean Vig, +Copyright (c) 2014 Adi Sieker. + +Modified by Michael Kantor + +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. diff --git a/autostart.sh_example b/autostart.sh_example new file mode 100644 index 0000000..b33aa55 --- /dev/null +++ b/autostart.sh_example @@ -0,0 +1,25 @@ +#!/bin/zsh + +mpd + +amixer -q set Capture mute nocap + +xautolock -time 5 -locker 'slock -m "$(cowsay $(fortune))"' & + +picom & + +xclip & + +dunst & + +touch /tmp/crprices.json +$HOME/.config/qtile/cusmodules/cuswidgets/ticker_gecko.py BTC XMR DOGE & + +sleep 1 + +$HOME/git/qtile/.venv/bin/qtile shell -c "reload_config()" & + +if [ "$(date +%m)" -eq 12 ]; then +	#xsnow -notrees & +	$HOME/Downloads/xsnow-3.7.6/src/xsnow -notrees -nomenu -scale 40 -moon 0 +fi @@ -212,17 +212,6 @@ def cycle_float(qtile, direc):  #  #    with open('/tmp/qtile_debug.py', 'w') as f:  #        f.write(str(dic)) -#@hook.subscribe.changegroup -#def defloat_mpv_onchange(): -#    global qtile - -#    with open('/tmp/wins.dict', 'w') as f: -#        f.write(str(dir(qtile.current_group))) - -    #name = c.info()['name'] - -    #if 'mpv' in name: -    #    c.disable_floating()  @hook.subscribe.setgroup  def move_pin(): @@ -240,13 +229,6 @@ def move_pin():      #with open('/tmp/wins.dict', 'w') as f:      #    f.write(str(qtile.groups().get('swallow').get('windows'))) -@hook.subscribe.client_name_updated -def defloat_mpv(c): -    name = c.info()['name'] - -    if 'mpv' in name: -        c.disable_floating() -  @hook.subscribe.client_killed  def un_swallow(c):      global terms @@ -291,9 +273,6 @@ def swallow(c):      #with open('/tmp/test.fifo', 'r') as f:      #    f.write(name) -    if 'mpv' in name: -        c.disable_floating() -      pid = c.window.get_net_wm_pid()      if pid == None: @@ -511,6 +490,7 @@ keys.append(Key([mod, "control"], '0', lazy.window.togroup('X'), lazy.group['X']  widget_defaults = {      'font': 'Nimbus Sans', +    #'font': 'Liberation Sans',      'fontsize': 13,      'padding': 2,  } @@ -542,10 +522,11 @@ screens = [                  widget.GroupBox(                      margin_y = 6, -                    margin_x = 0, +                    margin_x = 5,                      padding_y = 5, -                    padding_x = 3, +                    padding_x = 1,                      borderwidth = 3, +                    spacing = 1,                      active = '#ffffff',                      inactive = inactive('color0'),                      rounded = False, @@ -553,6 +534,8 @@ screens = [                      highlight_color = [color.get('color0').strip('#'), highlight('color0')],                      background = color.get('color0'),                      this_current_screen_border = color.get('color6'), +                    fontsize = 15, +                    font = 'Liberation Sans'                      ),                  widget.TextBox( diff --git a/cusmodules/colors.py b/cusmodules/colors.py index f25c3c7..c9a3cbc 100755 --- a/cusmodules/colors.py +++ b/cusmodules/colors.py @@ -22,6 +22,7 @@ import wallpaper  from pathlib import Path  from random import randint  from subprocess import run +import openrazer.client  def random(colors):      colorcount = len(colors) - 1 @@ -51,9 +52,15 @@ def setColor(home, color_dir, choice, **kwargs):      #run(['qtile', 'shell', '-c', 'restart()'])      #run(['kill', '-SIGUSR1', os.popen('pidof qtile').read().strip('\n')]) -    run([f'{home}/git/qtile/bin/qtile', 'shell', '-c', 'reload_config()']) +    run([f'{home}/git/qtile/.venv/bin/qtile', 'shell', '-c', 'reload_config()'])      run([f'{home}/.local/bin/pywalfox', 'update']) +    rgb = tuple(int(bottom_color.lstrip('#')[i:i+2], 16) for i in (0, 2, 4)) +    devman = openrazer.client.DeviceManager() + +    for device in devman.devices: +        device.fx.static(rgb[0], rgb[1], rgb[2]) +      return 0  def main(argc, argv): diff --git a/cusmodules/cuswidgets/ticker_gecko.py b/cusmodules/cuswidgets/ticker_gecko.py index d58e458..94fd1c6 100755 --- a/cusmodules/cuswidgets/ticker_gecko.py +++ b/cusmodules/cuswidgets/ticker_gecko.py @@ -111,7 +111,7 @@ def main():          return crprices[:15]      except Exception as e: -        with open(f'{home}/.local/share/ticker_gecko/ticker_gecko.log', 'w') as f: +        with open(f'{home}/.local/share/ticker_gecko/ticker_gecko.log', 'w+') as f:              f.write(e)          return f'ERROR! Check "{home}/.local/share/ticker_gecko/ticker_gecko.log".' diff --git a/cusmodules/wallpaper.py b/cusmodules/wallpaper.py index 226fe52..711c507 100755 --- a/cusmodules/wallpaper.py +++ b/cusmodules/wallpaper.py @@ -1,5 +1,4 @@  #!/usr/bin/env python -  #Copyright (C) 2024  Michael Kantor  #This program is free software: you can redistribute it and/or modify @@ -20,6 +19,7 @@ import sys  import json  import toml  import signal +import openrazer.client  from PIL import Image  from pathlib import Path  from random import randint @@ -176,7 +176,7 @@ if __name__ == '__main__':                  #subprocess.check_call(['qtile', 'shell', '-c', 'restart()'])                  #run(['kill', '-SIGUSR1', os.popen('pidof qtile').read().strip('\n')])                  #run(['qtile', 'shell', '-c', 'restart()']) -                run([f'{home}/git/qtile/bin/qtile', 'shell', '-c', 'reload_config()']) +                run([f'{home}/git/qtile/.venv/bin/qtile', 'shell', '-c', 'reload_config()'])              except:                  os.system('killall dwm') @@ -277,7 +277,13 @@ if __name__ == '__main__':          #subprocess.check_call(['qtile', 'shell', '-c', 'restart()'])          #run(['qtile', 'shell', '-c', 'restart()'])          #run(['kill', '-SIGUSR1', os.popen('pidof qtile').read().strip('\n')]) -        run([f'{home}/git/qtile/bin/qtile', 'shell', '-c', 'reload_config()']) +        run([f'{home}/git/qtile/.venv/bin/qtile', 'shell', '-c', 'reload_config()']) + +        rgb = tuple(int(bottom_color.lstrip('#')[i:i+2], 16) for i in (0, 2, 4)) +        devman = openrazer.client.DeviceManager() + +        for device in devman.devices: +            device.fx.static(rgb[0], rgb[1], rgb[2])          #os.system('qtile shell -c "restart()"')      except: | 
