From d72c0e08426535382aa6f694afe6c0dcdcaaa593 Mon Sep 17 00:00:00 2001 From: Derek Taylor Date: Sun, 15 Nov 2020 06:16:21 -0600 Subject: [PATCH] Adding fixing a few things. --- .config/qtile/README.org | 35 +++++++++++++++++++++++++++++++++-- .config/qtile/config.py | 34 ++++++++++++++++++++++++++++++---- .config/xmobar/xmobarrc2 | 4 ++-- .local/bin/memory | 2 +- .local/bin/pacupdate | 2 +- .local/bin/upt | 2 +- .surf/bookmarks | 3 ++- dwmblocks/blocks.h | 12 ++++++------ dwmblocks/dwmblocks | Bin 18192 -> 18192 bytes 9 files changed, 76 insertions(+), 18 deletions(-) diff --git a/.config/qtile/README.org b/.config/qtile/README.org index dabed8d..f3c8eb1 100644 --- a/.config/qtile/README.org +++ b/.config/qtile/README.org @@ -15,6 +15,7 @@ - [[#default-widget-settings][Default Widget Settings]] - [[#widgets][Widgets]] - [[#screens][Screens]] +- [[#some-important-functions][Some Important Functions]] - [[#drag-floating-windows][Drag floating windows]] - [[#floating-windows][Floating windows]] - [[#startup-applications][Startup applications]] @@ -49,7 +50,6 @@ or substantial portions of the Software. - Complete remote scriptability - write scripts to set up workspaces, manipulate windows, update status bar widgets and more. - Qtile's remote scriptability makes it one of the most thoroughly unit-tested window managers around. - * Imports These are python modules that must be imported for this config. @@ -59,7 +59,7 @@ import os import re import socket import subprocess -from libqtile.config import KeyChord. Key, Screen, Group, Drag, Click +from libqtile.config import KeyChord, Key, Screen, Group, Drag, Click from libqtile.command import lazy from libqtile import layout, bar, widget, hook from libqtile.lazy import lazy @@ -645,6 +645,37 @@ if __name__ in ["config", "__main__"]: widgets_screen2 = init_widgets_screen2() #+END_SRC +* Some Important Functions + +#+begin_src python +def window_to_prev_group(qtile): + if qtile.currentWindow is not None: + i = qtile.groups.index(qtile.currentGroup) + qtile.currentWindow.togroup(qtile.groups[i - 1].name) + +def window_to_next_group(qtile): + if qtile.currentWindow is not None: + i = qtile.groups.index(qtile.currentGroup) + qtile.currentWindow.togroup(qtile.groups[i + 1].name) + +def window_to_previous_screen(qtile): + i = qtile.screens.index(qtile.current_screen) + if i != 0: + group = qtile.screens[i - 1].group.name + qtile.current_window.togroup(group) + +def window_to_next_screen(qtile): + 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) + +def switch_screens(qtile): + i = qtile.screens.index(qtile.current_screen) + group = qtile.screens[i - 1].group + qtile.current_screen.set_group(group) +#+end_src + * Drag floating windows Defining some mousebindings for use with floating windows. diff --git a/.config/qtile/config.py b/.config/qtile/config.py index 6776d62..f0927a5 100644 --- a/.config/qtile/config.py +++ b/.config/qtile/config.py @@ -3,9 +3,10 @@ import os import re import socket import subprocess -from libqtile.config import Key, Screen, Group, Drag, Click +from libqtile.config import KeyChord, Key, Screen, Group, Drag, Click from libqtile.command import lazy from libqtile import layout, bar, widget, hook +from libqtile.lazy import lazy from typing import List # noqa: F401 mod = "mod4" # Sets mod key to SUPER/WINDOWS @@ -144,7 +145,6 @@ keys = [ desc='Passmenu' ), Key(["mod1", "control"], "r", - lazy.spawn("./.dmenu/dmenu-reddio.sh"), desc='Dmenu reddio script' ), Key(["mod1", "control"], "s", @@ -388,9 +388,8 @@ def init_widgets_list(): background = colors[4], fontsize = 14 ), - widget.CheckUpdates( + widget.Pacman( update_interval = 1800, - distro = 'Arch', foreground = colors[2], mouse_callbacks = {'Button1': lambda qtile: qtile.cmd_spawn(myTerm + ' -e sudo pacman -Syu')}, background = colors[4] @@ -517,6 +516,33 @@ if __name__ in ["config", "__main__"]: widgets_screen1 = init_widgets_screen1() widgets_screen2 = init_widgets_screen2() +def window_to_prev_group(qtile): + if qtile.currentWindow is not None: + i = qtile.groups.index(qtile.currentGroup) + qtile.currentWindow.togroup(qtile.groups[i - 1].name) + +def window_to_next_group(qtile): + if qtile.currentWindow is not None: + i = qtile.groups.index(qtile.currentGroup) + qtile.currentWindow.togroup(qtile.groups[i + 1].name) + +def window_to_previous_screen(qtile): + i = qtile.screens.index(qtile.current_screen) + if i != 0: + group = qtile.screens[i - 1].group.name + qtile.current_window.togroup(group) + +def window_to_next_screen(qtile): + 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) + +def switch_screens(qtile): + i = qtile.screens.index(qtile.current_screen) + group = qtile.screens[i - 1].group + qtile.current_screen.set_group(group) + mouse = [ Drag([mod], "Button1", lazy.window.set_position_floating(), start=lazy.window.get_position()), diff --git a/.config/xmobar/xmobarrc2 b/.config/xmobar/xmobarrc2 index ee88fd2..803fe3a 100755 --- a/.config/xmobar/xmobarrc2 +++ b/.config/xmobar/xmobarrc2 @@ -3,8 +3,8 @@ -- you can find weather location codes here: http://weather.noaa.gov/index.html Config { font = "xft:Ubuntu:weight=bold:pixelsize=11:antialias=true:hinting=true" - , additionalFonts = [ "xft:SauceCodePro Nerd Font:pixelsize=11:antialias=true:hinting=true" - , "xft:SauceCodePro Nerd Font:pixelsize=16:antialias=true:hinting=true" + , additionalFonts = [ "xft:Mononoki Nerd Font:pixelsize=11:antialias=true:hinting=true" + , "xft:Mononoki Nerd Font:pixelsize=16:antialias=true:hinting=true" , "xft:FontAwesome:pixelsize=13" ] , bgColor = "#282c34" diff --git a/.local/bin/memory b/.local/bin/memory index 6cda383..a0a1529 100755 --- a/.local/bin/memory +++ b/.local/bin/memory @@ -1,4 +1,4 @@ #! /bin/bash mem="$(free -h | awk '/^Mem:/ {print $3 "/" $2}')" -echo -e "$mem ram " +echo -e "$mem " diff --git a/.local/bin/pacupdate b/.local/bin/pacupdate index 9ad32fb..ef2e879 100755 --- a/.local/bin/pacupdate +++ b/.local/bin/pacupdate @@ -1,4 +1,4 @@ #!/bin/bash cupd=$(checkupdates | wc -l) -echo "$cupd updates" +echo "$cupd available " diff --git a/.local/bin/upt b/.local/bin/upt index ff48d2f..670a10d 100755 --- a/.local/bin/upt +++ b/.local/bin/upt @@ -1,4 +1,4 @@ #! /bin/bash upt="$(uptime --pretty | sed -e 's/up //g' -e 's/ days/d/g' -e 's/ day/d/g' -e 's/ hours/h/g' -e 's/ hour/h/g' -e 's/ minutes/m/g' -e 's/, / /g')" -echo -e "$upt uptime " +echo -e "$upt " diff --git a/.surf/bookmarks b/.surf/bookmarks index 81cbd56..f09b493 100644 --- a/.surf/bookmarks +++ b/.surf/bookmarks @@ -1,6 +1,7 @@ +reddit.com/r/emacs/ +distrowatch.com/ aur.archlinux.org/ file:///home/dt/.surf/html/homepage.html -distrowatch.com/ https://gitlab.com/dwt1 https://www.youtube.com/c/DistroTube/ https://www.patreon.com/distrotube diff --git a/dwmblocks/blocks.h b/dwmblocks/blocks.h index 3afab70..abf8289 100644 --- a/dwmblocks/blocks.h +++ b/dwmblocks/blocks.h @@ -1,17 +1,17 @@ //Modify this file to change what commands output to your statusbar, and recompile using the make command. static const Block blocks[] = { /*Icon*/ /*Command*/ /*Update Interval*/ /*Update Signal*/ - {" 🐧 ", "/home/dt/.local/bin/kernel", 360, 2}, + {" Kernel: ", "/home/dt/.local/bin/kernel", 360, 2}, - {" 🔺 ", "/home/dt/.local/bin/upt", 60, 2}, + {" Uptime: ", "/home/dt/.local/bin/upt", 60, 2}, - {" 📦 ", "/home/dt/.local/bin/pacupdate", 360, 9}, + {" Updates: ", "/home/dt/.local/bin/pacupdate", 360, 9}, - {" 💻 ", "/home/dt/.local/bin/memory", 6, 1}, + {" Mem: ", "/home/dt/.local/bin/memory", 6, 1}, - {" 🔊 ", "/home/dt/.local/bin/volume", 2, 10}, + {" Vol: ", "/home/dt/.local/bin/volume", 2, 10}, - {" 🕑 ", "/home/dt/.local/bin/clock", 5, 0}, + {" Time: ", "/home/dt/.local/bin/clock", 5, 0}, }; //sets delimeter between status commands. NULL character ('\0') means no delimeter. diff --git a/dwmblocks/dwmblocks b/dwmblocks/dwmblocks index f91f9e037db99cad36264acfcaa8774e232bfa2e..1efcb0e6edc0068f5bb9f4c32c135b3038845740 100755 GIT binary patch delta 800 zcmZ9KUr5tY6vyw~R@+afxv1t4+}(Z)DUgLrlKzmjNsKij&_QnoE*d!9Y>{FhK~Oy; z8z-uV1_^uE`UBMuBFRWFDC;qTo{D5dgP=@H^5ypZ?T^6@ocsBm^F8O@!;h1m=ILqv zsFy2wBP&~;g8ZeeC@Rqg$zgcDZSF?k!;9FH*7pUKZqJ4%p59qq(7qXZOuU&~X1ilo zwQKNDrQ1>g^U+DDp{hDwr$*=!)KpbX*Qt~A80yWcny*u{^abj(sybh%&TBTyYy-Dy z@3ww2aWCDopWsW{y1mh24n@aCqQm7R4g7X$4%!GDJBLIL#I>GbCrrg z(P#=sgQ63aZC=kCstyDYU1vb*fq571&t} zjFDJvJ$ypX;^)Bid~Goz0s%~~SHRjzObR{A*k(8+R$GRwKmgP4Xn=35fk42R_PR4; x;zc^rwcTiA2`$+r4LnE5?hCxAmAbDq@g++7y~_U`FZlN<30Jup^(B9Y@gKwn&@cc1 delta 846 zcmZ9LT}V@57{{OYY`QNE7u6Ia&vB9794bKyG*DJ#Wz?Xk?hG3&UD}bp2`qvd<;T{e z7eS!i)D{uiLBzbss|vcQD|Zn=5VT!{n|x`{`MeJ; zHsPAIQGQMG0rAS4QdhGza*Z;-VP&*6@a)_0_=_b+dir(d*4caPHq**(yYR5)@YQT9 zxVrYNx}B>aor6&K71S#wYA4@>+EY+tC91*GP=^X?qC{o>4E1?IT_{m!Os{j!Erj`Q z{U^KF%1?bq#G<+4^EmCy*NglDiSQK-vt&2$WW~+Q8@w< z6-S3vBv{rNZbWftW>h3Z<{Le37b$LU+Gz7q*fg4?A|A5Qd|9N-O!J*evB*YXyX)T{ Rkqqo|g|)mH{h2_6?Jx0x+%*6I