Massive change to the structure of the tree.

This commit is contained in:
Bartek Stalewski 2025-03-10 23:59:38 +01:00
parent 2fc5f7a514
commit c71934ed3b
No known key found for this signature in database
137 changed files with 51 additions and 266 deletions

View file

@ -0,0 +1,51 @@
[main]
font=Roboto Mono:style=Medium:pixelsize=14, Noto Color Emoji:style=Regular:pixelsize=14
font-size-adjustment=5px
pad=5x5
selection-target=clipboard
term=xterm-256color
line-height=17px
[bell]
urgent=yes
[colors]
0=272822
1=fd4285
2=a6e22d
3=e5da72
4=00bdff
5=9a37ff
6=50b6d8
7=c7c7c7
8=676767
9=fa7fac
10=bde271
11=fff27f
12=0094d8
13=bd9eff
14=5ed6fe
15=feffff
alpha=1.0
background=272822
foreground=c7c7c7
[cursor]
style=beam
[key-bindings]
clipboard-paste=Control+Shift+v Shift+Insert
primary-paste=none
search-start=Control+f
show-urls-launch=Control+o
[mouse]
hide-when-typing=yes
[mouse-bindings]
clipboard-paste=BTN_MIDDLE
primary-paste=none
[search-bindings]
find-prev=Control+p
find-next=Control+n

View file

@ -0,0 +1,3 @@
[manual]
lat=52.39
lon=16.99

View file

@ -0,0 +1,3 @@
[Settings]
gtk-recent-files-max-age=0
gtk-recent-files-limit=0

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,11 @@
import os
import re
import subprocess
from libqtile import bar, extension, hook, layout, qtile
from libqtile.backend.wayland import InputConfig
from libqtile.config import Click, Drag, Group, Key, KeyChord, Match, Screen
from libqtile.lazy import lazy
from libqtile.utils import guess_terminal
from qtile_extras import widget
mod = "mod4"

View file

@ -0,0 +1,208 @@
from common import *
os.environ["MOZ_DBUS_REMOTE"] = "1"
os.environ["XDG_CURRENT_DESKTOP"] = "qtile:wlroots"
widget_defaults = dict(
background='#272822',
font='Roboto Mono Medium',
fontsize=14,
foreground='#feffff',
)
extension_defaults = widget_defaults.copy()
# see examples/custom.py for example custom file
custom_file=os.getenv('XDG_CONFIG_HOME') + '/qtile/custom.py'
if os.path.exists(custom_file):
from custom import groups, keys, screens, wl_input_rules
else:
terminal = guess_terminal()
keys = [
# app binds
Key([mod], "Return", lazy.spawn(terminal)),
Key([mod], "space", lazy.spawncmd()),
Key([mod], "e", lazy.spawn("selector-chars")),
Key([mod, "control"], "a", lazy.spawn("selector-audio")),
]
groups = [
Group("1", label="1"),
Group("2", label="2"),
Group("3", label="3"),
Group("4", label="4"),
Group("5", label="5"),
Group("6", label="6"),
Group("7", label="7"),
Group("8", label="8"),
Group("9", label="9"),
Group("0", label="10"),
]
screens = [
Screen(
top=bar.Bar(
[
widget.GroupBox(
active='#feffff',
disable_drag=True,
font="Font Awesome 6 Free",
highlight_color='#272822',
highlight_method='block',
mouse_callbacks={"Button1": lambda: None},
rounded=False,
this_current_screen_border='#0094d8',
urgent_alert_method='block',
urgent_border='#770000',
use_mouse_wheel=False,
),
widget.Prompt(
bell_style=None,
prompt='open: ',
record_history=False,
),
widget.Spacer(),
widget.Notify(
foreground='#000000',
background='#e8b923',
foreground_low='#c7c7c7',
background_low='#272822',
foreground_urgent='#feffff',
background_urgent='#770000',
),
widget.GenPollCommand(
foreground='#feffff',
background='#770000',
update_interval=1,
cmd="sb-volume",
),
widget.GenPollCommand(
foreground='#feffff',
background='#770000',
update_interval=1,
cmd="sb-wireguard",
),
widget.Wlan(
foreground='#feffff',
background='#770000',
format='',
disconnected_message="no wifi",
),
widget.GenPollCommand(
update_interval=1,
cmd="sb-battery",
),
widget.Clock(
format='[%d] %H:%M:%S',
),
widget.StatusNotifier(),
],
24,
margin=[5, 5, 0, 5]
),
wallpaper=os.getenv('XDG_CONFIG_HOME') + '/qtile/wallpaper.img',
wallpaper_mode='fill',
),
]
wl_input_rules = {}
@hook.subscribe.startup_once
def autostart():
# see examples/autostart.sh
autostart=os.getenv('XDG_CONFIG_HOME') + '/qtile/autostart.sh'
subprocess.run([autostart])
@hook.subscribe.shutdown
def autostop():
# see examples/autostop.sh
autostop=os.getenv('XDG_CONFIG_HOME') + '/qtile/autostop.sh'
subprocess.run([autostop])
keys.extend([
# switch between windows
Key([mod], "h", lazy.layout.left()),
Key([mod], "l", lazy.layout.right()),
Key([mod], "j", lazy.layout.down()),
Key([mod], "k", lazy.layout.up()),
Key([mod], "Left", lazy.layout.left()),
Key([mod], "Right", lazy.layout.right()),
Key([mod], "Down", lazy.layout.down()),
Key([mod], "Up", lazy.layout.up()),
# move windows
Key([mod, "control"], "h", lazy.layout.shuffle_left()),
Key([mod, "control"], "l", lazy.layout.shuffle_right()),
Key([mod, "control"], "j", lazy.layout.shuffle_down()),
Key([mod, "control"], "k", lazy.layout.shuffle_up()),
# resize windows
Key([mod, "shift"], "h", lazy.layout.grow_left()),
Key([mod, "shift"], "l", lazy.layout.grow_right()),
Key([mod, "shift"], "j", lazy.layout.grow_down()),
Key([mod, "shift"], "k", lazy.layout.grow_up()),
Key([mod, "shift", "control"], "0", lazy.layout.normalize()),
# WM control
Key([mod], "f", lazy.window.toggle_floating()),
Key([mod], "q", lazy.window.kill()),
Key([mod, "control", "shift"], "q", lazy.shutdown()),
Key([mod, "control", "shift"], "r", lazy.reload_config()),
Key([mod], "r", lazy.reload_config()),
# media keys
Key([], "XF86AudioMute", lazy.spawn("pactl set-sink-mute @DEFAULT_SINK@ toggle")),
Key([], "XF86AudioMicMute", lazy.spawn("sb-volume micmute")),
Key([], "XF86AudioRaiseVolume", lazy.spawn("sb-volume inc")),
Key([], "XF86AudioLowerVolume", lazy.spawn("sb-volume dec")),
Key([], "XF86MonBrightnessUp", lazy.spawn("doas xbacklight -inc 10")),
Key([], "XF86MonBrightnessDown", lazy.spawn("doas xbacklight -dec 10")),
])
for i in groups[:10]:
keys.extend([
Key(
[mod], i.name, lazy.group[i.name].toscreen(),
desc="Switch to group {}".format(i.name),
),
Key([mod, "shift"], i.name, lazy.window.togroup(i.name),
desc="move focused window to group {}".format(i.name)
),
])
if qtile.core.name == "wayland":
for i in range(1,2):
keys.extend([
Key(["control", "mod1"], f"f{i}", lazy.core.change_vt(i), desc=f"Switch to VT{i}")
])
layouts = [
layout.Columns(
border_focus='#0094d8',
border_normal="#272822",
border_on_single = False,
border_width=5,
insert_position=1,
margin=[5, 5, 5, 5]
),
]
floating_layout = layout.Floating(
float_rules=[
*layout.Floating.default_float_rules,
Match(title="File Upload"),
Match(title="Open File"),
Match(title="Open file"),
Match(title="Open Files"),
Match(title="Firefox — Sharing Indicator"),
Match(title="Enter name of file to save to…"),
Match(title="Save Image"),
Match(wm_class="authenticator"),
Match(wm_class="bluetuith"),
Match(wm_class="xdg-desktop-portal-gtk")
],
border_focus='#0094d8',
border_normal="#272822",
border_width=5,
)
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()),
]
focus_on_window_activation = "urgent"
wmname = "qtile"

View file

@ -0,0 +1,2 @@
#!/bin/sh
firefox &

View file

@ -0,0 +1,3 @@
#!/bin/sh
# be sure that processes quit with qtile
killall -9 firefox

View file

@ -0,0 +1,25 @@
from common import *
groups = [
# use icon as group's label - for more icons visit https://fontawesome.com/icons
Group("1", label="\uf292"),
# match window class to a group
Group("2", label="\ue007", matches=[Match(wm_class=["Firefox"])]),
]
keys = [
# example key binding for running a command
Key([mod], "f", lazy.spawn("firefox")),
# example keychord
KeyChord([mod], "Comma", [
Key([], "f", lazy.spawn("firefox")),
])
]
# example input rules for Wayland
wl_input_rules = {
"type:pointer": InputConfig(natural_scroll=True),
"type:touchpad": InputConfig(tap=True,natural_scroll=True),
"type:keyboard": InputConfig(kb_layout="pl",kb_repeat_delay=280,kb_repeat_rate=30),
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 712 KiB

View file

@ -0,0 +1,2 @@
[preferred]
default=gtk

View file

@ -0,0 +1,17 @@
#!/bin/bash
for battery in /sys/class/power_supply/BAT?*; do
# If non-first battery, print a space separator.
[ -n "${capacity+x}" ] && printf " "
# Sets up the status and capacity
case "$(cat "$battery/status")" in
"Full") status="\uf102" ;;
"Discharging") status="\uf063" ;;
"Charging") status="\uf062" ;;
"Not charging") status="\uf444"; exit 0 ;;
"Unknown") status="\uf128" ;;
esac
capacity=$(cat "$battery/capacity")
# Will make a warn variable if discharging and low
[ "$capacity" -le 20 ] && printf "<span background='#770000' foreground='#ffffff'>${status} ${capacity}%%</span>" || printf "${status} ${capacity}%%"
done && exit 0

View file

@ -0,0 +1,37 @@
#!/bin/bash
key_micmute() {
state=$(pactl get-source-mute @DEFAULT_SOURCE@ | awk -F': ' '{print $2}')
case ${state} in
yes)
echo 1 | doas tee /sys/devices/platform/thinkpad_acpi/leds/platform::micmute/brightness
pactl set-source-mute @DEFAULT_SOURCE@ 0 ;;
no)
echo 0 | doas tee /sys/devices/platform/thinkpad_acpi/leds/platform::micmute/brightness
pactl set-source-mute @DEFAULT_SOURCE@ 1 ;;
esac
}
vol_decrease() {
pactl set-sink-volume @DEFAULT_SINK@ -5%
volume=$(pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | awk -F' / *' '{print $2}')
notify-send -t 2000 -u low "volume: $volume"
}
vol_increase() {
pactl set-sink-volume @DEFAULT_SINK@ +5%
volume=$(pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | awk -F' / *' '{print $2}')
notify-send -t 2000 -u low "volume: $volume"
}
if [ $1 ]; then
case $1 in
dec) vol_decrease ;;
inc) vol_increase ;;
micmute) key_micmute ;;
esac
else
vol=$(pactl get-sink-volume @DEFAULT_SINK@ | awk -F' / ' '{print $2}' | tr -d '%')
[ $(pactl get-sink-mute @DEFAULT_SINK@ | awk -F': ' '{print $2}') = yes ] || [ "$vol" -eq 0 ] && mute="audio muted" || mute=""
[ $(pactl get-source-mute @DEFAULT_SOURCE@ | awk -F': ' '{print $2}') = no ] && printf "${mute} mic unmuted" || printf "${mute}"
fi

View file

@ -0,0 +1,7 @@
#!/bin/bash
interface=$(ip a | grep 'wg[0-9]:' | awk -F': ' '{print $2}')
case $interface in
wg0) printf 'wireguard running' ;;
wg1) printf 'wireguard running (all traffic)' ;;
esac

View file

@ -0,0 +1,65 @@
#!/bin/sh
div="---"
set_output() {
sel_sink=$(printf "$sinks\\n$div\\nback\\n$div\\nexit" | wofi -G --dmenu -i -p "select output device")
case "$sel_sink" in
back) show_current ;;
exit) exit ;;
*) pactl set-default-sink $(pactl list sinks | grep -B 1 "$sel_sink" | awk -F': ' '/Name:/ {print $2}') ;;
esac
#kill -46 $(pidof dwmblocks)
show_current
}
set_input() {
sel_source=$(printf "$sources\\n$div\\nbluetooth profile\\n$div\\nback\\n$div\\nexit" | wofi -G --dmenu -i -p "select input device")
case "$sel_source" in
back) show_current ;;
exit) exit ;;
bluetooth*) set_bt_profile ;;
*) pactl set-default-source "$(pactl list sources | grep -B 1 "$sel_source" | awk -F': ' '/Name:/ {print $2}')" ;;
esac
#kill -46 $(pidof dwmblocks)
show_current
}
set_bt_profile() {
bt_sink=$(pactl list cards | awk -F'"' '/device.name.*bluez/ {print $2}')
[ -z "${bt_sink}" ] &&
{ notify-send -t 2000 -u critical "ﳌ no headphones connected"; exit; }
profile_chosen=$(printf "profile mSBC\\nprofile LDAC\\n$div\\nback\\nexit" | wofi -G --dmenu -i -p "select bluettoth profile")
case "$profile_chosen" in
back) show_current ;;
exit) exit ;;
profile*mSBC) pactl set-card-profile $bt_sink headset-head-unit-msbc
pactl set-default-source $(pactl list sources short | awk '/bluez_input/ {print $2}') ;;
profile*LDAC) pactl set-card-profile $bt_sink a2dp-sink-ldac ;;
*) show_current ;;
esac
pactl set-default
}
show_current() {
def_snk=$(pactl list | grep -A 1 "Name: $(pactl get-default-sink)\$" | awk -F': ' '/Description: / {print $2}')
def_src=$(pactl list | grep -A 1 "Name: $(pactl get-default-source)\$" | awk -F': ' '/Description: / {print $2}')
chosen=$(printf "output: $def_snk\\ninput: $def_src" | wofi -G --dmenu -i -p "current audio devices")
if [ "$1" = "no_switch" ]; then
case "$chosen" in
*) notify-send -t 2000 -u critical "婢 no device to switch" ;;
esac
else
case "$chosen" in
output*) set_output ;;
input*) set_input ;;
esac
fi
}
sinks=$(pactl list sinks | awk -F': ' '/Description:/ {print $2}')
sources=$(pactl list sources | grep -v 'Monitor of ' | awk -F': ' '/Description:/ {print $2}')
[ "$(echo "$sinks" | wc -l)" -lt 2 ] &&
{ show_current no_switch; exit; }
show_current

View file

@ -0,0 +1,11 @@
#!/bin/sh
chosen=$(cut -d ';' -f1 $XDG_CONFIG_HOME/qtile/chars/* | wofi -G --dmenu -i -p "select character to copy" | sed "s/ .*//")
[ -z "$chosen" ] && exit
if [ -n "$1" ]; then
xdotool type "$chosen"
else
printf "$chosen" | wl-copy -n
notify-send -t 2000 "'$chosen' copied to clipboard" &
fi