Compare commits

..

88 commits

Author SHA1 Message Date
eeleater
1f5a43ca19 updated sheldon 2024-08-12 18:55:50 +02:00
eeleater
5f6cae6e9c chose only one theme 2024-08-08 06:01:41 +02:00
eeleater
79258c6b4e keychain has errors on wsl, replace with ssh-agent plugin 2024-07-26 09:50:41 +02:00
eeleater
76c089042e added clamav to skip list for topgrade 2024-07-19 09:42:42 +02:00
Nikolas Weger
d4c20a4ba8 added redis history file 2024-06-13 12:41:21 +02:00
eeleater
b872253463 fixed fzf ohmyzsh error 2024-04-21 20:34:30 +02:00
Nikolas Weger
0c4d030803 lightened startup banners somewhat 2024-04-17 03:15:41 +02:00
eeleater
f8cef3eade updated config a bit 2024-04-15 23:41:26 +02:00
Nikolas Weger
0f28405845 fixed config 2024-04-15 23:37:22 +02:00
Nikolas Weger
663a07e085 fixed config 2024-04-14 21:56:33 +02:00
eeleater
890c746657 updated config a bit 2024-04-13 15:52:06 +02:00
Nikolas Weger
3afad1aa37 new alacritty config 2024-02-21 10:38:14 +01:00
Nikolas Weger
fb751b70e3 added paths.zsh (still to be changed) 2024-02-14 13:11:55 +01:00
Nikolas Weger
4047ef1a48 updated bofh excuses 2024-02-05 17:22:49 +01:00
eeleater
4c2a47d783 eza tempfix 2024-02-05 16:04:54 +00:00
Nikolas Weger
2c7892693a updated sheldon config to newest 2024-01-25 09:52:20 +01:00
Nikolas Weger
80ff719697 newest version of dotfiles 2023-12-20 11:48:11 +01:00
Nikolas Weger
1aec940d37 newest version of dotfiles 2023-12-20 11:46:01 +01:00
eeleater
56423251cb updated the oh-my-posh install script 2023-12-19 23:59:27 +01:00
Nikolas Weger
01b4312f56 newest version of dotfiles 2023-12-19 13:29:52 +01:00
Nikolas Weger
eddf9cf3e3 newest version of dotfiles 2023-12-19 13:29:39 +01:00
Nikolas Weger
9fcd3f7ef1 oh-my-posh is now installed to .local/bin everywhere 2023-12-19 13:24:33 +01:00
Nikolas Weger
a962ecfd40 Merge branch 'sheldon' of git.eeleater.org:eeleater/dotfiles into sheldon 2023-12-19 13:09:19 +01:00
Nikolas Weger
95d6c35a7a oh-my-posh is now installed to .local/bin everywhere 2023-12-19 13:09:11 +01:00
eeleater
c5a7c5a1d0 Delete .chezmoiexternal.toml 2023-12-19 12:01:04 +00:00
Nikolas Weger
89fa7f2b74 added flatpak dirs to cdg data dirs 2023-12-17 16:06:30 +01:00
Nikolas Weger
6481f6f8c9 fixed a missing doublequote 2023-12-07 21:08:26 +01:00
Nikolas Weger
21b19c6af3 added some options 2023-12-07 21:07:12 +01:00
Nikolas Weger
1ccd0fc90b changed around the path stuff a bit 2023-12-07 12:55:52 +01:00
Nikolas Weger
2e55c7385a added local source file overrides 2023-12-01 10:51:18 +01:00
Nikolas Weger
54709c58e0 shuffled some stuff around 2023-11-27 08:39:55 +01:00
Nikolas Weger
9f7297bda5 added new config for rustup folder 2023-11-21 11:35:06 +01:00
Nikolas Weger
282553bef3 temp fix for eza ls alias removed 2023-11-21 07:47:47 +01:00
Nikolas Weger
5136049781 temp fix for eza ls alias 2023-11-14 08:40:38 +01:00
Nikolas Weger
288f93e008 new kitty theme 2023-10-27 19:41:35 +02:00
Nikolas Weger
8330480496 fixed ohmyposh mangling atuin 2023-10-27 19:41:01 +02:00
eeleater
efca7fa0fb Update topgrade.toml 2023-10-24 08:19:53 +00:00
Nikolas Weger
0eaba62689 changed topgrade config 2023-10-10 14:50:07 +02:00
eeleater
4587669215 Update .chezmoiexternal.toml 2023-10-06 04:26:50 +00:00
eeleater
3e98433d86 updated sheldon 2023-10-05 15:27:52 +02:00
eeleater
37b56e59cf updated sheldon 2023-10-05 15:14:56 +02:00
eeleater
0c2254786b another update to zshrc 2023-10-05 14:59:45 +02:00
eeleater
d5fb522b19 stuffeth and thingeth 2023-10-05 14:21:29 +02:00
eeleater
4c5d377fef exa is apparently eol, using eza now 2023-09-10 23:35:31 +02:00
eeleater
87d4766ca8 fixed joke to use system curl 2023-08-10 00:59:04 +02:00
Nikolas Weger
08330d55f8 changed layout of joke stuff 2023-08-02 08:26:04 +02:00
Nikolas Weger
cf8cc236c7 changed layout of joke stuff 2023-08-02 08:23:25 +02:00
eeleater
fc94e2be0f Update topgrade.toml 2023-07-28 09:41:40 +00:00
eeleater
e6b5cb2c6d Update topgrade.toml 2023-07-28 09:39:42 +00:00
Nikolas Weger
0a9f8af60c changed layout of joke stuff 2023-07-18 12:20:27 +02:00
Nikolas Weger
a4e21a6b17 changed kitty config 2023-07-11 11:53:39 +02:00
eeleater
bdf344026f fixed topgrade config 2023-07-08 12:00:10 +02:00
Nikolas Weger
cf6e3e3d50 changed kitty config 2023-07-07 10:41:57 +02:00
Nikolas Weger
f77cf782a7 updated sheldon zsh config 2023-06-20 11:59:34 +02:00
Nikolas Weger
0084e63150 updated sheldon zsh config 2023-06-20 11:26:13 +02:00
Nikolas Weger
0d384685b9 updated sheldon zsh config 2023-05-17 14:49:50 +02:00
Nikolas Weger
6b7cca2168 updated sheldon zsh config 2023-05-12 09:23:17 +02:00
Nikolas Weger
011d8586ae updated sheldon zsh config 2023-05-05 15:03:09 +02:00
Nikolas Weger
be19ff3306 Update .config/topgrade.toml 2023-05-05 14:59:16 +02:00
Nikolas Weger
a24f7fef97 Update .config/sheldon/plugins.toml
Update .config/topgrade.toml
Update .config/zsh/files/sshcomp.zsh
2023-05-05 11:21:18 +02:00
Nikolas Weger
5b8b457d3c updated sheldon zsh config 2023-05-02 10:01:13 +02:00
94ef22b629 moved env.zsh to private repo 2023-05-02 00:22:27 +02:00
c601e75465 moved env.zsh to private repo 2023-05-02 00:17:03 +02:00
36cfc43948 moved env.zsh to private repo 2023-05-02 00:12:36 +02:00
8f593feffb Update .config/sheldon/plugins.toml
Add .config/topgrade.toml
Update .config/zsh/env.zsh
Update .config/zsh/files/evalstuff.zsh
Update .config/zsh/profile.zsh
Update .config/zsh/rc.zsh
2023-04-27 08:11:58 +02:00
c9a5fad96c Update .config/zsh/env.zsh
Update .config/zsh/rc.zsh
2023-04-18 11:54:19 +02:00
173be71c46 Update .config/kitty/kitty.conf
Add .config/kitty/themes/embark.conf
Add .config/kitty/themes/penumbra.conf
Update .config/zsh/env.zsh
2023-04-17 08:15:41 +02:00
c613de4753 Update .local/share/zsh/env.zsh 2023-04-13 09:35:21 +02:00
68f100963b Add .local/share/zsh/env.zsh.age 2023-03-11 20:35:24 +01:00
f3b70106b6 Remove .local/share/zsh/env.zsh.age 2023-03-11 20:33:37 +01:00
91fd40cfce Update .config/kitty/current-theme.conf
Update .config/kitty/kitty.conf
2023-03-09 11:52:03 +01:00
91fb60fbaf add file back 2023-03-08 15:21:09 +01:00
61c509bf7f Add .config/zsh-abbr/user-abbreviations
Update .config/zsh/env.zsh
Update .config/zsh/files/evalstuff.zsh
Remove .local/share/zsh/env.zsh.age
2023-03-08 15:18:20 +01:00
5e4c2c1577 update files 2023-03-07 08:57:34 +01:00
4c06448dc1 Update .config/zsh/rc.zsh 2023-02-14 10:54:20 +01:00
7984b858c7 Update .config/sheldon/plugins.toml
Update .config/zsh/rc.zsh
2023-02-13 13:36:19 +01:00
4803e74e77 Update .config/sheldon/plugins.toml
Update .config/zsh/rc.zsh
2023-02-11 21:48:34 +01:00
0ccc378d0c update files 2023-01-16 10:32:48 +01:00
84df5f315b update files 2023-01-16 10:32:35 +01:00
efd3fd35fb update files 2023-01-09 12:12:12 +01:00
2aceac0b25 Update .config/sheldon/plugins.toml 2023-01-09 12:09:00 +01:00
8f5ff058fa Update .config/sheldon/plugins.toml
Update .config/zsh/files/aliases.zsh
Update .config/zsh/files/compinit.zsh
Update .config/zsh/rc.zsh
2022-12-29 14:39:33 +01:00
a5c3567d85 Update .config/sheldon/plugins.toml
Update .config/zsh/env.zsh
Add .config/zsh/files/functions.zsh
Remove .config/zsh/files/keybinds.zsh
Remove .config/zsh/files/transfer.zsh
Update .config/zsh/rc.zsh
2022-12-20 16:45:56 +01:00
27a779ca15 Update .config/zsh/profile.zsh 2022-12-19 02:21:37 +01:00
5c73c42276 Update .config/sheldon/plugins.toml
Update .config/zsh/env.zsh
Add .config/zsh/files/compinit.zsh
Add .config/zsh/files/sshcomp.zsh
Update .config/zsh/rc.zsh
Update .config/zsh/.zprofile
Remove .config/zsh/.zsh_plugins.txt
Remove .config/zsh/zsh_plugins.txt
Update .local/bin/bofh
Change attributes of .config/zsh/files/aliases.zsh
Change attributes of .config/zsh/files/distroicon.zsh
Change attributes of .config/zsh/files/keybinds.zsh
Change attributes of .config/zsh/files/transfer.zsh
Change attributes of .config/zsh/profile.zsh
2022-12-19 02:19:48 +01:00
1e10bd5622 update files 2022-12-16 00:07:40 +01:00
92fe578bd2 update files 2022-12-15 23:58:18 +01:00
09118f860f use sheldon 2022-12-15 14:51:35 +01:00
63 changed files with 1962 additions and 207 deletions

View file

@ -0,0 +1,48 @@
import = ["./dracula.toml"]
[env]
TERM = "xterm-256color"
[font]
size = 10
[font.bold]
family = "FiraCode Nerd Font"
style = "Bold"
[font.bold_italic]
family = "FiraCode Nerd Font"
style = "Bold Italic"
[font.italic]
family = "FiraCode Nerd Font"
style = "Italic"
[font.normal]
family = "FiraCode Nerd Font"
style = "Regular"
[[keyboard.bindings]]
action = "Paste"
key = "V"
mods = "Control|Shift"
[[keyboard.bindings]]
action = "Copy"
key = "C"
mods = "Control|Shift"
[scrolling]
history = 99999
[shell]
args = ["--login"]
program = "/usr/bin/zsh"
[window]
opacity = 0.95
title = "Alacritty"
[window.class]
general = "Alacritty"
instance = "Alacritty"

View file

@ -0,0 +1,76 @@
# Dracula theme for Alacritty
# https://draculatheme.com/alacritty
#
# Color palette
# https://spec.draculatheme.com
#
# Instructions
# https://github.com/alacritty/alacritty/blob/master/extra/man/alacritty.5.scd
[colors.primary]
background = "#282a36"
foreground = "#f8f8f2"
bright_foreground = "#ffffff"
[colors.cursor]
text = "#282a36"
cursor = "#f8f8f2"
[colors.vi_mode_cursor]
text = "CellBackground"
cursor = "CellForeground"
[colors.selection]
text = "CellForeground"
background = "#44475a"
[colors.normal]
black = "#21222c"
red = "#ff5555"
green = "#50fa7b"
yellow = "#f1fa8c"
blue = "#bd93f9"
magenta = "#ff79c6"
cyan = "#8be9fd"
white = "#f8f8f2"
[colors.bright]
black = "#6272a4"
red = "#ff6e6e"
green = "#69ff94"
yellow = "#ffffa5"
blue = "#d6acff"
magenta = "#ff92df"
cyan = "#a4ffff"
white = "#ffffff"
[colors.search.matches]
foreground = "#44475a"
background = "#50fa7b"
[colors.search.focused_match]
foreground = "#44475a"
background = "#ffb86c"
[colors.footer_bar]
background = "#282a36"
foreground = "#f8f8f2"
[colors.hints.start]
foreground = "#282a36"
background = "#f1fa8c"
[colors.hints.end]
foreground = "#f1fa8c"
background = "#282a36"

View file

@ -0,0 +1,78 @@
tap "homebrew/bundle"
tap "homebrew/command-not-found"
tap "homebrew/core"
tap "homebrew/services"
tap "kdabir/tap"
tap "msoap/tools"
tap "xwmx/taps"
tap "yxdunc/tools"
brew "asciinema"
brew "perl"
brew "asdf"
brew "bat"
brew "brotli"
brew "node"
brew "gettext"
brew "bitwarden-cli"
brew "bottom"
brew "bpytop"
brew "cheat"
brew "chezmoi"
brew "choose-rust"
brew "util-linux"
brew "curlie"
brew "direnv"
brew "dog"
brew "duf"
brew "dust"
brew "libgit2"
brew "exa"
brew "fd"
brew "llvm"
brew "gh"
brew "git-delta"
brew "glances"
brew "grex"
brew "gron"
brew "hexyl"
brew "httpie"
brew "hub"
brew "hyperfine"
brew "ipinfo-cli"
brew "jc"
brew "jq"
brew "lf"
brew "lnav"
brew "lsd"
brew "mcfly"
brew "miller"
brew "name-that-hash"
brew "navi"
brew "nmap"
brew "ripgrep"
brew "w3m"
brew "nb"
brew "nghttp2"
brew "procs"
brew "pywhat"
brew "ranger"
brew "rm-improved"
brew "rust"
brew "scc"
brew "sd"
brew "shellcheck"
brew "spark"
brew "speedtest-cli"
brew "starship"
brew "tokei"
brew "up"
brew "viddy"
brew "wget"
brew "wgetpaste"
brew "whalebrew"
brew "xh"
brew "xsv"
brew "zoxide"
brew "kdabir/tap/has"
brew "msoap/tools/shell2http"
brew "yxdunc/tools/lipl"

View file

@ -4,10 +4,10 @@ copy_on_select no
strip_trailing_spaces smart
window_padding_width 5
enable_audio_bell no
shell_integration disabled
# Fonts
font_family 0xproto Nerd Font
font_size 13
font_family FiraCode Nerd Font
# BEGIN_KITTY_THEME
# Dracula

View file

@ -0,0 +1,53 @@
background #1E1C31
foreground #CBE3E7
cursor #A1EFD3
selection_background #3E3859
selection_foreground #CBE3E7
# black
color0 #1E1C31
color8 #585273
# red
color1 #F48FB1
color9 #F02E6E
# green
color2 #A1EFD3
color10 #7FE9C3
# yellow
color3 #FFE6B3
color11 #F2B482
# blue
color4 #91DDFF
color12 #78A8FF
# magenta
color5 #D4BFFF
color13 #7676FF
# cyan
color6 #ABF8F7
color14 #63F2F1
# white
color7 #CBE3E7
color15 #8A889D
active_border_color #A1EFD3
inactive_border_color #585273
bell_border_color #F56574
active_tab_foreground #2D2B40
active_tab_background #63F2F1
active_tab_font_style bold
inactive_tab_foreground #CBE3E7
inactive_tab_background #585273
inactive_tab_font_style normal
url_color #D4BFFF

View file

@ -0,0 +1,91 @@
# vim:ft=kitty
## name: Penumbra
### license: MIT License
## blurb: Kitty terminal port of the dark Penumbra color theme
## by Neal McKee. https://github.com/nealmckee/penumbra
## This theme uses the balanced 7 colors plus sun and shade
## as well as the the contrast++ for the 16 color palette
# Place this theme in your `~/.config/kitty/themes` directory
# and select it using `kitty +kitten themes` in the User menu
#: The basic colors
#:sky
foreground #8F8F8F
#:shade
background #303338
#:shade
selection_foreground #303338
#:sun
selection_background #FFF7ED
#: Cursor colors
#:sun
cursor #FFF7ED
#:shade
cursor_text_color #303338
#: URL underline color when hovering with mouse
#:blue
url_color #6E8DD5
#: The basic 16 colors
#: black
#: shade- balanced
color0 #24272B
#: shade- contrast++
color8 #0D0F13
#: red
#: red balanced
color1 #CA736C
#: red contrast++
color9 #F18AA1
#: green
#: green balanced
color2 #3EA57B
#: green contrast++
color10 #58C792
#: yellow
#: yellow balanced
color3 #92963A
#: yellow contrast++
color11 #B4B44A
#: blue
#: blue balanced
color4 #6E8DD5
#: blue contrast++
color12 #83ADFF
#: magenta (we replace with orange)
#: orange balanced
color5 #C27D40
#: orange contrast++
color13 #EA9856
#: cyan
#: cyan balanced
color6 #00A0BA
#: cyan contrast++
color14 #16C3DD
#: white
#: sun
color7 #FFF7ED
#: sun+
color15 #FFFDFB
# colors used by lsd
color187 #F2E6D4
color230 #FFF7ED
color245 #636363
color229 #8D9741
color216 #BA823A
color172 #CA736C
color40 #54C794
color42 #50B584
color36 #47A477

38
dot_config/qtile/bars.py Normal file
View file

@ -0,0 +1,38 @@
from libqtile import bar, widget
from colors import colors
def base(fg='foreground', bg='background'):
return { 'foreground': colors[fg], 'background': colors[bg] }
widget_defaults = {
'font': 'FiraCode Mono Nerd Font',
'fontsize': 12,
'padding': 5,
'foreground': colors['black'],
'background': colors['background']
}
group_box = {
'fontsize': 28,
'active': colors['purple'],
'inactive': colors['purple'],
'highlight_method': 'line',
'this_current_screen_border': colors['green']
}
green = { 'background': colors['green'] }
yellow = { 'background': colors['yellow'] }
widgets_list = [
widget.GroupBox(**group_box),
widget.WindowName(**base(fg='yellow')),
widget.Memory(**yellow),
widget.Battery(**green),
widget.Volume(**yellow),
widget.CapsNumLockIndicator(**green),
widget.CurrentLayout(**yellow),
widget.Clock(format='%A, %B %d (%T)', **green),
widget.Systray()
]
top = bar.Bar(widgets_list, 30)

View file

@ -0,0 +1,9 @@
import json
import os
theme = 'nord'
user = os.path.expanduser('~')
with open(user + "/.config/qtile/themes/" + theme + ".json") as theme_json:
colors = json.load(theme_json)

View file

@ -0,0 +1,15 @@
import subprocess
import os
from libqtile import hook
from keys import keys
from groups import groups
from screens import screens
from bars import widget_defaults
from layouts import layouts, floating_layout
#@hook.subscribe.startup_once
# def start_once():
# user = os.path.expanduser('~')
# subprocess.call([user + '/.config/qtile/scripts/autostart.sh'])

View file

@ -0,0 +1,20 @@
from libqtile.config import Group, ScratchPad, DropDown
group_names = [
("WWW", {'layout': 'treetab', 'label': ''}),
("DEV", {'layout': 'monadtall', 'label': ''}),
("SYS", {'layout': 'treetab', 'label': ''}),
("VMS", {'layout': 'monadtall', 'label': ''}),
("DOC", {'layout': 'monadtall', 'label': ''}),
("IRC", {'layout': 'monadtall', 'label': ''}),
("MUS", {'layout': 'monadtall', 'label': ''}),
("VID", {'layout': 'monadtall', 'label': ''}),
("GFX", {'layout': 'floating', 'label': ''})
]
terminals = [
DropDown("term", "kitty", height = 0.65, width = 0.85, warp_pointer = False)
]
groups = [Group(name, **kwargs) for name, kwargs in group_names]
groups.append(ScratchPad("DRP", dropdowns = terminals))

62
dot_config/qtile/keys.py Normal file
View file

@ -0,0 +1,62 @@
from libqtile.config import Key, Drag, Click
from libqtile.lazy import lazy
from groups import group_names
mod = ["mod4"]
modshift = ["mod4", "shift"]
modctrl = ["mod4", "control"]
ctrl = ["control"]
keys = [
# Standard Controls
Key(modshift, "d", lazy.window.kill(), desc='kill active window'),
Key(modctrl, "r", lazy.restart(), desc='reload qtile config'),
Key(modctrl, "l", lazy.spawn('xdg-screensaver lock'), desc='lock screen'),
Key(modshift, "q", lazy.spawn('rofi -show p -modi p:rofi-power-menu'), desc="shutdown menu"),
Key(mod, "Tab", lazy.spawn('rofi -show window'), desc='window menu'),
# Treetab controls
Key(modctrl, "Up", lazy.layout.section_up(), desc='Move up a section in treetab'),
Key(modctrl, "Down", lazy.layout.section_down(), desc='Move down a section in treetab'),
# Window controls
Key(mod, "Up", lazy.layout.up(), desc='Move focus up in current stack pane'),
Key(mod, "Down", lazy.layout.down(), desc='Move focus down in current stack pane'),
Key(mod, "Left", lazy.layout.shrink(), lazy.layout.decrease_nmaster(), desc='Shrink window (MonadTall), decrease number in master pane (Tile)'),
Key(mod, "Right", lazy.layout.grow(), lazy.layout.increase_nmaster(), desc='Expand window (MonadTall), increase number in master pane (Tile)'),
Key(modshift, "Down", lazy.layout.shuffle_down(), desc='Move windows down in current stack'),
Key(modshift, "Up", lazy.layout.shuffle_up(), desc='Move windows up in current stack'),
Key(modctrl, "f", lazy.window.toggle_floating(), desc='toggle floating'),
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'),
# Stack controls
Key(modshift, "space", lazy.layout.rotate(), lazy.layout.flip(), desc='Switch which side main pane occupies (XmonadTall)'),
Key(mod, "space", lazy.layout.next(), desc='Switch window focus to other pane(s) of stack'),
Key(modctrl, "Return", lazy.layout.toggle_split(), desc='Toggle between split and unsplit sides of stack'),
# run programs
Key(mod, "Return", lazy.spawn('rofi -show drun'), desc='launcher'),
Key(modshift, "r", lazy.spawn('pcmanfm'), desc='filebrowser'),
Key(modshift, "p", lazy.spawn('bwmenu'), desc='passwordmenu'),
Key(ctrl, "space", lazy.group["DRP"].dropdown_toggle("term")),
# sound + brightness
Key([], "XF86AudioMute", lazy.spawn('pactl set-sink-mute @DEFAULT_SINK@ toggle')),
Key([], "XF86AudioMicMute", lazy.spawn('pactl set-source-mute @DEFAULT_SOURCE@ toggle')),
Key([], "XF86AudioLowerVolume", lazy.spawn('pactl set-sink-volume @DEFAULT_SINK@ -5%')),
Key([], "XF86AudioRaiseVolume", lazy.spawn('pactl set-sink-volume @DEFAULT_SINK@ +5%')),
Key([], "XF86MonBrightnessUp", lazy.spawn('brightnessctl set +10%')),
Key([], "XF86MonBrightnessDown", lazy.spawn('brightnessctl set 10%-'))
]
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())
]
for i, (name, kwargs) in enumerate(group_names, 1):
keys.append(Key(mod, str(i), lazy.group[name].toscreen()))
keys.append(Key(modshift, str(i), lazy.window.togroup(name)))

View file

@ -0,0 +1,53 @@
from libqtile import layout
from libqtile.config import Match
from colors import colors
layout_theme = {
"border_width": 1,
"margin": 5,
"border_focus": colors['green'],
"border_normal": colors['cyan']
}
treetab_layout = {
"font": "FiraCode Nerd Font",
"fontsize": 10,
"sections": [""],
"section_fontsize": 8,
"bg_color": colors['background'],
"active_bg": colors['foreground'],
"active_fg": colors['background'],
"inactive_bg": colors['background'],
"inactive_fg": colors['white'],
"padding_y": 5,
"section_top": 10,
"panel_width": 100
}
layouts = [
# layout.MonadWide(**layout_theme),
# layout.Bsp(**layout_theme),
# layout.Stack(num_stacks=2, **layout_theme),
# layout.Columns(**layout_theme),
# layout.RatioTile(**layout_theme),
# layout.VerticalTile(**layout_theme),
# layout.Matrix(**layout_theme),
layout.MonadTall(**layout_theme),
# layout.Max(**layout_theme),
# layout.Tile(shift_windows=True, **layout_theme),
layout.TreeTab(**treetab_layout),
layout.Floating(**layout_theme)
]
floatrules = [
*layout.Floating.default_float_rules,
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
]
floating_layout = layout.Floating(float_rules = floatrules, border_width = 0)

View file

@ -0,0 +1,170 @@
import json
import subprocess
from libqtile import layout, bar, widget, hook
from libqtile.command import lazy
from libqtile.config import Key, Screen, Group, Drag, Click
@hook.subscribe.startup_once
def start_once():
subprocess.call(['/home/eeleater/.config/qtile/scripts/autostart.sh'])
terminal = "kitty"
mod = ["mod4"]
modshift = ["mod4", "shift"]
modctrl = ["mod4", "control"]
keys = [
# Standard Controls
Key(modshift, "d", lazy.window.kill(), desc='kill active window'),
Key(modctrl, "r", lazy.restart(), desc='reload qtile config'),
Key(modctrl, "l", lazy.spawn("xdg-screensaver lock"), desc='lock screen'),
Key(modshift, "q", lazy.spawn("rofi -show p -modi p:rofi-power-menu"), desc="shutdown menu"),
Key(mod, "Tab", lazy.spawn("rofi -show window"), desc='window menu'),
# Treetab controls
Key(modctrl, "Up", lazy.layout.section_up(), desc='Move up a section in treetab'),
Key(modctrl, "Down", lazy.layout.section_down(), desc='Move down a section in treetab'),
# Window controls
Key(mod, "Up", lazy.layout.up(), desc='Move focus up in current stack pane'),
Key(mod, "Down", lazy.layout.down(), desc='Move focus down in current stack pane'),
Key(mod, "Left", lazy.layout.shrink(), lazy.layout.decrease_nmaster(), desc='Shrink window (MonadTall), decrease number in master pane (Tile)'),
Key(mod, "Right", lazy.layout.grow(), lazy.layout.increase_nmaster(), desc='Expand window (MonadTall), increase number in master pane (Tile)'),
Key(modshift, "Down", lazy.layout.shuffle_down(), desc='Move windows down in current stack'),
Key(modshift, "Up", lazy.layout.shuffle_up(), desc='Move windows up in current stack'),
Key(modctrl, "f", lazy.window.toggle_floating(), desc='toggle floating'),
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'),
# Stack controls
Key(modshift, "space", lazy.layout.rotate(), lazy.layout.flip(), desc='Switch which side main pane occupies (XmonadTall)'),
Key(mod, "space", lazy.layout.next(), desc='Switch window focus to other pane(s) of stack'),
Key(modctrl, "Return", lazy.layout.toggle_split(), desc='Toggle between split and unsplit sides of stack'),
# run programs
Key(mod, "Return", lazy.spawn(terminal + ' --single-instance'), desc='terminal'),
Key(modshift, "Return", lazy.spawn("rofi -show drun"), desc='launcher'),
Key(modshift, "r", lazy.spawn("pcmanfm"), desc='filebrowser'),
Key(modshift, "p", lazy.spawn("bwmenu"), desc='passwordmenu'),
# sound + brightness
Key([], "XF86AudioMute", lazy.spawn("pactl set-sink-mute @DEFAULT_SINK@ toggle")),
Key([], "XF86AudioMicMute", lazy.spawn("pactl set-source-mute @DEFAULT_SOURCE@ toggle")),
Key([], "XF86AudioLowerVolume", lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ -5%")),
Key([], "XF86AudioRaiseVolume", lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ +5%")),
Key([], "XF86MonBrightnessUp", lazy.spawn("brightnessctl set +10%")),
Key([], "XF86MonBrightnessDown", lazy.spawn("brightnessctl set 10%-"))
]
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())
]
# GROUPS
group_names = [
("WWW", {'layout': 'treetab', 'label': ''}),
("DEV", {'layout': 'monadtall', 'label': ''}),
("SYS", {'layout': 'monadtall', 'label': ''}),
("VMS", {'layout': 'monadtall', 'label': ''}),
("DOC", {'layout': 'monadtall', 'label': ''}),
("IRC", {'layout': 'monadtall', 'label': ''}),
("MUS", {'layout': 'monadtall', 'label': ''}),
("VID", {'layout': 'monadtall', 'label': ''}),
("GFX", {'layout': 'floating', 'label': ''})
]
groups = [Group(name, **kwargs) for name, kwargs in group_names]
for i, (name, kwargs) in enumerate(group_names, 1):
keys.append(Key(mod, str(i), lazy.group[name].toscreen()))
keys.append(Key(modshift, str(i), lazy.window.togroup(name)))
# LAYOUTS
layout_theme = {"border_width": 1, "margin": 5, "border_focus": "53bdfa", "border_normal": "01060e"}
treetab_layout = {
"font": "FiraCode Nerd Font",
"fontsize": 10,
"sections": [""],
"section_fontsize": 8,
"bg_color": "141414",
"active_bg": "90C435",
"active_fg": "000000",
"inactive_bg": "384323",
"inactive_fg": "a0a0a0",
"padding_y": 5,
"section_top": 10,
"panel_width": 100
}
layouts = [
# layout.MonadWide(**layout_theme),
# layout.Bsp(**layout_theme),
# layout.Stack(num_stacks=2, **layout_theme),
# layout.Columns(**layout_theme),
# layout.RatioTile(**layout_theme),
# layout.VerticalTile(**layout_theme),
# layout.Matrix(**layout_theme),
layout.MonadTall(**layout_theme),
# layout.Max(**layout_theme),
# layout.Tile(shift_windows=True, **layout_theme),
layout.TreeTab(**treetab_layout),
layout.Floating(**layout_theme)
]
# COLORS
theme = 'hopscotch'
with open("/home/eeleater/.config/qtile/themes/" + theme + ".json") as theme_json:
colors = json.load(theme_json)
def base(fg='foreground', bg='background'):
return {'foreground': colors[fg], 'background': colors[bg]}
# DEFAULTS
widget_defaults = {'font': 'FiraCode Mono Nerd Font', 'fontsize': 12, 'padding': 5, 'foreground': colors['black'], 'background': colors['background']}
extension_defaults = widget_defaults.copy()
group_box = {
'fontsize': 25,
'active': colors['purple'],
'inactive': colors['purple'],
'highlight_method': 'line',
'this_current_screen_border': colors['green']
}
pacman = { 'update_interval': 1800 }
clock = { 'format': '%A, %B %d (%T)' }
wid_bg_one = { 'background': colors['green'] }
wid_bg_two = { 'background': colors['yellow'] }
widgets_list = [
widget.GroupBox(**group_box),
widget.WindowName(**base(fg='yellow')),
widget.Pacman(**pacman, **wid_bg_one),
widget.TextBox(text="Updates", **wid_bg_one),
widget.Memory(**wid_bg_two),
widget.Battery(**wid_bg_one),
widget.Volume(**wid_bg_two),
widget.CapsNumLockIndicator(**wid_bg_one),
widget.CurrentLayout(**wid_bg_two),
widget.Clock(**wid_bg_one, **clock),
widget.Systray()
]
screens = [Screen(top=bar.Bar(widgets_list, 25))]
floating_layout = layout.Floating(float_rules=[
{'wmclass': 'confirm'}, {'wmclass': 'dialog'},
{'wmclass': 'download'}, {'wmclass': 'error'},
{'wmclass': 'file_progress'}, {'wmclass': 'notification'},
{'wmclass': 'splash'}, {'wmclass': 'toolbar'},
{'wmclass': 'confirmreset'}, {'wmclass': 'makebranch'},
{'wmclass': 'maketag'}, {'wmclass': 'ssh-askpass'},
{'wmclass': 'microsoft teams - preview'},
{'wname': 'branchdialog'}, {'wname': 'pinentry-gtk-2'},
{'wname': 'pinentry'}, {'wname': 'Welcome to PyCharm'},
{'wname': 'Kali'}
])

View file

@ -0,0 +1,127 @@
from pathlib import Path
from libqtile import bar, widget
from colors import theme, border_color
icon_theme_path = Path.home() / '{{ icon_dir | replace(user_dir + '/', '') }}'
bar_size = 36
groupbox = {
'center_aligned': True,
'foreground': theme['very_light_white'],
'inactive': theme['gray'],
'other_current_screen_border': theme['gray'],
'this_current_screen_border': theme['dark_blue'],
'this_screen_border': theme['dark_blue'],
'urgent_border': theme['red'],
'urgent_text': theme['red']}
sep = {
'linewidth': 2,
'size_percent': 100,
'padding': 12}
soft_sep = {
'linewidth': 2,
'size_percent': 70,
'foreground': theme['dark_gray'],
'padding': 7}
tasklist = {
'border': border_color,
'max_title_width': 200,
'txt_floating': '🗗',
'txt_maximized': '🗖',
'txt_minimized': '🗕'}
volume = {'theme_path': icon_theme_path}
clock = {
'timezone': 'Europe/Paris',
'format': '%B %-d, %H:%M'}
music = widget.Mpris2(
background=theme['dark_blue'],
name='spotify',
scroll_chars=0,
stop_pause_text='',
display_metadata=['xesam:title', 'xesam:artist'],
objname="org.mpris.MediaPlayer2.spotify")
disk = widget.DF(
update_interval=3600,
warn_space=5,
format='{p} ({uf}{m})')
updates = widget.CheckUpdates(
distro='Arch_checkupdates',
display_format='{updates}',
execute='termite -e "pikaur -Syu"',
colour_have_updates=theme['dark_blue'],
colour_no_updates=theme['dark_green'],
update_interval=600)
battery = widget.Battery(
foreground=theme['green'],
low_percentage=0.10,
low_foreground=theme['red'],
update_delay=10,
format='{percent:.0%} {hour:d}:{min:02d} {watt:.2}W')
battery_icon = widget.BatteryIcon(
theme_path=icon_theme_path,
update_interval=120)
systray = widget.Systray(
icon_size=24
)
main_bar = bar.Bar(
[
widget.GroupBox(**groupbox, visible_groups=['a', 's', 'd', 'f',
'music', 'chat', 'game']),
widget.Sep(**sep),
widget.Volume(**volume),
music,
widget.TaskList(**tasklist),
systray,
widget.Sep(**sep),
disk,
updates,
widget.Sep(**soft_sep),
battery_icon,
battery,
widget.Sep(**soft_sep),
widget.Clock(**clock),
], bar_size)
bar1 = bar.Bar(
[
widget.GroupBox(**groupbox, visible_groups=['a', 's', 'd', 'f', 'game']),
widget.Sep(**sep),
widget.Volume(**volume),
music,
widget.TaskList(**tasklist),
systray,
widget.Sep(**sep),
disk,
updates,
widget.Sep(**soft_sep),
widget.Clock(**clock),
], bar_size)
bar2 = bar.Bar(
[
widget.GroupBox(**groupbox, visible_groups=['u', 'i', 'o', 'p', 'music', 'chat']),
widget.Sep(**sep),
widget.Volume(**volume),
widget.TaskList(**tasklist),
battery_icon,
battery,
widget.Sep(**soft_sep),
widget.Clock(**clock),
], bar_size)

View file

@ -0,0 +1,40 @@
# gruvbox
theme = {
'dark_black': '{{ theme.dark_black }}',
'black': '{{ theme.black }}',
'light_black': '{{ theme.light_black }}',
'very_light_black': '{{ theme.very_light_black }}',
'dark_gray': '{{ theme.dark_gray }}',
'gray': '{{ theme.gray }}',
'light_gray': '{{ theme.light_gray }}',
'very_light_gray': '{{ theme.very_light_gray }}',
'dark_white': '{{ theme.dark_white }}',
'white': '{{ theme.white }}',
'light_white': '{{ theme.light_white }}',
'very_light_white': '{{ theme.very_light_white }}',
'dark_red': '{{ theme.dark_red }}',
'red': '{{ theme.red }}',
'dark_green': '{{ theme.dark_green }}',
'green': '{{ theme.green }}',
'dark_yellow': '{{ theme.dark_yellow }}',
'yellow': '{{ theme.yellow }}',
'dark_blue': '{{ theme.dark_blue }}',
'blue': '{{ theme.blue }}',
'dark_purple': '{{ theme.dark_purple }}',
'purple': '{{ theme.purple }}',
'dark_teal': '{{ theme.dark_teal }}',
'teal': '{{ theme.teal }}',
'dark_orange': '{{ theme.dark_orange }}',
'orange': '{{ theme.orange }}',
}
border_color = theme['white']

View file

@ -0,0 +1,131 @@
import re
from subprocess import run
from pathlib import Path
from typing import List
from libqtile import layout, hook
from libqtile.config import Group, Match, Screen, Rule
from bars import main_bar, bar1, bar2
from keys import keys, mouse, sc, get_backlight_keys
from colors import border_color, theme
from util import qtile_func
from util.monitor import enable_monitor
keys = keys
mouse = mouse
screens: List[Screen] = []
groups = [
Group('game', layouts=[layout.Max()], persist=False, init=False,
matches=[Match(wm_class=['Steam'])], label=''),
Group('chat', layouts=[layout.Max()], persist=False, init=False,
matches=[Match(wm_class=['discord'])], label=''),
Group('music', layouts=[layout.Max()], persist=False, init=False,
matches=[Match(wm_class=[re.compile('spotify', re.I)])], label=''),
]
float_rules = [
{'wmclass': 'confirm'},
{'wmclass': 'dialog'},
{'wmclass': 'download'},
{'wmclass': 'error'},
{'wmclass': 'file_progress'},
{'wmclass': 'notification'},
{'wmclass': 'splash'},
{'wmclass': 'toolbar'},
{'wmclass': 'Xephyr'},
{'wmclass': 'feh'},
{'wmclass': 'Sms.py'},
{'wmclass': 'leagueclientux.exe'},
{'wmclass': 'Gcr-prompter'},
{'wmclass': 'scrcpy'},
{'wname': 'Friends'},
]
floating_layout = layout.Floating(border_focus=f'#{border_color}',
float_rules=float_rules)
layouts = [
layout.Max(),
layout.Stack(num_stacks=2, border_focus=f'#{border_color}')
]
widget_defaults = {'font': 'DejaVu Sans',
'fontsize': 18,
'padding': 4,
'foreground': theme['very_light_white'],
'background': theme['dark_black']}
def setup_monitors(qtile):
monitors = qtile.conn.monitors
nb_monitors = len(monitors)
if nb_monitors == 1:
run('xrandr --auto'.split())
elif nb_monitors == 2:
laptop_monitor = None
other_monitor = None
for monitor in monitors:
if monitor.name.startswith('eDP'):
laptop_monitor = monitor
else:
other_monitor = monitor
enable_monitor(other_monitor, primary=True, side='left-of',
relative_monitor=laptop_monitor)
def setup_screens(qtile, screens, groups):
nb_monitors = len(qtile.conn.monitors)
if nb_monitors == 1:
screens.append(Screen(top=main_bar))
groups += [Group(i) for i in 'asdf']
else:
screens += [Screen(top=bar1), Screen(top=bar2)]
groups += [Group(i) for i in 'asdfuiop']
def main(qtile):
global keys
setup_monitors(qtile)
setup_screens(qtile, screens, groups)
keys += get_backlight_keys(qtile)
def wallpaper():
wallpaper_path = Path.home() / '.wallpaper'
run(['feh', '--bg-scale', wallpaper_path])
@hook.subscribe.startup
def autostart():
wallpaper()
sc.set_profile('analog')
@hook.subscribe.addgroup
def go_to_group(qtile, group):
try:
qtile.groupMap[group].cmd_toscreen()
except AttributeError:
pass
@hook.subscribe.screen_change
def configure_monitors(qtile, ev):
setup_monitors(qtile)
qtile.cmd_restart()
dgroups_app_rules: List[Rule] = []
dgroups_key_binder = None
follow_mouse_focus = False
bring_front_click = False
cursor_warp = False
auto_fullscreen = True
focus_on_window_activation = 'focus'
wmname = 'LG3D'

View file

@ -0,0 +1,124 @@
from libqtile.config import Key, Drag
from libqtile.command import lazy
from util.backlight import Backlight
from util.screenshot import screenshot
from util.soundcard import SoundCard
from util import qtile_func
# super = mod4, alt = mod1
mod = 'mod4'
BROWSER = '{{ browser }}'
TERM= '{{ term }}'
MUSIC_PLAYER = 'spotify'
# add 'PlayPause', 'Next' or 'Previous'
spotify_cmd = ('dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify '
'/org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.')
amixer_cmd = 'amixer -D pulse set Master'
rofi_cmd = 'rofi -combi-modi window,run -show combi -modi combi -monitor -4'
sc = SoundCard('alsa_card.pci-0000_00_1f.3')
def app_or_group(group, app):
"""Go to app if already open else open it."""
def f(qtile):
if group in {'music'}:
qtile.cmd_to_screen(1)
try:
qtile.groupMap[group].cmd_toscreen()
except KeyError:
qtile.cmd_spawn(app)
return f
def go_to_group(group):
"""The groups 'asdf' are accessible on screen 1, 'uiop' on screen 2."""
def f(qtile):
if group in 'asdf':
qtile.cmd_to_screen(0)
qtile.groupMap[group].cmd_toscreen()
elif group in 'uiop':
qtile.cmd_to_screen(1)
qtile.groupMap[group].cmd_toscreen()
return f
# TODO: make this function work for more than two monitors
def get_backlight_keys(qtile):
monitors = qtile.conn.monitors
keys = []
for monitor in monitors:
bl = Backlight(ctrl=monitor.backlight_ctrl)
if monitor.name.startswith('eDP'):
keys.append(Key([], 'XF86MonBrightnessUp', lazy.function(bl.change_backlight('inc'))))
keys.append(Key([], 'XF86MonBrightnessDown', lazy.function(bl.change_backlight('dec'))))
keys.append(Key([], 'F7', lazy.function(bl.turn_off_screen(monitor.x))))
else:
keys.append(Key([mod], 'Up', lazy.function(bl.change_backlight('inc'))))
keys.append(Key([mod], 'Down', lazy.function(bl.change_backlight('dec'))))
keys.append(Key([mod], 'F7', lazy.function(bl.turn_off_screen(monitor.x))))
return keys
keys = [
Key([mod, 'control'], 'p', lazy.spawn('xbacklight -set 50')),
Key([mod], 'k', lazy.layout.down()), # noqa
Key([mod], 'j', lazy.layout.up()), # noqa
Key([mod], 'space', lazy.layout.next()), # noqa
Key([mod, 'control'], 'k', lazy.layout.shuffle_down()), # noqa
Key([mod, 'control'], 'j', lazy.layout.shuffle_up()), # noqa
Key([mod, 'shift'], 'h', lazy.layout.client_to_previous()), # noqa
Key([mod, 'shift'], 'l', lazy.layout.client_to_next()), # noqa
Key([mod, 'shift'], 'space', lazy.layout.rotate()), # noqa
Key([mod, 'shift'], 'Return', lazy.layout.toggle_split()), # noqa
Key([mod], 'slash', lazy.screen.toggle_group()), # noqa
Key([mod], 'x', lazy.window.kill()), # noqa
Key([mod], 'y', lazy.window.toggle_floating()), # noqa
Key([mod], '1', lazy.to_screen(0)), # noqa
Key([mod], '2', lazy.to_screen(1)), # noqa
Key([mod], 'Tab', lazy.next_layout()), # noqa
Key([mod, 'control'], 'r', lazy.restart()), # noqa
Key([mod, 'control'], 'q', lazy.shutdown()), # noqa
# Audio
Key([], 'XF86AudioMute', lazy.spawn(amixer_cmd + ' 1+ toggle')), # noqa
Key([], 'XF86AudioRaiseVolume', lazy.spawn(amixer_cmd + ' 5%+')), # noqa
Key([], 'XF86AudioLowerVolume', lazy.spawn(amixer_cmd + ' 5%-')), # noqa
Key([], 'XF86AudioPlay', lazy.spawn(spotify_cmd + 'PlayPause')), # noqa
Key([], 'XF86AudioNext', lazy.spawn(spotify_cmd + 'Next')), # noqa
Key([], 'XF86AudioPrev', lazy.spawn(spotify_cmd + 'Previous')), # noqa
Key([mod], 'bracketleft', lazy.function(sc.change_sink('prev'))), # noqa
Key([mod], 'bracketright', lazy.function(sc.change_sink('next'))), # noqa
Key([], 'F8', lazy.function(sc.swap_profile())), # noqa
# Apps
Key([mod], 't', lazy.spawn(rofi_cmd)), # noqa
Key([mod], 'Return', lazy.spawn(TERM)), # noqa
Key([mod], 'b', lazy.spawn(BROWSER)), # noqa
Key([mod], 'g', lazy.function(app_or_group('game', 'steam'))), # noqa
Key([mod], 'n', lazy.function(app_or_group('chat', 'discord'))), # noqa
Key([mod], 'm', lazy.function(app_or_group('music', MUSIC_PLAYER))), # noqa
# Screenshots
Key([], 'Print', lazy.function(screenshot())), # noqa
Key(['control'], 'Print', lazy.spawn('deepin-screenshot')), # noqa
]
for i in 'asdfuiop':
keys.append(Key([mod], i, lazy.function(go_to_group(i)))) # noqa
keys.append(Key([mod, 'shift'], i, lazy.window.togroup(i))) # noqa
mouse = [
Drag([mod], "Button1", lazy.window.set_position_floating(),
start=lazy.window.get_position()),
Drag([mod, 'control'], "Button1", lazy.window.set_size_floating(),
start=lazy.window.get_size()),
]

View file

@ -0,0 +1,23 @@
from functools import wraps
from subprocess import run, PIPE
from typing import Callable, Any
import parse
def qtile_func(func: Callable[..., Any]) -> Callable[..., Any]:
"""
This decorator makes a function suitable to be used as a parameter for
`lazy.function()` by making the wrapped function return a function that
takes the qtile instance as first parameter.
"""
@wraps(func)
def wrapper(*args, **kwargs):
def f(qtile):
func(*args, **kwargs)
return f
return wrapper
def notify(summary: str, body: str, urgency: str='normal') -> None:
run(['notify-send', '-u', urgency, summary, body])

View file

@ -0,0 +1,50 @@
from subprocess import run, PIPE
from typing import Optional
from pynput import mouse
from . import qtile_func
class Backlight:
def __init__(self, ctrl: Optional[str]=None) -> None:
self.command = ['xbacklight']
if ctrl:
self.command += ['-ctrl', ctrl]
def _get_brightness(self) -> int:
return int(run(self.command + ['-get'], stdout=PIPE).stdout)
def _set_brightness(self, percentage: int) -> None:
run(self.command + [f'-set', str(percentage)])
@qtile_func
def change_backlight(self, action: str) -> None:
"""
Increase or decrease bightness.
Takes 'dec' or 'inc' as parameter. Goes 1% percent at a time from
1% to 40% and 10% at a time from 40% to 100%.
"""
brightness = self._get_brightness()
if brightness != 1 or action != 'dec':
if (brightness > 49 and action == 'dec') \
or (brightness > 39 and action == 'inc'):
run(self.command + [f'-{action}', '10', '-fps', '10'])
else:
run(self.command + [f'-{action}', '1'])
@qtile_func
def turn_off_screen(self, screen_offset: int) -> None:
"""
Turn off the laptop's screen.
Use xset if there is only one screen, else, set backlight to
zero. In both case, moving the mouse will turn on the screen.
"""
current_brightness = self._get_brightness()
self._set_brightness(0)
def on_move(x: int, y: int):
if x > screen_offset:
self._set_brightness(current_brightness)
raise mouse.Listener.StopException
mouse.Listener(on_move=on_move).start()

View file

@ -0,0 +1,24 @@
from subprocess import run
from pathlib import Path
from typing import Optional
from libqtile.log_utils import logger
from libqtile.xcbq import Monitor
from .backlight import Backlight
Side = str # one of 'left-of', 'right-of', 'above', 'below' or 'same-as'
def enable_monitor(monitor: Monitor, primary: bool=False, side: Optional[Side]=None,
relative_monitor: Optional[Monitor]=None) -> None:
command = ['xrandr', '--output', monitor.name, '--auto']
if primary:
command += ['--primary']
if side:
if not relative_monitor:
raise Exception('Need a monitor to be relative to')
command += ['--{}'.format(side), relative_monitor.name]
run(command)
logger.info(f'Running command: {" ".join(command)}')

View file

@ -0,0 +1,16 @@
from time import time
from pathlib import Path
from subprocess import run, PIPE
from . import qtile_func
@qtile_func
def screenshot(save: bool=True, copy: bool=True) -> None:
shot = run(['maim'], stdout=PIPE)
if save:
path = Path.home() / 'Pictures'
path /= f'screenshot_{str(int(time() * 100))}.png'
with open(path, 'wb') as sc:
sc.write(shot.stdout)
if copy:
run('xclip -sel clip -t image/png'.split(), input=shot.stdout)

View file

@ -0,0 +1,79 @@
from subprocess import run, PIPE
import parse
from . import qtile_func, notify
class SoundCard():
def __init__(self, primary_card_name):
self.primary_card = primary_card_name
def get_current_sink(self):
cp = run(['pactl', 'info'], stdout=PIPE)
output = cp.stdout.decode('utf-8')
return parse.search('Default Sink: {}\n', output)[0]
def list_sinks(self):
"""Generator that yields for each sink, the sink and card name."""
cp = run(['pactl', 'list', 'sinks'], stdout=PIPE)
output = cp.stdout.decode('utf-8')
for sink in output.split('\nSink'):
sink_name = parse.search('Name: {}\n', sink)[0]
card_name = parse.search('alsa.card_name = "{}"', sink)[0]
yield sink_name, card_name
def set_new_sink(self, sink_card_tuple):
run(['pactl', 'set-default-sink', sink_card_tuple[0]])
def list_sink_inputs(self):
cp = run(['pactl', 'list', 'short', 'sink-inputs'], stdout=PIPE)
output = cp.stdout.decode('utf-8')
return {line.split()[0] for line in output.split('\n') if line}
def move_sink_input(self, name, new_sink):
run(['pactl', 'move-sink-input', name, new_sink])
def get_current_profile(self):
cp = run(['pactl', 'list', 'cards'], stdout=PIPE)
cp = run(['grep', 'Active'], stdout=PIPE, input=cp.stdout)
return 'hdmi' if b'hdmi' in cp.stdout else 'analog'
def set_profile(self, profile):
cmd = f'output:{profile}-stereo+input:analog-stereo'
run(['pactl', 'set-card-profile', self.primary_card, cmd])
@qtile_func
def change_sink(self, direction):
sinks = list(self.list_sinks())
# get the index of the tuple containing the current default sink
current_sink = self.get_current_sink()
for index, tup in enumerate(sinks):
if current_sink in tup:
default_sink_index = index
break
if direction == 'next':
new_sink = sinks[default_sink_index - 1]
elif direction == 'prev':
new_sink = sinks[(default_sink_index + 1) % len(sinks)]
self.set_new_sink(new_sink)
notify('Sound Card', new_sink[1])
# move current sink inputs, if any, to the new default sink
sink_inputs = self.list_sink_inputs()
if sink_inputs:
for sink_input in sink_inputs:
self.move_sink_input(sink_input, new_sink[0])
@qtile_func
def swap_profile(self):
profile = self.get_current_profile()
if profile == 'analog':
self.set_profile('hdmi')
notify('Sound Profile', 'HDMI')
elif profile == 'hdmi':
self.set_profile('analog')
notify('Sound Profile', 'Analog')

View file

@ -0,0 +1,9 @@
import subprocess
from libqtile import widget
class CheckUpdates(widget.CheckUpdates):
def __init__(self, **config):
super().__init__(**config)
self.cmd_dict.update({'Arch': ('pikaur -Sup', 0)})

View file

@ -0,0 +1,5 @@
from libqtile.config import Screen
from bars import top
screens = [Screen(top=top)]

View file

@ -0,0 +1,19 @@
#!/bin/bash
function run {
if ! pgrep "$1"; then
"$@" &
fi
}
setxkbmap -layout de
run nm-applet
run xfce4-power-manager
run blueberry-tray
run picom
run volumeicon
# run deadd-notification-center
run /usr/bin/lxqt-policykit-agent
run nitrogen --restore

View file

@ -0,0 +1,12 @@
{
"black": "#01060e",
"red": "#ea6c73",
"green": "#91b362",
"yellow": "#f9af4f",
"blue": "#53bdfa",
"purple": "#fae994",
"cyan": "#90e1c6",
"white": "#c7c7c7",
"background": "#brb1ad",
"foreground": "#0a0e14"
}

View file

@ -0,0 +1,12 @@
{
"black": "#21222c",
"red": "#ff5555",
"green": "#50fa7b",
"yellow": "#ffcb6b",
"blue": "#82aaff",
"purple": "#c792ea",
"cyan": "#8be9fd",
"white": "#f8f8f2",
"background": "#212121",
"foreground": "#f8f8f2"
}

View file

@ -0,0 +1,12 @@
{
"black": "#322931",
"red": "#dd464c",
"green": "#8fc13e",
"yellow": "#fdcc59",
"blue": "#1290bf",
"purple": "#c85e7c",
"cyan": "#149b93",
"white": "#b9b5b8",
"background": "#322931",
"foreground": "#b9b5b8"
}

View file

@ -0,0 +1,12 @@
{
"black": "#000000",
"red": "#ff5370",
"green": "#c3e88d",
"yellow": "#ffcb6b",
"blue": "#82aaff",
"purple": "#c792ea",
"cyan": "#89ddff",
"white": "#ffffff",
"background": "#212121",
"foreground": "#eeffff"
}

View file

@ -0,0 +1,12 @@
{
"black": "#3b4252",
"red": "#bf616a",
"green": "#a3be8c",
"yellow": "#ebcb8b",
"blue": "#81a1c1",
"purple": "#b48ead",
"cyan": "#88c0d0",
"white": "#e5e9f0",
"background": "#2e3440",
"foreground": "#d8dee9"
}

View file

@ -0,0 +1,12 @@
{
"black": "#131613",
"red": "#e06c75",
"green": "#98c379",
"yellow": "#d19a66",
"blue": "#61afef",
"purple": "#c678dd",
"cyan": "#56b6c2",
"white": "#abb2bf",
"background": "#282c34",
"foreground": "#abb2bf"
}

View file

@ -0,0 +1,12 @@
{
"black": "#5a5a5a",
"red": "#ca372d",
"green": "#4d7b3a",
"yellow": "#d4d697",
"blue": "#4387cf",
"purple": "#b86cb4",
"cyan": "#72d5c6",
"white": "#ced4cd",
"background": "#191919",
"foreground": "#c3cac2"
}

View file

@ -0,0 +1,12 @@
{
"black": "#241f2b",
"red": "#91284c",
"green": "#23801c",
"yellow": "#b49d27",
"blue": "#6580b0",
"purple": "#674d96",
"cyan": "#8aaabe",
"white": "#524966",
"background": "#100815",
"foreground": "#514968"
}

View file

@ -0,0 +1,12 @@
{
"black": "#17384c",
"red": "#d15123",
"green": "#027c9b",
"yellow": "#fca02f",
"blue": "#1e4950",
"purple": "#68d4f1",
"cyan": "#50a3b5",
"white": "#deb88d",
"background": "#09141b",
"foreground": "#deb88d"
}

View file

@ -0,0 +1,12 @@
{
"black": "#000000",
"red": "#b84131",
"green": "#7da900",
"yellow": "#c4a500",
"blue": "#62a3c4",
"purple": "#ba8acc",
"cyan": "#207383",
"white": "#a1a1a1",
"background": "#1b1b1b",
"foreground": "#f7f7f7"
}

View file

@ -0,0 +1,12 @@
{
"black": "#6e5346",
"red": "#e35b00",
"green": "#5cab96",
"yellow": "#e3cd7b",
"blue": "#0f548b",
"purple": "#e35b00",
"cyan": "#06afc7",
"white": "#f0f1ce",
"background": "#0a1e24",
"foreground": "#ecf0c1"
}

View file

@ -0,0 +1,12 @@
{
"black": "#000000",
"red": "#b04b57",
"green": "#87b379",
"yellow": "#e5c179",
"blue": "#7d8fa4",
"purple": "#a47996",
"cyan": "#85a7a5",
"white": "#b3b8c3",
"background": "#20242d",
"foreground": "#b3b8c3"
}

View file

@ -0,0 +1,12 @@
{
"black": "#050505",
"red": "#e9897c",
"green": "#b6377d",
"yellow": "#ecebbe",
"blue": "#a9cdeb",
"purple": "#75507b",
"cyan": "#c9caec",
"white": "#f2f2f2",
"background": "#1a1a1a",
"foreground": "#acacab"
}

View file

@ -0,0 +1,12 @@
{
"black": "#000000",
"red": "#d54e53",
"green": "#b9ca4a",
"yellow": "#e7c547",
"blue": "#7aa6da",
"purple": "#c397d8",
"cyan": "#70c0b1",
"white": "#ffffff",
"background": "#000000",
"foreground": "#eaeaea"
}

View file

@ -0,0 +1,72 @@
shell = "zsh"
# own files
[plugins.compinit]
local = "~/.config/zsh/files/"
use = ["compinit.zsh"]
# completions
[plugins.completions]
github = "zsh-users/zsh-completions"
# lscolors
[plugins.lscolors]
github = "trapd00r/LS_COLORS"
# plugins
[plugins.omzlib]
github = "ohmyzsh/ohmyzsh"
dir = "lib"
use = ["{completion,key-bindings,history,directories}.zsh"]
[plugins.omzplugins]
github = "ohmyzsh/ohmyzsh"
dir = "plugins"
use = ["{systemd,command-not-found,ssh-agent}/*.plugin.zsh"]
[plugins.fzftab]
github = "Aloxaf/fzf-tab"
[plugins.fzfmarks]
github = "urbainvaes/fzf-marks"
[plugins.evalcache]
github = "mroth/evalcache"
[plugins.colorize]
github = "zpm-zsh/colorize"
[plugins.wakatime]
github = "sobolevn/wakatime-zsh-plugin"
[plugins.titles]
github = "amyreese/zsh-titles"
[plugins.thefuck]
github = "laggardkernel/zsh-thefuck"
[plugins.eza]
github = "twopizza9621536/zsh-eza"
[plugins.bat]
github = "fdellwing/zsh-bat"
[plugins.youshoulduse]
github = "MichaelAquilina/zsh-you-should-use"
[plugins.asdf]
github = "asdf-vm/asdf"
[plugins.abbr]
github = "olets/zsh-abbr"
use = ["zsh-abbr.zsh"]
[plugins.autosuggestions]
github = "zsh-users/zsh-autosuggestions"
[plugins.syntaxhighlighting]
github = "zsh-users/zsh-syntax-highlighting"
[plugins.ownconfigs]
local = "~/.config/zsh/files/"
use = ["{bashcomps,evalstuff,options,sshcomp,aliases,functions,distroicon}.zsh"]

8
dot_config/starship.toml Normal file
View file

@ -0,0 +1,8 @@
add_newline = false
format = """$env_var $all"""
[env_var.DISTROICON]
format = '[$env_value](white)'
variable = "DISTROICON"
disabled = false

View file

@ -1,14 +1,9 @@
[misc]
# Don't ask for confirmations
#assume_yes = true
# Disable specific steps - same options as the command line flag
{{- if eq .chezmoi.osRelease.id "endeavouros" }}
disable = ["tldr", "pip3", "node", "vim", "git_repos", "containers", "asdf", "distrobox", "helix", "composer", "yarn", "cargo", "remotes", "rustup", "vscode", "powershell", "dotnet", "flatpak", "shell", "snap", "sheldon", "clam_av_db", "helm", "certbot", "bun", "bun_packages", "jet_brains_toolbox", "nix"]
{{- else }}
disable = ["tldr", "pip3", "node", "vim", "git_repos", "containers", "asdf", "distrobox", "helix", "composer", "yarn", "cargo", "remotes", "rustup", "vscode", "powershell", "dotnet", "flatpak", "shell", "snap", "sheldon", "clam_av_db", "helm", "certbot", "bun", "bun_packages", "jet_brains_toolbox", "firmware"]
{{- end }}
disable = ["tldr", "pip3", "node", "vim", "git_repos", "containers", "asdf", "distrobox", "helix", "composer", "yarn", "cargo", "remotes", "rustup", "vscode", "powershell", "dotnet", "flatpak", "shell", "snap", "firmware", "clam_av_db"]
# Skip Notify
skip_notify = true
@ -26,11 +21,11 @@ skip_notify = true
#run_in_tmux = true
# List of remote machines with Topgrade installed on them
{{- if eq .chezmoi.hostname "pxm" }}
remote_topgrades = ["mail"]
{{- else }}
remote_topgrades = ["pxm", "web", "kube", "kali", "uptime"]
{{- end }}
{{ if eq .chezmoi.hostname "pxm" }}
remote_topgrades = ["docker", "kali", "mail"]
{{ else }}
remote_topgrades = ["pxm", "web", "infra"]
{{ end }}
# Arguments to pass SSH when upgrading remote systems
#ssh_arguments = "-o ConnectTimeout=2"

View file

@ -0,0 +1,8 @@
abbr -g "g"="git"
abbr -g "git m"="git checkout main"
abbr -g "git rei"="git rebase -i"
abbr -g "git reim"="git rebase -i main"
abbr -g "git ri"="git rebase -i"
abbr "m"="git checkout main"
abbr "rei"="git rebase -i"
abbr "reim"="git rebase -i main"

View file

@ -0,0 +1 @@
# create the file

View file

@ -1,35 +0,0 @@
# ohmyzsh
getantidote/use-omz
ohmyzsh/ohmyzsh path:lib
# omz plugins
ohmyzsh/ohmyzsh path:plugins/systemd
ohmyzsh/ohmyzsh path:plugins/command-not-found
ohmyzsh/ohmyzsh path:plugins/fzf
ohmyzsh/ohmyzsh path:plugins/ssh-agent
# utility plugins
trapd00r/LS_COLORS
3v1n0/zsh-bash-completions-fallback
QuarticCat/zsh-smartcache
unixorn/warhol.plugin.zsh
twopizza9621536/zsh-eza
fdellwing/zsh-bat
amyreese/zsh-titles
Aloxaf/fzf-tab
{{- if eq .chezmoi.osRelease.id "endeavouros" }}
sunlei/zsh-ssh
{{- end }}
# other plugins
urbainvaes/fzf-marks
{{- if eq .chezmoi.osRelease.id "endeavouros" }}
sobolevn/wakatime-zsh-plugin
{{- end }}
laggardkernel/zsh-thefuck
MichaelAquilina/zsh-you-should-use
# fish like (load last)
zsh-users/zsh-completions path:src kind:fpath
zsh-users/zsh-autosuggestions
zdharma-continuum/fast-syntax-highlighting

View file

@ -40,21 +40,17 @@ export GNUPGHOME="$XDG_DATA_HOME"/gnupg
export W3M_DIR="$XDG_DATA_HOME"/w3m
export GIBO_BOILERPLATES="$XDG_DATA_HOME"/giboboilerplates
export REDISCLI_HISTFILE="$XDG_DATA_HOME"/redis/history
export IPFS_PATH="$XDG_DATA_HOME"/ipfs
# other programs
export LESSHISTFILE="$XDG_STATE_HOME"/less/history
{{- if eq .chezmoi.osRelease.id "endeavouros" }}
export EDITOR=nvim
{{- else }}
export EDITOR=vim
{{- end }}
export ZSH_WAKATIME_BIN=/usr/bin/wakatime
export PYTHONSTARTUP=/etc/python/pythonrc
# stuff
export ZELLIJ_AUTO_ATTACH=true
export ZELLIJ_AUTO_EXIT=true
export TERMINALNAME=$(fastfetch --pipe -s Terminal 2>/dev/null | awk '{print $2}')
export MANROFFOPT="-c"
export FZF_DEFAULT_OPTS='--color=fg:#f8f8f2,bg:#282a36,hl:#bd93f9 --color=fg+:#f8f8f2,bg+:#44475a,hl+:#bd93f9 --color=info:#ffb86c,prompt:#50fa7b,pointer:#ff79c6 --color=marker:#ff79c6,spinner:#ffb86c,header:#6272a4'
@ -64,9 +60,8 @@ export HISTSIZE=$(( 1.2 * SAVEHIST ))
export ZSH_CACHE_DIR="$XDG_CACHE_HOME"/zsh
export HISTFILE="$ZSH_CACHE_DIR"/history
export GPG_TTY="$TTY"
unset FZF_MARKS_JUMP
{{- if eq .chezmoi.osRelease.id "endeavouros" }}
{{ if eq .chezmoi.osRelease.id "endeavouros" }}
export DIFFPROG='meld'
{{- end }}
{{ end }}
export AUTO_NTFY_DONE_IGNORE="ntfy emacs htop info less mail man meld most mutt nano screen ssh tail tmux top vi vim watch bat cat kate topgrade"
export EXA_COLORS="uu=36:gu=37:sn=32:sb=32:da=34:ur=34:uw=35:ux=36:ue=36:gr=34:gw=35:gx=36:tr=34:tw=35:tx=36"

25
dot_config/zsh/dot_zshrc Normal file
View file

@ -0,0 +1,25 @@
test -v DISTROBOX_HOST_HOME && { unset ZDOTDIR; exec zsh } # fix distrobox
test "x$TERMINALNAME" = "xalacritty" && eval "$(zellij setup --generate-auto-start zsh)" # autostart zellij only in alacritty
# deduplicate path
typeset -U path PATH
path+=("$XDG_DATA_HOME"/JetBrains/Toolbox/scripts) # jetbrains toolbox
path+=("$HOME"/.local/bin) # local bin
# startup banner
potentialBanner=('joke bofh' 'joke dad' 'fastfetch') # 'colorscript random' 'joke hq dijkstra' 'joke hq knuth' 'joke hq perlis' 'joke hq mimsc'
eval "$potentialBanner[$RANDOM%$#potentialBanner+1]"
# disable flowcontrol
stty -ixon
# source plugins
eval "$(sheldon source)"
# local overrides
for sourced in "$XDG_DATA_HOME"/zsh/files/*; do source $sourced; done
# theme
#potentialTheme=('emodipt-extend') # 'kali' 'lambda' 'bubblesextra' 'illusi0n' 'nordtron' 'di4am0nd' 'atomic'
#eval "$(oh-my-posh init zsh --config="$XDG_CACHE_HOME/oh-my-posh/themes/$potentialTheme[$RANDOM%$#potentialTheme+1].omp.json")"
eval "$(oh-my-posh init zsh --config="$XDG_CACHE_HOME/oh-my-posh/themes/emodipt-extend.omp.json")"

View file

@ -1,53 +0,0 @@
{{- if eq .chezmoi.osRelease.id "endeavouros" }}
test -v DISTROBOX_HOST_HOME && { unset ZDOTDIR; exec zsh }
test -v SSH_CONNECTION && eval "$(zellij setup --generate-auto-start zsh)"
{{- end }}
# options
setopt NO_CLOBBER
unsetopt FLOW_CONTROL
# deduplicate path
typeset -U path PATH
{{- if eq .chezmoi.osRelease.id "endeavouros" }}
path+=("$XDG_DATA_HOME"/JetBrains/Toolbox/scripts) # jetbrains toolbox
path+=("$XDG_DATA_HOME/mise/shims") # mise
path+=("$XDG_CONFIG_HOME"/composer/vendor/bin) # composer
{{- end }}
path+=("$HOME"/.local/bin) # local bin
# startup banner
potentialBanner=('joke bofh' 'joke dad' 'fastfetch')
eval "$potentialBanner[$RANDOM%$#potentialBanner+1]"
# antidote
{{- if eq .chezmoi.osRelease.id "endeavouros" }}
source '/usr/share/zsh-antidote/antidote.zsh'
{{- else }}
test -r "$XDG_DATA_HOME"/antidote/antidote.zsh || git clone https://github.com/mattmc3/antidote.git "$XDG_DATA_HOME"/antidote
source "$XDG_DATA_HOME"/antidote/antidote.zsh
{{- end }}
zstyle ':antidote:bundle' use-friendly-names 'yes'
antidote load
# load programs
smartcache eval zoxide init --cmd cd zsh
smartcache eval atuin init zsh
smartcache eval direnv hook zsh
{{- if eq .chezmoi.osRelease.id "endeavouros" }}
eval "$(mise activate zsh)"
{{- end }}
{{- if eq .chezmoi.osRelease.id "endeavouros" }}
zstyle ':completion:*:(scp|sftp|rsh|rsync):*' hosts ${=${${(f)"$(cat ~/.ssh/known_hosts/{default,priv,work/*}(|2)(N) /dev/null)"}%%[# ]*}//,/ }
{{- end }}
# source files
source "$ZDOTDIR"/files/aliases.zsh
# local overrides
for sourced in "$XDG_DATA_HOME"/zsh/*; do source $sourced; done
# theme
ompTheme="https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/themes/emodipt-extend.omp.json"
eval "$(oh-my-posh init zsh --config="$ompTheme")"

View file

@ -1,3 +1,6 @@
# temp fix for eza
alias ls='eza -F -gh --group-directories-first --git --git-ignore --icons --color-scale all --hyperlink'
alias grep='rg'
alias find='fd'
@ -16,66 +19,3 @@ if (( ${+commands[nvim]} )); then alias vim="nvim"; fi
alias peda="gdb -iex 'source /usr/share/peda/peda.py' --nh -q"
alias gef="gdb -iex 'source /usr/share/gef/gef.py' --nh -q"
alias pwndbg="gdb -iex 'source /usr/share/pwndbg/gdbinit.py' --nh -q"
# add previous command to pet
function prev() {
PREV=$(fc -lrn | head -n 1)
sh -c "pet new `printf %q "$PREV"`"
}
# select from pet snippets
function petselect() {
BUFFER=$(pet search --query "$LBUFFER")
CURSOR=$#BUFFER
zle redisplay
}
zle -N petselect
bindkey '^s' petselect
# ranger as cli file manager
function runranger() {
echo
ranger < $TTY
zle redisplay
}
zle -N runranger
bindkey '^f' runranger
function yy() {
if [ -n "$YAZI_LEVEL" ]; then
exit
fi
local tmp="$(mktemp -t "yazi-cwd.XXXXX")"
yazi "$@" --cwd-file="$tmp"
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
cd -- "$cwd"
fi
rm -f -- "$tmp"
}
bindkey -s "^y" "yy\n"
function ss() {
command grc --colour=auto ss "$@"
}
function gi() {
curl -sLw "\n" "https://www.toptal.com/developers/gitignore/api/$@"
}
function findfile() {
local search
if test "$1" = "--update"; then
sudo updatedb
shift
search=$1
else
search=$1
fi
locate "$PWD*$search*"
}
function scanKeys() {
ssh-keyscan $1 | grep -v '#'
}

View file

@ -0,0 +1,11 @@
if (( ${+commands[distrobox]} )); then
source /usr/share/bash-completion/completions/distrobox
source /usr/share/bash-completion/completions/distrobox-create
source /usr/share/bash-completion/completions/distrobox-enter
source /usr/share/bash-completion/completions/distrobox-ephemeral
source /usr/share/bash-completion/completions/distrobox-generate-entry
source /usr/share/bash-completion/completions/distrobox-list
source /usr/share/bash-completion/completions/distrobox-rm
source /usr/share/bash-completion/completions/distrobox-stop
source /usr/share/bash-completion/completions/distrobox-upgrade
fi

View file

@ -0,0 +1,4 @@
mkdir -p "$XDG_CACHE_HOME"/zsh &>/dev/null
autoload -Uz compinit
compinit -d "$XDG_CACHE_HOME"/zsh/compdump

View file

@ -0,0 +1,33 @@
# find out which distribution we are running on
FILE="/etc/*-release"
if [[ -f $FILE ]]; then
_distro=$(awk '/^ID=/' /etc/*-release | awk -F'=' '{ print tolower($2) }')
fi
# set an icon based on the distro
case $_distro in
*kali*) ICON="ﴣ";;
*arch*|*endeavouros*) ICON="";;
*debian*) ICON="";;
*raspbian*) ICON="";;
*ubuntu*) ICON="";;
*elementary*) ICON="";;
*fedora*) ICON="";;
*coreos*) ICON="";;
*gentoo*) ICON="";;
*mageia*) ICON="";;
*centos*) ICON="";;
*opensuse*|*tumbleweed*) ICON="";;
*sabayon*) ICON="";;
*slackware*) ICON="";;
*linuxmint*) ICON="";;
*alpine*) ICON="";;
*aosc*) ICON="";;
*nixos*) ICON="";;
*devuan*) ICON="";;
*manjaro*) ICON="";;
*rhel*) ICON="";;
*) ICON="";;
esac
export DISTROICON="$ICON"

View file

@ -0,0 +1,8 @@
# evalstuff
_evalcache fzf --zsh
_evalcache zoxide init --cmd cd zsh
_evalcache atuin init zsh
_evalcache navi widget zsh
_evalcache direnv hook zsh
#_evalcache ntfy shell-integration
#eval "$(keychain --dir "$XDG_CACHE_HOME"/keychain --eval --quiet id_rsa)"

View file

@ -0,0 +1,20 @@
pet_select () {
BUFFER=$(pet search --query "$LBUFFER")
CURSOR=$#BUFFER
zle redisplay
}
zle -N pet_select
bindkey '^s' pet_select
prev () {
PREV=$(fc -lrn | head -n 1)
sh -c "pet new $(printf %q "$PREV")"
}
run_ranger () {
echo
ranger < $TTY
zle redisplay
}
zle -N run_ranger
bindkey '^f' run_ranger

View file

@ -0,0 +1,195 @@
export ALIASES_FILE="$XDG_CONFIG_HOME"/aliasesrc
function mal {
# Use fzf to allow the user to select an alias from the aliases file
function _execute_alias {
local alias_to_execute=$(cut -d' ' -f2- "$ALIASES_FILE" | fzf)
# Check if the user cancelled the selection
test -z $alias_to_execute && return 1
echo "Executing alias: $alias_to_execute"
# Execute the selected alias
eval ${alias_to_execute%%=*}
return 0
}
# Delete an existing alias by selecting it from a list
function _interactive_delete {
local alias_to_delete=$(cut -d' ' -f2- "$ALIASES_FILE" | fzf)
# Check if the user cancelled the selection
test -z $alias_to_delete && return 1
echo "Deleted alias: $alias_to_delete"
# Delete the selected alias from the aliases file
sed -i "/^alias ${alias_to_delete%%=*}=/d" "$ALIASES_FILE"
unalias ${alias_to_delete%%=*}
}
# Delete an existing alias using specified name
function _parameter_delete {
local alias_to_delete=$1
local line_with_alias=$(grep "$1=" "$ALIASES_FILE")
# Check if the alias exists in the aliases file
if test -z "$line_with_alias"; then
echo "No alias with the name $1 found."
return 2
fi
echo "Deleted alias: $alias_to_delete"
# Delete the selected alias from the aliases file
sed -i "/^alias ${alias_to_delete%%=*}=/d" "$ALIASES_FILE"
unalias ${alias_to_delete%%=*}
}
# Rename an existing alias by selecting it from a list
function _interactive_rename {
local alias_to_rename=$(cut -d' ' -f2- "$ALIASES_FILE" | fzf)
# Check if the user cancelled the selection
test -z $alias_to_rename && return 1
echo "Input new name:"
read new_name
echo "Renaming alias from $alias_to_rename to $new_name"
sed -i "s/^alias ${alias_to_rename%%=*}=/alias ${new_name}=/g" "$ALIASES_FILE"
unalias ${alias_to_rename%%=*}
}
# Rename an existing alias using specified old and new names
function _parameter_rename {
local old_alias_name=$1
local new_alias_name=$2
local line_with_alias=$(grep "^alias ${old_alias_name}=" "$ALIASES_FILE")
if test -z "$line_with_alias"; then
echo "No alias with the name $old_alias_name found."
return 1
fi
echo "Renaming alias from $old_alias_name to $new_alias_name"
sed -i "s/^alias ${old_alias_name}=/alias ${new_alias_name}=/g" "$ALIASES_FILE"
unalias ${old_alias_name}
}
# Change the command associated with an existing alias by selecting it from a list
function _interactive_command_change {
local alias_to_change=$(cut -d' ' -f2- "$ALIASES_FILE" | fzf)
# Check if the user cancelled the selection
test -z $alias_to_change && return 1
echo "Input new command:"
read new_command
echo "Changing command for alias ${alias_to_change%%=*} to \"$new_command\""
sed -i "/^alias ${alias_to_change%%=*}=/{s/=.*/=\"$new_command\"/}" "$ALIASES_FILE"
}
# Change the command associated with an existing alias using specified name and command
function _parameter_command_change {
local alias_to_change=$1
local new_command="${@:2}"
local line_with_alias=$(grep "$alias_to_change=" "$ALIASES_FILE")
if test -z "$line_with_alias"; then
echo "No alias with the name $alias_to_change found."
return 1
fi
echo "Changing command for alias $alias_to_change to \"$new_command\""
sed -i "/^alias ${alias_to_change}=/{s/=.*/=\"$new_command\"/}" "$ALIASES_FILE"
}
# Add a new alias
function _add_command {
local line_with_alias=$(grep "$1=" "$ALIASES_FILE")
if test ! -z "$line_with_alias"; then
echo "Alias found: $line_with_alias; change alias by using the -c flag."
return 1
fi
local lh="alias $1"
local rh=\"${@:2}\"
local alias_str="$lh=$rh"
echo $alias_str >>"$ALIASES_FILE"
echo "added '$alias_str' to .aliases"
}
# List all aliases from the aliases file
function _list_aliases {
cut -d' ' -f2- "$ALIASES_FILE" | command cat
}
# ==============================================================================================================================================================
action="$1"
param1="$2"
param2="$3"
# Check if the user has provided a help option or no arguments
helpParams=('-h' '--help' '-help')
if (($helpParams[(Ie)$action])) || test $# -eq 0; then
# Display usage information
echo "Usage: mal [OPTION]... [ALIAS_NAME] [ALIAS_COMMAND]..."
echo ""
echo "Create, delete, change, or execute aliases interactively."
echo ""
echo "Options:"
echo " -h, --help display this help and exit"
echo " -l list all defined aliases"
echo " -e execute an alias interactively"
echo " -d delete an alias interactively"
echo " -dn NAME delete an alias by name"
echo " -r rename an alias interactively"
echo " -rn OLD NEW rename an existing alias"
echo " -c change the command associated with an existing alias interactively"
echo " -cc NAME COMMAND change the command associated with an existing alias by name"
return 0
fi
case "$action" in
"-e")
# Execute an alias interactively
_execute_alias
;;
"-l")
# List all aliases
_list_aliases
;;
"-d")
# Delete an alias interactively
_interactive_delete
;;
"-dn")
# Delete an alias using a parameter
_parameter_delete "$param1"
;;
"-r")
# rename an alias interactively
_interactive_rename
;;
"-rn")
# rename an alias using parameters
_parameter_rename "$param1" "$param2"
;;
"-c")
# change a command interactively
_interactive_command_change
;;
"-cc")
# change a command using parameters
_parameter_command_change "$param1" "$param2"
;;
*)
# add a new command
_add_command "$action" "$param1"
;;
esac
# Reload aliases
source "$ALIASES_FILE"
}

View file

@ -0,0 +1,5 @@
setopt NO_CLOBBER
setopt INTERACTIVE_COMMENTS
setopt HASH_EXECUTABLES_ONLY
setopt NUMERIC_GLOB_SORT
unsetopt FLOW_CONTROL

View file

@ -0,0 +1,24 @@
zstyle ':completion:*:(ssh|scp|sshfs|mosh|rsync):*' sort false
zstyle ':completion:*:(ssh|scp|sshfs|mosh|rsync):*' group-name ''
zstyle ':completion:*:(ssh|scp|sshfs|mosh|rsync):*' verbose yes
zstyle ':completion:*:(ssh|scp|sshfs|mosh|rsync):*' tag-order 'hosts:-host:host hosts:-domain:domain hosts:-ipaddr:ip\ address *'
zstyle ':completion:*:(scp|sshfs|rsync):*' group-order users files all-files hosts-domain hosts-host hosts-ipaddr
zstyle ':completion:*:(ssh|mosh):*' group-order users hosts-domain hosts-host users hosts-ipaddr
zstyle ':completion:*:(ssh|scp|sshfs|mosh|rsync):*:users' ignored-patterns '*'
zstyle ':completion:*:(ssh|scp|sshfs|mosh|rsync):*:hosts-host' ignored-patterns '*(.|:)*' loopback localhost broadcasthost 'ip6-*' 'hbz*'
zstyle ':completion:*:(ssh|scp|sshfs|mosh|rsync):*:hosts-domain' ignored-patterns '<->.<->.<->.<->' '^[-[:alnum:]]##(.[-[:alnum:]]##)##' '*@*' '*.eeleater.org' '*.hbz-nrw.de'
zstyle ':completion:*:(ssh|scp|sshfs|mosh|rsync):*:hosts-ipaddr' ignored-patterns '^(<->.<->.<->.<->|(|::)([[:xdigit:].]##:(#c,2))##(|%*))' '127.*' '255.255.255.255' '::1' 'fe80::*' 'ff02::*'
[ -r ~/.ssh/config ] && _ssh_config=($(cat ~/.ssh/config | sed -ne 's/Host[=\t ]//p')) || _ssh_config=()
[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _global_ssh_hosts=()
[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
[ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
hosts=(
# "$_ssh_config[@]"
"$_global_ssh_hosts[@]"
"$_ssh_hosts[@]"
"$_etc_hosts[@]"
)
zstyle ':completion:*:hosts' hosts $hosts

View file

@ -1,7 +0,0 @@
#!/bin/bash
cd "$HOME"/Dokumente/files/code/websites/zola/hook || exit
zola build
scp -r public web:site
ssh web 'sudo rm -rf /srv/site; sudo mv site /srv'

0
dot_local/bin/executable_installOhMyPosh Normal file → Executable file
View file

View file

@ -2,14 +2,14 @@
case "$1" in
"dad")
joke=$(curl -sH "Accept: text/plain" 'https://icanhazdadjoke.com/')
joke=$(/usr/bin/curl -sH "Accept: text/plain" 'https://icanhazdadjoke.com/')
echo "Daily Dad Joke: $joke"
;;
"bofh")
file="$HOME/.local/share/bofh"
lines=$(nl "$file" | tail -n 1 | awk '{print $1}')
excuses_file="$HOME/.local/share/bofh"
num_lines=$(nl "$excuses_file" | tail -n 1 | awk '{print $1}')
echo -n "Daily BOFH Excuse: "
awk 'NR=='$((1 + RANDOM % lines ))'{print;exit}' "$file"
awk 'NR=='$((1 + RANDOM % num_lines ))'{print;exit}' "$excuses_file"
;;
"hq")
file="$HOME/.local/share/hackerquotes/$2"
@ -17,8 +17,4 @@ case "$1" in
echo -n "Daily Hackerquote: "
awk 'NR=='$((1 + RANDOM % $lines ))'{print;exit}' "$file"
;;
"fact")
echo "Daily Facts:"
curl -s 'https://randomfactgenerator.net/' | awk -v RS='</div>' '/<div class='\''f'\''>/{gsub(/.*<div class='\''f'\''>/,""); print "- " $0}'
;;
esac

4
dot_local/bin/executable_updateOhMyPosh Normal file → Executable file
View file

@ -1,6 +1,6 @@
#!/bin/bash
newestVersion="$(curl -sL https://api.github.com/repos/JanDeDobbeleer/oh-my-posh/releases/latest | jq -r '.name')"
localVersion="v$(oh-my-posh version)"
newestVersion="$(curl -sL https://api.github.com/repos/JanDeDobbeleer/oh-my-posh/releases/latest | jq -r '.name' | cut -dv -f2)"
localVersion="$(oh-my-posh --version)"
tmpFile="$(mktemp -u)"
test "$newestVersion" != "$localVersion" && {

View file

@ -1,8 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
ZJ_LAYOUT_DIR=$(zellij setup --check | grep "LAYOUT DIR" - | grep -o '".*"' - | tr -d '"')
if [[ -d "${ZJ_LAYOUT_DIR}" ]]; then
ZJ_LAYOUT="$ZJ_LAYOUT_DIR/$(fd --type file . "${ZJ_LAYOUT_DIR}" | sed 's|.*/||' | fzf || exit)"
zellij --layout "${ZJ_LAYOUT}"
fi

View file

@ -1,10 +0,0 @@
#!/usr/bin/env bash
ZJ_SESSIONS=$(zellij list-sessions)
NO_SESSIONS=$(echo "${ZJ_SESSIONS}" | wc -l)
if [ "${NO_SESSIONS}" -ge 2 ]; then
zellij attach \
"$(echo "${ZJ_SESSIONS}" | fzf | cut -d' ' -f1)"
else
zellij attach -c
fi