Dotfiles config update (2022-04-30)

This commit is contained in:
q3aql 2022-04-30 12:49:30 +02:00
parent e595d02585
commit 0fe0add758
30 changed files with 1691 additions and 1 deletions

View File

@ -0,0 +1,32 @@
#!/bin/sh
# Autostart script for Qtile
cmd_exist() { unalias "$1" >/dev/null 2>&1 ; command -v "$1" >/dev/null 2>&1 ;}
__kill() { kill -9 "$(pidof "$1")" >/dev/null 2>&1 ; }
__start() { sleep 1 && "$@" >/dev/null 2>&1 & }
__running() { pidof "$1" >/dev/null 2>&1 ;}
systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
# Apps to autostart
if cmd_exist kanshi ; then
__kill kanshi
__start kanshi
fi
# Authentication dialog
if [ -f /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 ]; then
__kill polkit-gnome-authentication-agent-1
__start /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
fi
# Notification daemon
if cmd_exist dunst ; then
__kill dunst
__start dunst
fi

View File

@ -0,0 +1,16 @@
#!/bin/bash
# Check updates on Arch Linux
# Note: Create cron on /etc/cron.d/checkupdates with the following lines:
# 0 * * * * root /usr/bin/pacman -Sy
# 30 * * * * root /usr/bin/pacman -Sy
if [ -f /usr/bin/pacman ] ; then
pacman -Qu
# Check updates on Ubuntu/Debian/Devuan
# Note: Create cron on /etc/cron.d/checkupdates with the following lines:
# 0 * * * * root /usr/bin/aptitude update
# 30 * * * * root /usr/bin/aptitude update
elif [ -f /usr/bin/aptitude ] ; then
aptitude search "~U"
fi

View File

@ -0,0 +1 @@
{"theme": "dracula"}

View File

@ -0,0 +1,47 @@
# Qtile Config File
# http://www.qtile.org/
# Justine Smithies
# https://github.com/justinesmithies/qtile-wayland-dotfiles
from typing import List # noqa: F401
import hooks
from settings.keys import mod, keys, home
from settings.workspaces import workspaces
from settings.groups import groups
from settings.layouts import layouts
from settings.widgets import widget_defaults, extension_defaults
from settings.screens import screens
from settings.mouse import mouse
# Configure input devices
try:
from libqtile.backend.wayland import InputConfig
wl_input_rules = {
"type:keyboard": InputConfig(
#kb_layout='us',
kb_layout='es',
),
}
except ImportError:
wl_input_rules = None
dgroups_key_binder = None
dgroups_app_rules = [] # type: List
follow_mouse_focus = True
bring_front_click = False
cursor_warp = False
auto_fullscreen = True
focus_on_window_activation = "smart"
reconfigure_screens = 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 = "Qtile"

View File

@ -0,0 +1,84 @@
# Qtile Config File
# http://www.qtile.org/
# Justine Smithies
# Hooks configuration
import os
import subprocess
import time
from libqtile import qtile
from libqtile import hook
from groups import groups
from libqtile.log_utils import logger
@hook.subscribe.startup_once
def autostart():
home = os.path.expanduser('~')
subprocess.Popen([home + '/.config/qtile/autostart.sh'])
# Get the number of connected screens
# @hook.subscribe.screens_reconfigured
def get_monitors():
xr = qtile.screens
result = len(xr) - 1 if len(xr) > 2 else len(xr)
if result <= 0:
result = 1
logger.warning(f"Number of monitors: {result}")
return result
# When application launched automatically focus it's group
@hook.subscribe.client_new
def modify_window(client):
for group in groups: # follow on auto-move
match = next((m for m in group.matches if m.compare(client)), None)
if match:
targetgroup = client.qtile.groups_map[group.name] # there can be multiple instances of a group
targetgroup.cmd_toscreen(toggle=False)
break
# Hook to fallback to the first group with windows when last window of group is killed
# @hook.subscribe.client_killed
# def fallback(window):
# if window.group.windows != [window]:
# if isinstance(window, base.Static) or window.group.windows != [window]:
# return
# idx = qtile.groups.index(window.group)
# for group in qtile.groups[idx - 1::-1]:
# if group.windows:
# qtile.current_screen.toggle_group(group)
# return
# qtile.current_screen.toggle_group(qtile.groups[0])
# Work around for matching Spotify
@hook.subscribe.client_new
def slight_delay(window):
time.sleep(0.04)
# If Spotify opens move it to group 6
@hook.subscribe.client_name_updated
def spotify(window):
if window.name == 'Spotify':
window.cmd_togroup(group_name='阮 ₆')
# If mpv opens float it at pos x, y, w, h, borderwidth, border color
@hook.subscribe.client_managed
def repos(window):
if window.get_wm_class() and 'mpv' in window.get_wm_class():
window.floating = True
window.place(1200, 650, 640, 360, 2, "#ffffff")

View File

@ -0,0 +1,36 @@
#!/bin/bash
#rofi_command="wofi"
rofi_command="rofi -theme themes/powermenu.rasi -i "
#### Options ###
power_off="襤 Shutdown"
reboot="勒 Reboot"
lock=" Lock Screen"
suspend=" Suspend"
hibernate="鈴 Hibernate"
log_out="﫼 Log Out"
# Variable passed to rofi
options="$power_off\n$reboot\n$suspend\n$hibernate\n$log_out"
#chosen="$(echo -e "$options" | $rofi_command --height=280 --prompt "Power Menu" )"
chosen="$(echo -e "$options" | $rofi_command -dmenu -mesg "Power Menu" )"
case $chosen in
$power_off)
systemctl poweroff
;;
$reboot)
systemctl reboot
;;
$suspend)
systemctl suspend
;;
$hibernate)
systemctl hibernate
;;
$log_out)
#swaymsg exit
loginctl terminate-session "${XDG_SESSION_ID-}"
;;
esac

View File

@ -0,0 +1,92 @@
#!/usr/bin/env python
#
# Qtile window switcher for Wayland only
#
# Justine Smithies - 2021
#
# Requirements are: qtile running under Wayland and rofi-lbonn-wayland-git
import subprocess
import os
import re
from libqtile.command.client import InteractiveCommandClient
client = InteractiveCommandClient()
windows = client.windows()
# Get the number of open windows
lines = (len(windows))
x = 0
names = []
ids = []
groups = []
appids = []
while x < lines:
# client.window[window_id].focus() etc
win = windows[x]
name = win.get("name")
names.append(name)
id = win.get("id")
ids.append(id)
group = win.get("group")
groups.append(group)
appid = win.get("wm_class")[0]
appids.append(appid)
print(name, id, group, appid)
x += 1
print(windows)
# Reverse the tuples
ids = ids[::-1]
groups = groups[::-1]
names = names[::-1]
appids = appids[::-1]
# Combine all the information into a string to be piped through rofi -dmenu
d = dict(os.environ)
outputs = []
output = []
icon = []
x = 0
print(lines)
while x < lines:
id = ids[x]
id = str(id)
appid = (appids[x]).strip('\n')
name = names[x]
# If name is > 40 characters then shorten it to max 40 and append ...
if len(name) > 40:
name = name[:40] + '...'
group = groups[x]
# Hacky fix to get correct icon for appids that begin with org.
if 'org.' in appid:
icon = appid.split(".")
icon = str(icon[2].lower())
else:
icon = appid
output = ' ' + appid + ' - ' + name + ' on group: ' + group + ' (' + id + ')' + r'\0icon\x1f' + icon + '\n'
outputs.append(str(output))
x += 1
outputs = ''.join(outputs)
# Remove last blank line
outputs = os.linesep.join([s for s in outputs.splitlines() if s])
print(outputs)
# Send options to rofi
d["OPTIONS"] = outputs
d["LINES"] = str(lines)
result = subprocess.Popen('echo -e "$OPTIONS" | rofi -theme themes/windowswitcher.rasi -i -dmenu -l $LINES -mesg "Window Switcher"', shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=d)
# Get selected option and process
selected_option = str(result.communicate())
print(selected_option)
# Search for the content between the last set of brackets
selected_option = re.sub('^.*\((.*?)\)[^\(]*$', '\g<1>', selected_option)
print(selected_option)
if True in [char.isdigit() for char in selected_option]:
selected_option = int(selected_option)
client.window[selected_option].group.toscreen()
client.window[selected_option].focus()
exit()
else:
exit()

View File

@ -0,0 +1,19 @@
#!/bin/bash
home=$(eval echo ~"$USER")
case $1 in
selected-region)
# Take a screenshot of the selected region
grim -t jpeg -g "$(slurp)" "$home"/Pictures/Screenshots/"$(date +%Y-%m-%d_%H-%m-%s)".jpg
;;
save-to-clipboard)
# Take a screenshot and save it to the clipboard
grim -g "$(slurp -d)" - | wl-copy
;;
*)
# Take a screenshot of all outputs and save it into screenshots
grim -t jpeg ~/Pictures/Screenshots/$(date +%Y-%m-%d_%H-%m-%s).jpg
;;
esac

View File

@ -0,0 +1,24 @@
# Justine Smithies
# https://github.com/justinesmithies/qtile-wayland-dotfiles
# Color configuration
colors = [
'#292d3e',
'#dc322f',
'#00ff2a',
'#b58900',
'#268bd2',
'#d33682',
'#2aa198',
'#eee8d5'
]
BLACK = colors[0]
RED = colors[1]
GREEN = colors[2]
YELLOW = colors[3]
BLUE = colors[4]
MAGENTA = colors[5]
CYAN = colors[6]
WHITE = colors[7]

View File

@ -0,0 +1,21 @@
# Justine Smithies
# https://github.com/justinesmithies/qtile-wayland-dotfiles
# Groups configuration
from libqtile.config import Key, Group
from libqtile.command import lazy
from keys import mod, keys
from workspaces import workspaces
from screens import connected_monitors
groups = []
for workspace in workspaces:
matches = workspace["matches"] if "matches" in workspace else None
layouts = workspace["layout"] if "layout" in workspace else None
groups.append(Group(workspace["name"], matches=matches, layout=layouts))
keys.append(Key([mod], workspace["key"], lazy.group[workspace["name"]].toscreen()))
keys.append(Key([mod, "shift"], workspace["key"], lazy.window.togroup(workspace["name"])))
for i in range(connected_monitors):
keys.extend([Key([mod, "mod1"], str(i), lazy.window.toscreen(i))])

View File

@ -0,0 +1,237 @@
# Justine Smithies
# https://github.com/justinesmithies/qtile-wayland-dotfiles
# Key configuration
import os
from libqtile.config import Key
from libqtile.command import lazy
home = os.path.expanduser('~')
terminal = 'kitty'
mod = "mod4"
keys = [
Key([mod], "g",
lazy.screen.next_group(skip_empty=True),
desc="Move to next active group"
),
Key([mod, "shift"], "g",
lazy.screen.prev_group(skip_empty=True),
desc="Move to previous active group"
),
# 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"
),
Key([mod, "shift"], "k",
lazy.layout.shuffle_down(),
desc='Shuffle down'
),
Key([mod, "shift"], "j",
lazy.layout.shuffle_up(),
desc='Shuffle up'
),
Key([mod, "shift"], "h",
lazy.layout.shuffle_left(),
desc='Shuffle left'
),
Key([mod, "shift"], "l",
lazy.layout.shuffle_right(),
desc='Shuffle right'
),
Key([mod, "mod1"], "j",
lazy.layout.flip_down(),
desc='Flip down'
),
Key([mod, "mod1"], "k",
lazy.layout.flip_up(),
desc='Flip up'
),
Key([mod, "mod1"], "h",
lazy.layout.flip_left(),
desc='Flip left'
),
Key([mod, "mod1"], "l",
lazy.layout.flip_right(),
desc='Flip right'
),
Key([mod, "control"], "j",
lazy.layout.grow_down(),
desc='Grow down'
),
Key([mod, "control"], "k",
lazy.layout.grow_up(),
desc='Grow up'
),
Key([mod, "control"], "h",
lazy.layout.grow_left(),
desc='Grow left'
),
Key([mod, "control"], "l",
lazy.layout.grow_right(),
desc='Grow right'
),
Key([mod], "n",
lazy.layout.normalize(),
desc='normalize window size ratios'
),
Key([mod], "m",
lazy.layout.maximize(),
desc='toggle window between minimum and maximum sizes'
),
Key([mod], "h",
lazy.layout.grow(),
lazy.layout.increase_nmaster(),
desc='Expand window (MonadTall), increase number in master pane (Tile)'
),
Key([mod], "l",
lazy.layout.shrink(),
lazy.layout.decrease_nmaster(),
desc='Shrink window (MonadTall), decrease number in master pane (Tile)'
),
# Toggle floating
Key([mod, "shift"], "f", lazy.window.toggle_floating(),
desc="Toggle floating"
),
# Toggle Fullscreen
Key([mod], "f",
lazy.window.toggle_fullscreen(),
lazy.hide_show_bar(position='all'),
desc='Toggle fullscreen and the bars'
),
# Switch window focus to other pane(s) of stack
Key([mod], "space", lazy.layout.next(),
desc="Switch window focus to other pane(s) of stack"
),
# Swap panes of split stack
Key([mod, "shift"], "space",
lazy.layout.rotate(),
desc="Swap panes of split stack"
),
# ------------ App Configs ------------
Key([mod], "o", lazy.spawn("rofi -show drun")),
Key([mod], "p", lazy.spawn("rofi -show run")),
Key([mod, "shift"], "w", lazy.spawn("rofi -show")),
Key([mod], "b", lazy.spawn("firefox")),
Key([mod], "n", lazy.spawn("pcmanfm")),
Key([mod], "g", lazy.spawn("geany")),
Key([mod], "m", lazy.spawn("telegram")),
Key([mod], "z", lazy.spawn("nitrogen")),
Key([mod], "u", lazy.spawn("xterm")),
Key([mod], "t", lazy.spawn("rofi-theme-selector")),
Key([mod], "i", lazy.spawn("lxappearance")),
# Terminal
Key([mod], "Return", lazy.spawn("kitty")),
# Toggle between different layouts as defined below
Key([mod], "Tab",
lazy.next_layout(),
desc="Toggle between layouts"
),
Key([mod], "w",
lazy.window.kill(),
desc="Kill focused window"
),
# Toggle bars
Key([mod], "b",
lazy.hide_show_bar(position='all'),
desc="Toggle bars"
),
# Qtile system keys
Key([mod, "control"], "r",
lazy.reload_config(),
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"
),
Key([mod, "control"], "p",
lazy.spawn("" + home + "/.config/qtile/scripts/powermenu"),
desc="Launch Power menu"
),
# Rofi
Key(["control"], "space",
lazy.spawn("rofi -show drun"),
desc="Launch Rofi menu"
),
# Window Switcher
Key([mod, "control"], "w",
lazy.spawn(home + "/.config/qtile/scripts/qtile-window-switcher.py"),
desc="Launch the Window Switcher",
),
# Cycle through windows in the floating layout
Key([mod, "shift"], "i",
lazy.window.toggle_minimize(),
lazy.group.next_window(),
lazy.window.bring_to_front()
),
# ------------ Hardware Configs ------------
# Volume
Key([], "XF86AudioLowerVolume", lazy.spawn(
"pactl set-sink-volume @DEFAULT_SINK@ -5%"
)),
Key([], "XF86AudioRaiseVolume", lazy.spawn(
"pactl set-sink-volume @DEFAULT_SINK@ +5%"
)),
Key([], "XF86AudioMute", lazy.spawn(
"pactl set-sink-mute @DEFAULT_SINK@ toggle"
)),
# Brightness
Key([], "XF86MonBrightnessDown",
lazy.spawn(home + "/.local/bin/statusbar/brightnesscontrol down"),
desc='Brightness down'
),
Key([], "XF86MonBrightnessUp",
lazy.spawn(home + "/.local/bin/statusbar/brightnesscontrol up"),
desc='Brightness up'
),
# Screenshots
# Take a screenshot of all outputs and save it into screenshots
Key([], "Print",
lazy.spawn(home + "/.config/qtile/scripts/screenshot.sh"),
desc='Save the screens of all outputs to the screenshots folder'
),
# Take a screenshot of the selected region
Key([mod], "Print",
lazy.spawn(home + "/.config/qtile/scripts/screenshot.sh selected-region"),
desc='Save the selected region of the screen to the screenshots folder'
),
# Capture region of screen to clipboard
Key([mod, "shift"], "Print",
lazy.spawn(home + "/.config/qtile/scripts/screenshot.sh save-to-clipboard"),
desc='Capture a region of the screen to the clipboard'
),
]
for i in range(1, 5):
keys.append(Key(["control", "mod1"], "F"+str(i),
lazy.core.change_vt(i),
desc='Change to virtual console '+str(i)
),)

View File

@ -0,0 +1,57 @@
# Justine Smithies
# https://github.com/justinesmithies/qtile-wayland-dotfiles
# Layout configuration
from libqtile import layout
from libqtile.config import Match
#from colors import *
from .theme import colors
layout_conf = {
'border_focus': colors['focus'][0],
'border_width': 1,
'margin': 4
}
layouts = [
layout.MonadTall(**layout_conf),
layout.MonadWide(**layout_conf),
layout.Bsp(**layout_conf),
#layout.Matrix(columns=2, **layout_conf),
layout.RatioTile(**layout_conf),
#layout.Columns(),
#layout.Tile(),
layout.TreeTab(),
layout.Max(),
#layout.VerticalTile(),
#layout.Zoomy(),
]
floating_layout = layout.Floating(float_rules=[
# Run the utility of `xprop` to see the wm class and name of an X client.
# *layout.Floating.default_float_rules,
Match(title='Quit and close tabs?'),
Match(wm_type='utility'),
Match(wm_type='notification'),
Match(wm_type='toolbar'),
Match(wm_type='splash'),
Match(wm_type='dialog'),
Match(wm_class='gimp-2.99'),
Match(wm_class='Firefox'),
Match(wm_class='file_progress'),
Match(wm_class='confirm'),
Match(wm_class='dialog'),
Match(wm_class='download'),
Match(wm_class='error'),
Match(wm_class='notification'),
Match(wm_class='splash'),
Match(wm_class='toolbar'),
Match(title='About LibreOffice'),
Match(wm_class='confirmreset'), # gitk
Match(wm_class='makebranch'), # gitk
Match(wm_class='maketag'), # gitk
Match(wm_class='ssh-askpass'), # ssh-askpass
Match(title='branchdialog'), # gitk
Match(title='pinentry'), # GPG key password entry
], **layout_theme)

View File

@ -0,0 +1,28 @@
# Justine Smithies
# https://github.com/justinesmithies/qtile-wayland-dotfiles
# Mouse floating layouts.
from libqtile.config import Drag, Click
from libqtile.command import lazy
from keys import mod
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()
)
]

View File

@ -0,0 +1,20 @@
# Justine Smithies
# https://github.com/justinesmithies/qtile-wayland-dotfiles
# Ordinal Date - Displays date in format Friday 11th March 2022 - 14:53
# Add th, nd or st to the date - use custom_date in text box to display
from datetime import datetime as dt
def suffix(d):
return 'th' if 11 <= d <= 13 else {1: 'st', 2: 'nd', 3: 'rd'}.get(d % 10, 'th')
def custom_strftime(format, t):
return t.strftime(format).replace('{S}', str(t.day) + suffix(t.day))
def custom_date():
return custom_strftime('%A {S} %B %Y - %H:%M', dt.now())

View File

@ -0,0 +1,39 @@
# Justine Smithies
# https://github.com/justinesmithies/qtile-wayland-dotfiles
# Multimonitor support
from libqtile.config import Screen
from libqtile import bar
from libqtile.log_utils import logger
from widgets import primary_widgets, secondary_widgets
import subprocess
def status_bar(widgets):
return bar.Bar(widgets, 24, background="#000000AA", margin=[10, 16, 0, 16]) # Margin = N E S W
screens = [Screen(wallpaper='.cache/wallpaper', wallpaper_mode='fill', top=status_bar(primary_widgets))]
# xrandr = "xrandr | grep -w 'connected' | cut -d ' ' -f 2 | wc -l"
# command = subprocess.run(
# xrandr,
# shell=True,
# stdout=subprocess.PIPE,
# stderr=subprocess.PIPE,
# )
# if command.returncode != 0:
# error = command.stderr.decode("UTF-8")
# logger.error(f"Failed counting monitors using {xrandr}:\n{error}")
# connected_monitors = 1
# else:
# connected_monitors = int(command.stdout.decode("UTF-8"))
connected_monitors = 2
if connected_monitors > 1:
for _ in range(1, connected_monitors):
screens.append(Screen(wallpaper='.cache/wallpaper', wallpaper_mode='fill', top=status_bar(secondary_widgets)))

View File

@ -0,0 +1,35 @@
# Antonio Sarosi
# https://youtube.com/c/antoniosarosi
# https://github.com/antoniosarosi/dotfiles
# Theming for Qtile
from os import path
import subprocess
import json
from .path import qtile_path
def load_theme():
theme = "dracula"
config = path.join(qtile_path, "config.json")
if path.isfile(config):
with open(config) as f:
theme = json.load(f)["theme"]
else:
with open(config, "w") as f:
f.write(f'{{"theme": "{theme}"}}\n')
theme_file = path.join(qtile_path, "themes", f'{theme}.json')
if not path.isfile(theme_file):
raise Exception(f'"{theme_file}" does not exist')
with open(path.join(theme_file)) as f:
return json.load(f)
if __name__ == "settings.theme":
colors = load_theme()

View File

@ -0,0 +1,175 @@
# Justine Smithies
# https://github.com/justinesmithies/qtile-wayland-dotfiles
# Widgets setup
# Get the icons at https://www.nerdfonts.com/cheat-sheet
import psutil
#import os
#import subprocess
from libqtile import qtile
from libqtile import widget
#from colors import *
from .theme import colors
#from ordinaldate import custom_date
from keys import terminal
def base(fg='text', bg='dark'):
return {
'foreground': colors[fg],
'background': colors[bg]
}
def separator():
return widget.Sep(**base(), linewidth=0, padding=5)
def icon(fg='text', bg='dark', fontsize=16, text="?"):
return widget.TextBox(
**base(fg, bg),
fontsize=fontsize,
text=text,
padding=3
)
def powerline(fg="light", bg="dark"):
return widget.TextBox(
**base(fg, bg),
text="", # Icon: nf-oct-triangle_left
fontsize=37,
padding=-2.1
)
def workspaces():
return [
separator(),
widget.GroupBox(
**base(fg='light'),
font='UbuntuMono Nerd Font',
fontsize=15,
#font='Liberation Mono',
#fontsize=14,
margin_y=3,
margin_x=0,
padding_y=8,
padding_x=5,
borderwidth=1,
active=colors['active'],
inactive=colors['inactive'],
rounded=False,
highlight_method='block',
urgent_alert_method='block',
urgent_border=colors['urgent'],
this_current_screen_border=colors['focus'],
this_screen_border=colors['grey'],
other_current_screen_border=colors['dark'],
other_screen_border=colors['dark'],
disable_drag=True
),
separator(),
widget.WindowName(**base(fg='focus'), fontsize=14, padding=5),
separator(),
]
widget_defaults = {
'font': 'UbuntuMono Nerd Font Bold',
'fontsize': 14,
'padding': 1,
}
extension_defaults = widget_defaults.copy()
primary_widgets = [
*workspaces(),
separator(),
powerline('color5', 'dark'),
icon(bg="color5", text=''), # Icon: nf-fa-download
widget.CheckUpdates(
background=colors['color5'],
colour_have_updates=colors['text'],
colour_no_updates=colors['text'],
no_update_string='0',
foreground='222222',
display_format='{updates}',
update_interval=1800,
#custom_command='checkupdates',
custom_command='bash ~/.config/qtile/checkUpdates.sh',
execute='bash ~/.config/qtile/checkUpdates.sh',
),
powerline('color2', 'color5'),
icon(bg="color2", text=''), # Icon: nf-fae-chipnf-fae-chip
widget.CPU(
background=colors['color2'],
foreground='222222',
update_interval=1.5,
format='{load_percent}% '
),
widget.ThermalSensor(
background=colors['color2'],
foreground='222222',
update_interval=2.0,
tag_sensor="Tctl",
),
powerline('color3', 'color2'),
icon(bg="color3", text=''), # Icon: nf-mdi-memory
widget.Memory(
background=colors['color3'],
foreground='222222',
measure_mem='G',
format='{MemUsed:.0f}{mm}/{MemTotal:.0f}{mm} ',
update_interval=2.0,
),
powerline('color5', 'color3'),
icon(bg="color5", text=''), # Icon: nf-fa-volume_up
widget.Volume(
background=colors['color5'],
foreground='222222',
channel='Master',
fmt='{}',
update_interval=0.2,
),
powerline('color2', 'color5'),
widget.CurrentLayoutIcon(**base(bg='color2'), scale=0.65),
widget.CurrentLayout(**base(bg='color2'), padding=5),
powerline('color1', 'color2'),
icon(bg="color1", fontsize=17, text=''), # Icon: nf-mdi-calendar_clock
widget.Clock(**base(bg='color1'), format='%d/%m/%Y %H:%M '),
powerline('dark', 'color1'),
widget.Systray(background=colors['dark'], padding=5),
]
secondary_widgets = [
*workspaces(),
separator(),
powerline('color2', 'dark'),
widget.CurrentLayoutIcon(**base(bg='color2'), scale=0.65),
widget.CurrentLayout(**base(bg='color2'), padding=5),
powerline('color1', 'color2'),
icon(bg="color1", fontsize=17, text=''), # Icon: nf-mdi-calendar_clock
widget.Clock(**base(bg='color1'), format='%d/%m/%Y %H:%M '),
powerline('dark', 'color1'),
]

View File

@ -0,0 +1,94 @@
# Justine Smithies
# https://github.com/justinesmithies/qtile-wayland-dotfiles
# Widgets setup
# Get the icons at https://www.nerdfonts.com/cheat-sheet
import psutil
import os
import subprocess
from libqtile import qtile
from libqtile import widget
from colors import *
from ordinaldate import custom_date
from keys import terminal
widget_defaults = dict(
font='UbuntuMono Nerd Font',
fontsize='14',
padding=1,
)
extension_defaults = widget_defaults.copy()
primary_widgets = [
widget.Spacer(length=10),
widget.GroupBox(
borderwidth=2,
inactive='969696',
this_current_screen_border='eee8d5',
this_screen_border='eee8d5',
font='FiraCode Nerd Font',
fontsize=14,
highlight_method='line',
highlight_color=['00000000', '00000000']
),
widget.CurrentLayoutIcon(scale=0.7),
widget.CurrentLayout(**widget_defaults),
widget.Spacer(length=320),
widget.GenPollText(
func=custom_date,
update_interval=1,
**widget_defaults,
mouse_callbacks={
'Button1': lambda: qtile.cmd_spawn(os.path.expanduser("~/.local/bin/statusbar/calendar.sh show"), shell=True),
'Button3': lambda: qtile.cmd_spawn(os.path.expanduser("~/.local/bin/statusbar/calendar.sh edit"), shell=True)
}
),
widget.Spacer(),
widget.CheckUpdates(
**widget_defaults,
update_interval=600,
distro='Arch_paru',
custom_command='~/.local/bin/statusbar/arch-updates.sh',
display_format='{updates}',
colour_have_updates=colors[2],
execute='kitty -e paru'
),
widget.Spacer(length=5),
widget.KeyboardLayout(configured_keyboards=['us', 'gb']),
widget.Spacer(length=5),
widget.GenPollText(update_interval=1, **widget_defaults, func=lambda: subprocess.check_output(os.path.expanduser("~/.local/bin/statusbar/brightnesscontrol")).decode(), mouse_callbacks={'Button1': lambda: qtile.cmd_spawn(os.path.expanduser("~/.local/bin/statusbar/brightnesscontrol down"), shell=True), 'Button3': lambda: qtile.cmd_spawn(os.path.expanduser("~/.local/bin/statusbar/brightnesscontrol up"), shell=True)}),
widget.Spacer(length=5),
widget.GenPollText(update_interval=1, **widget_defaults, func=lambda: subprocess.check_output(os.path.expanduser("~/.local/bin/statusbar/volumecontrol")).decode(), mouse_callbacks={'Button1': lambda: qtile.cmd_spawn(os.path.expanduser("~/.local/bin/statusbar/volumecontrol down"), shell=True), 'Button2': lambda: qtile.cmd_spawn(os.path.expanduser("~/.local/bin/statusbar/volumecontrol mute"), shell=True), 'Button3': lambda: qtile.cmd_spawn(os.path.expanduser("~/.local/bin/statusbar/volumecontrol up"), shell=True)}),
widget.Spacer(length=5),
widget.GenPollText(update_interval=1, **widget_defaults, func=lambda: subprocess.check_output(os.path.expanduser("~/.local/bin/statusbar/battery.py")).decode(), mouse_callbacks={'Button1': lambda: qtile.cmd_spawn(os.path.expanduser("~/.local/bin/statusbar/battery.py --c left-click"), shell=True)}),
widget.Spacer(length=5),
widget.GenPollText(update_interval=1, **widget_defaults, func=lambda: subprocess.check_output(os.path.expanduser("~/.local/bin/statusbar/network.sh")).decode(), mouse_callbacks={'Button1': lambda: qtile.cmd_spawn(os.path.expanduser("~/.local/bin/statusbar/network.sh ShowInfo"), shell=True), 'Button3': lambda: qtile.cmd_spawn(terminal + ' -e nmtui', shell=True)}),
widget.Spacer(length=10),
]
secondary_widgets = [
widget.GroupBox(
borderwidth=2,
inactive='969696',
this_current_screen_border='eee8d5',
this_screen_border='eee8d5',
font='FiraCode Nerd Font',
fontsize=14, highlight_method='line',
highlight_color=['00000000', '00000000']
),
widget.CurrentLayoutIcon(scale=0.7),
widget.CurrentLayout(**widget_defaults),
widget.Spacer(length=320),
widget.GenPollText(
func=custom_date,
update_interval=1,
**widget_defaults,
mouse_callbacks={
'Button1': lambda: qtile.cmd_spawn(os.path.expanduser("~/.local/bin/statusbar/calendar.sh show"), shell=True),
'Button3': lambda: qtile.cmd_spawn(os.path.expanduser("~/.local/bin/statusbar/calendar.sh edit"), shell=True)
}
),
widget.Spacer(),
]

View File

@ -0,0 +1,91 @@
# Justine Smithies
# https://github.com/justinesmithies/qtile-wayland-dotfiles
# Workspace setup
# Get the icons at https://www.nerdfonts.com/cheat-sheet
from libqtile.config import Match
workspaces = [
{
"name": "term",
"key": "1",
"matches": [
Match(wm_class='kitty'),
],
"layout": "monadtall",
"spawn": [],
},
{
"name": "www",
"key": "2",
"matches": [
Match(wm_class='firefox'),
],
"layout": "monadtall",
"spawn": [],
},
{
"name": "chat",
"key": "3",
"matches": [
Match(wm_class='telegram-desktop'),
],
"layout": "monadtall",
"spawn": [],
},
{
"name": "files",
"key": "4",
"matches": [
Match(wm_class='pcmanfm'),
],
"layout": "monadtall",
"spawn": [],
},
{
"name": "media",
"key": "5",
"matches": [
Match(wm_class='gimp-2.99'),
],
"layout": "monadtall",
"spawn": [],
},
{
"name": "game",
"key": "6",
"matches": [
Match(wm_class='steam'),
],
"layout": "monadtall",
"spawn": [],
},
{
"name": "mail",
"key": "7",
"matches": [
Match(wm_class='electronmail'),
],
"layout": "monadtall",
"spawn": [],
},
{
"name": "dev",
"key": "8",
"matches": [
Match(wm_class='nvim'),
],
"layout": "monadtall",
"spawn": [],
},
{
"name": "vm",
"key": "9",
"matches": [
Match(wm_class='virtualbox'),
],
"layout": "monadtall",
"spawn": [],
},
]

View File

@ -0,0 +1,56 @@
A theme consists of a simple json file. You can create your own by copying this
json object and changing values:
```json
{
"dark": [
"#0f101a",
"#0f101a"
],
"grey": [
"#353c4a",
"#353c4a"
],
"light": [
"#f1ffff",
"#f1ffff"
],
"text": [
"#0f101a",
"#0f101a"
],
"focus": [
"#a151d3",
"#a151d3"
],
"active": [
"#f1ffff",
"#f1ffff"
],
"inactive": [
"#4c566a",
"#4c566a"
],
"urgent": [
"#F07178",
"#F07178"
],
"color1": [
"#a151d3",
"#a151d3"
],
"color2": [
"#F07178",
"#F07178"
],
"color3": [
"#fb9f7f",
"#fb9f7f"
],
"color4": [
"#ffd47e",
"#ffd47e"
]
}
```

View File

@ -0,0 +1,54 @@
{
"dark": [
"#0f101a",
"#0f101a"
],
"grey": [
"#37383b",
"#37383b"
],
"light": [
"#f1ffff",
"#f1ffff"
],
"text": [
"#f1ffff",
"#f1ffff"
],
"focus": [
"#66818d",
"#66818d"
],
"active": [
"#f1ffff",
"#f1ffff"
],
"inactive": [
"#4c566a",
"#4c566a"
],
"urgent": [
"#3f575b",
"#3f575b"
],
"color1": [
"#0f101a",
"#0f101a"
],
"color2": [
"#334148",
"#334148"
],
"color3": [
"#3f575b",
"#3f575b"
],
"color4": [
"#556a74",
"#556a74"
],
"color5": [
"#556a74",
"#556a74"
]
}

View File

@ -0,0 +1,54 @@
{
"dark": [
"#292d3e",
"#292d3e"
],
"grey": [
"#434758",
"#434758"
],
"light": [
"#ffffff",
"#ffffff"
],
"text": [
"#292d3e",
"#292d3e"
],
"focus": [
"#A77AC4",
"#A77AC4"
],
"urgent": [
"#ff5555",
"#ff5555"
],
"active": [
"#f1ffff",
"#f1ffff"
],
"inactive": [
"#d3d3d3",
"#d3d3d3"
],
"color1": [
"#ff5555",
"#ff5555"
],
"color2": [
"#A77AC4",
"#A77AC4"
],
"color3": [
"#7197E7",
"#7197E7"
],
"color4": [
"#A77AC4",
"#A77AC4"
],
"color5": [
"#ffb86c",
"#ffb86c"
]
}

View File

@ -0,0 +1,54 @@
{
"dark": [
"#212121",
"#212121"
],
"grey": [
"#353c4a",
"#353c4a"
],
"light": [
"#f1ffff",
"#f1ffff"
],
"text": [
"#0f101a",
"#0f101a"
],
"focus": [
"#a151d3",
"#a151d3"
],
"active": [
"#f1ffff",
"#f1ffff"
],
"inactive": [
"#4c566a",
"#4c566a"
],
"urgent": [
"#F07178",
"#F07178"
],
"color1": [
"#a151d3",
"#a151d3"
],
"color2": [
"#F07178",
"#F07178"
],
"color3": [
"#fb9f7f",
"#fb9f7f"
],
"color4": [
"#ffd47e",
"#ffd47e"
],
"color5": [
"#ffd47e",
"#ffd47e"
]
}

View File

@ -0,0 +1,54 @@
{
"dark": [
"#0f101a",
"#0f101a"
],
"grey": [
"#353c4a",
"#353c4a"
],
"light": [
"#f1ffff",
"#f1ffff"
],
"text": [
"#0f101a",
"#0f101a"
],
"focus": [
"#a151d3",
"#a151d3"
],
"active": [
"#f1ffff",
"#f1ffff"
],
"inactive": [
"#4c566a",
"#4c566a"
],
"urgent": [
"#F07178",
"#F07178"
],
"color1": [
"#a151d3",
"#a151d3"
],
"color2": [
"#F07178",
"#F07178"
],
"color3": [
"#fb9f7f",
"#fb9f7f"
],
"color4": [
"#ffd47e",
"#ffd47e"
],
"color5": [
"#ffd47e",
"#ffd47e"
]
}

View File

@ -0,0 +1,54 @@
{
"dark": [
"#2d2a2e",
"#2d2a2e"
],
"grey": [
"#5a565b",
"#5a565b"
],
"light": [
"#ffffff",
"#ffffff"
],
"text": [
"#2d2a2e",
"#2d2a2e"
],
"focus": [
"#a9dc76",
"#a9dc76"
],
"active": [
"#ffffff",
"#ffffff"
],
"inactive": [
"#727072",
"#727072"
],
"urgent": [
"#ff6188",
"#ff6188"
],
"color1": [
"#a9dc76",
"#a9dc76"
],
"color2": [
"#ffd866",
"#ffd866"
],
"color3": [
"#ff6188",
"#ff6188"
],
"color4": [
"#ab9df2",
"#ab9df2"
],
"color5": [
"#ab9df2",
"#ab9df2"
]
}

View File

@ -0,0 +1,54 @@
{
"dark": [
"#212121",
"#212121"
],
"grey": [
"#ABB2BF",
"#ABB2BF"
],
"light": [
"#ffffff",
"#ffffff"
],
"text": [
"#212121",
"#212121"
],
"focus": [
"#81a1c1",
"#81a1c1"
],
"active": [
"#f1ffff",
"#f1ffff"
],
"inactive": [
"#4c566a",
"#4c566a"
],
"urgent": [
"#b48ead",
"#b48ead"
],
"color1": [
"#81a1c1",
"#81a1c1"
],
"color2": [
"#88c0d0",
"#88c0d0"
],
"color3": [
"#a3be8c",
"#a3be8c"
],
"color4": [
"#ebcb8b",
"#ebcb8b"
],
"color5": [
"#ebcb8b",
"#ebcb8b"
]
}

View File

@ -0,0 +1,54 @@
{
"dark": [
"#212121",
"#212121"
],
"grey": [
"#ABB2BF",
"#ABB2BF"
],
"light": [
"#ffffff",
"#ffffff"
],
"text": [
"#212121",
"#212121"
],
"focus": [
"#81a1c1",
"#81a1c1"
],
"active": [
"#f1ffff",
"#f1ffff"
],
"inactive": [
"#4c566a",
"#4c566a"
],
"urgent": [
"#b48ead",
"#b48ead"
],
"color1": [
"#81a1c1",
"#81a1c1"
],
"color2": [
"#88c0d0",
"#88c0d0"
],
"color3": [
"#a3be8c",
"#a3be8c"
],
"color4": [
"#ebcb8b",
"#ebcb8b"
],
"color5": [
"#ebcb8b",
"#ebcb8b"
]
}

View File

@ -0,0 +1,54 @@
{
"dark": [
"#1e2127",
"#1e2127"
],
"grey": [
"#ABB2BF",
"#ABB2BF"
],
"light": [
"#ffffff",
"#ffffff"
],
"text": [
"#282C34",
"#282C34"
],
"focus": [
"#61AFEF",
"#61AFEF"
],
"active": [
"#f1ffff",
"#f1ffff"
],
"inactive": [
"#4c566a",
"#4c566a"
],
"urgent": [
"#E06C75",
"#E06C75"
],
"color1": [
"#C678DD",
"#C678DD"
],
"color2": [
"#E06C75",
"#E06C75"
],
"color3": [
"#61AFEF",
"#61AFEF"
],
"color4": [
"#98C379",
"#98C379"
],
"color5": [
"#98C379",
"#98C379"
]
}

View File

@ -0,0 +1,54 @@
{
"dark": [
"#1f1d29",
"#1f1d29"
],
"grey": [
"#ABB2BF",
"#ABB2BF"
],
"light": [
"#ffffff",
"#ffffff"
],
"text": [
"#1f1d29",
"#1f1d29"
],
"focus": [
"#eabbb9",
"#eabbb9"
],
"active": [
"#f1ffff",
"#f1ffff"
],
"inactive": [
"#4c566a",
"#4c566a"
],
"urgent": [
"#ea6f91",
"#ea6f91"
],
"color1": [
"#eabbb9",
"#eabbb9"
],
"color2": [
"#f1ca93",
"#f1ca93"
],
"color3": [
"#9bced7",
"#9bced7"
],
"color4": [
"#ea6f91",
"#ea6f91"
],
"color5": [
"#ea6f91",
"#ea6f91"
]
}

View File

@ -55,7 +55,7 @@ dotfiles - My tiling Qtile, spectrwm, i3 & sway configurations (for Arch/Devuan/
sway swaybg swayidle wlr-randr wdisplays wofi meson waybar wl-clipboard \ sway swaybg swayidle wlr-randr wdisplays wofi meson waybar wl-clipboard \
wayland-protocols libwlroots6 libcairo2 libpango-1.0-0 libgdk-pixbuf2.0-0 \ wayland-protocols libwlroots6 libcairo2 libpango-1.0-0 libgdk-pixbuf2.0-0 \
libpcre++0v5 libjson-c5 xwayland libwayland-egl1-mesa libwayland-bin \ libpcre++0v5 libjson-c5 xwayland libwayland-egl1-mesa libwayland-bin \
xdg-desktop-portal-wlr wf-recorder weston xdg-desktop-portal-wlr wf-recorder weston grim
```` ````
```shell ```shell