Dotfiles config update (2022-04-23)

This commit is contained in:
q3aql 2022-04-23 21:36:03 +02:00
parent 34f46e2ed6
commit 9dc4edd23f
24 changed files with 1007 additions and 0 deletions

25
.config/qtile/autostart.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/sh
# Network applet
#connman-gtk --tray &
nm-applet
# Applet for Audio
pnmixer -t &
# Configure screens and resolution
~/.config/qtile/startxrandr.sh &
# Load compton or picom
#compton &
#sleep 15 && picom &
# Configure wallpaper
sleep 3 && nitrogen --head=0 --set-scaled ~/wallpapers/archlinux2.jpg
nitrogen --head=1 --set-zoom-fill ~/wallpapers/archlinux2.jpg
# Configure screensaver
~/.config/i3/startscreensaver.sh &
# Clipboard (Diodon)
diodon &

View File

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

36
.config/qtile/config.py Normal file
View File

@ -0,0 +1,36 @@
# Qtile Config File
# http://www.qtile.org/
# Antonio Sarosi
# https://youtube.com/c/antoniosarosi
# https://github.com/antoniosarosi/dotfiles
from libqtile import hook
from settings.keys import mod, keys
from settings.groups import groups
from settings.layouts import layouts, floating_layout
from settings.widgets import widget_defaults, extension_defaults
from settings.screens import screens
from settings.mouse import mouse
from settings.path import qtile_path
from os import path
import subprocess
@hook.subscribe.startup_once
def autostart():
subprocess.call([path.join(qtile_path, 'autostart.sh')])
main = None
dgroups_key_binder = None
dgroups_app_rules = []
follow_mouse_focus = True
bring_front_click = False
cursor_warp = True
auto_fullscreen = False
focus_on_window_activation = 'urgent'
wmname = 'LG3D'

View File

View File

@ -0,0 +1,38 @@
# Antonio Sarosi
# https://youtube.com/c/antoniosarosi
# https://github.com/antoniosarosi/dotfiles
# Qtile workspaces
from libqtile.config import Key, Group
from libqtile.command import lazy
from .keys import mod, keys
# Get the icons at https://www.nerdfonts.com/cheat-sheet (you need a Nerd Font)
# Icons:
# nf-fa-firefox,
# nf-fae-python,
# nf-dev-terminal,
# nf-fa-code,
# nf-oct-git_merge,
# nf-linux-docker,
# nf-mdi-image,
# nf-mdi-layers
#groups = [Group(i) for i in [
# "  ", "  ", "  ", "  ", "  ", "  ", "  ", "  ", "  ",
#]]
groups = [Group(i) for i in [
"term", "www", "chat", "files", "media", "game", "mail", "dev", "vm",
]]
for i, group in enumerate(groups):
actual_key = str(i + 1)
keys.extend([
# Switch to workspace N
Key([mod], actual_key, lazy.group[group.name].toscreen()),
# Send window to workspace N
Key([mod, "shift"], actual_key, lazy.window.togroup(group.name))
])

View File

@ -0,0 +1,93 @@
# Antonio Sarosi
# https://youtube.com/c/antoniosarosi
# https://github.com/antoniosarosi/dotfiles
# Qtile keybindings
from libqtile.config import Key
from libqtile.command import lazy
mod = "mod4"
keys = [Key(key[0], key[1], *key[2:]) for key in [
# ------------ Window Configs ------------
# Switch between windows in current stack pane
([mod], "j", lazy.layout.down()),
([mod], "k", lazy.layout.up()),
([mod], "h", lazy.layout.left()),
([mod], "l", lazy.layout.right()),
# Change window sizes (MonadTall)
([mod, "shift"], "l", lazy.layout.grow()),
([mod, "shift"], "h", lazy.layout.shrink()),
# Toggle floating
([mod, "shift"], "f", lazy.window.toggle_floating()),
# Move windows up or down in current stack
([mod, "shift"], "j", lazy.layout.shuffle_down()),
([mod, "shift"], "k", lazy.layout.shuffle_up()),
# Toggle between different layouts as defined below
([mod], "Tab", lazy.next_layout()),
([mod, "shift"], "Tab", lazy.prev_layout()),
# Kill window
#([mod], "w", lazy.window.kill()),
([mod, "shift"], "q", lazy.window.kill()),
# Switch focus of monitors
([mod], "period", lazy.next_screen()),
([mod], "comma", lazy.prev_screen()),
# Restart Qtile
#([mod, "control"], "r", lazy.restart()),
([mod, "shift"], "r", lazy.restart()),
([mod, "control"], "q", lazy.shutdown()),
([mod], "r", lazy.spawncmd()),
# ------------ App Configs ------------
([mod], "o", lazy.spawn("rofi -show drun")),
([mod], "p", lazy.spawn("rofi -show run")),
([mod, "shift"], "w", lazy.spawn("rofi -show")),
([mod], "b", lazy.spawn("firefox")),
([mod], "n", lazy.spawn("pcmanfm")),
([mod], "g", lazy.spawn("geany")),
([mod], "m", lazy.spawn("telegram")),
([mod], "z", lazy.spawn("nitrogen")),
([mod], "u", lazy.spawn("xterm")),
([mod], "t", lazy.spawn("rofi-theme-selector")),
([mod], "i", lazy.spawn("lxappearance")),
# Terminal
([mod], "Return", lazy.spawn("kitty")),
# Redshift
#([mod], "r", lazy.spawn("redshift -O 2400")),
#([mod, "shift"], "r", lazy.spawn("redshift -x")),
# Screenshot
([mod], "s", lazy.spawn("xfce4-screenshooter")),
([mod, "shift"], "s", lazy.spawn("scrot -s")),
# ------------ Hardware Configs ------------
# Volume
([], "XF86AudioLowerVolume", lazy.spawn(
"pactl set-sink-volume @DEFAULT_SINK@ -5%"
)),
([], "XF86AudioRaiseVolume", lazy.spawn(
"pactl set-sink-volume @DEFAULT_SINK@ +5%"
)),
([], "XF86AudioMute", lazy.spawn(
"pactl set-sink-mute @DEFAULT_SINK@ toggle"
)),
# Brightness
([], "XF86MonBrightnessUp", lazy.spawn("brightnessctl set +10%")),
([], "XF86MonBrightnessDown", lazy.spawn("brightnessctl set 10%-")),
]]

View File

@ -0,0 +1,43 @@
# Antonio Sarosi
# https://youtube.com/c/antoniosarosi
# https://github.com/antoniosarosi/dotfiles
from libqtile import layout
from libqtile.config import Match
from .theme import colors
# Layouts and layout rules
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.Max(),
# layout.Columns(),
# layout.Tile(),
# layout.TreeTab(),
# layout.VerticalTile(),
# layout.Zoomy(),
]
floating_layout = layout.Floating(
float_rules=[
*layout.Floating.default_float_rules,
Match(wm_class='confirmreset'),
Match(wm_class='makebranch'),
Match(wm_class='maketag'),
Match(wm_class='ssh-askpass'),
Match(title='branchdialog'),
Match(title='pinentry'),
],
border_focus=colors["color4"][0]
)

View File

@ -0,0 +1,20 @@
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,3 @@
from os import path
qtile_path = path.join(path.expanduser('~'), ".config", "qtile")

View File

@ -0,0 +1,38 @@
# Antonio Sarosi
# https://youtube.com/c/antoniosarosi
# https://github.com/antoniosarosi/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, opacity=0.92)
screens = [Screen(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"))
if connected_monitors > 1:
for _ in range(1, connected_monitors):
screens.append(Screen(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,132 @@
from libqtile import widget
from .theme import colors
# Get the icons at https://www.nerdfonts.com/cheat-sheet (you need a Nerd Font)
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
)
def workspaces():
return [
separator(),
widget.GroupBox(
**base(fg='light'),
font='UbuntuMono Nerd Font',
fontsize=16,
#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(),
]
primary_widgets = [
*workspaces(),
separator(),
powerline('color4', 'dark'),
icon(bg="color4", text=''), # Icon: nf-fa-download
widget.CheckUpdates(
background=colors['color4'],
colour_have_updates=colors['text'],
colour_no_updates=colors['text'],
no_update_string='0',
display_format='{updates}',
update_interval=1800,
custom_command='checkupdates',
),
powerline('color3', 'color4'),
icon(bg="color3", text=''), # Icon: nf-fa-feed
widget.Net(**base(bg='color3'), interface='wlan0'),
powerline('color2', 'color3'),
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('color1', 'dark'),
widget.CurrentLayoutIcon(**base(bg='color1'), scale=0.65),
widget.CurrentLayout(**base(bg='color1'), padding=5),
powerline('color2', 'color1'),
widget.Clock(**base(bg='color2'), format='%d/%m/%Y - %H:%M '),
powerline('dark', 'color2'),
]
widget_defaults = {
'font': 'UbuntuMono Nerd Font Bold',
'fontsize': 14,
'padding': 1,
}
extension_defaults = widget_defaults.copy()

View File

@ -0,0 +1,19 @@
#!/bin/bash
# Basic configuration variables
ScreensaverProgram="xautolock" # Options: xautolock or xscreensaver
ScreensaverTime="20" # 20 minutes (only for xautolock)
# Init screensaver
sleep 5
if [ "${ScreensaverProgram}" == "xautolock" ] ; then
echo "Using 'xautolock' as screensaver program"
xautolock -time ${ScreensaverTime} -locker "xset dpms force off"
elif [ "${ScreensaverProgram}" == "xscreensaver" ] ; then
echo "Using 'xscreensaver' as screensaver program"
xscreensaver &
else
echo "Using 'xautolock' as screensaver program"
xautolock -time ${ScreensaverTime} -locker "xset dpms force off"
fi

18
.config/qtile/startxrandr.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
scan_rel=0
sleep 2
while [ ${scan_rel} -eq 0 ] ; do
# Primer monitor
xrandr --output DP-1 --mode 1920x1200 -r 59.95
xrandr --output DisplayPort-0 --mode 1920x1200 -r 59.95
# Segundo monitor
xrandr --output DP-2 --mode 1280x1024 -r 75.02 --rotate left --right-of DP-1
xrandr --output DisplayPort-1 --mode 1280x1024 -r 75.02 --rotate left --right-of DisplayPort-0
#xrandr --output DisplayPort-1 --mode 1280x1024 -r 75.02 --scale 1.1x1.1 --rotate left --right-of DisplayPort-0
sleep 2
done
#sleep 2
#xrandr --output DisplayPort-0 --mode 1280x1024 -r 75.02
#xrandr --output DisplayPort-1 --mode 1280x1024 -r 75.02 --rotate left --right-of DisplayPort-0

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,50 @@
{
"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"
]
}

View File

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

View File

@ -0,0 +1,50 @@
{
"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"
]
}

View File

@ -0,0 +1,50 @@
{
"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,50 @@
{
"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"
]
}

View File

@ -0,0 +1,50 @@
{
"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"
]
}

View File

@ -0,0 +1,50 @@
{
"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"
]
}

View File

@ -0,0 +1,50 @@
{
"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"
]
}

View File

@ -0,0 +1,50 @@
{
"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"
]
}