mirror of
https://codeberg.org/Mo8it/dotfiles.git
synced 2024-12-04 23:40:32 +00:00
Compare commits
10 commits
bda305e456
...
6c0788e091
Author | SHA1 | Date | |
---|---|---|---|
6c0788e091 | |||
72b56e7713 | |||
a2f08f9175 | |||
3791c4011c | |||
ab26c63235 | |||
c6bf454a1b | |||
acdd0e1476 | |||
38b99c57ef | |||
73e4ebe381 | |||
0d6f2c009d |
17 changed files with 99 additions and 296 deletions
|
@ -1,10 +1,8 @@
|
|||
[language-server.rust-analyzer.config.checkOnSave]
|
||||
command = "clippy"
|
||||
|
||||
[[language]]
|
||||
name = "rust"
|
||||
language-server = { command = "rust-analyzer", args = ["-q"] }
|
||||
auto-format = true
|
||||
roots = ["Cargo.toml"]
|
||||
[language.config.checkOnSave]
|
||||
command = "clippy"
|
||||
[language.auto-pairs]
|
||||
'(' = ')'
|
||||
'{' = '}'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
theme = "Dark"
|
||||
scale = 3.0
|
||||
scale = 1.5
|
||||
|
||||
[font-options]
|
||||
regular-font = "Cantarell"
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
gui:
|
||||
expandFocusedSidePanel: true
|
||||
language: "en"
|
||||
mouseEvents: false
|
||||
showBottomLine: false
|
||||
showIcons: true
|
||||
showRandomTip: false
|
||||
sidePanelWidth: 0.15 # From 0 to 1
|
||||
|
||||
git:
|
||||
autoFetch: false
|
||||
# paging:
|
||||
# colorArg: always
|
||||
# pager: delta --dark --paging=never
|
||||
|
||||
os:
|
||||
editCommand: "hx"
|
||||
|
||||
refresher:
|
||||
refreshInterval: 1
|
||||
|
||||
update:
|
||||
method: prompt
|
||||
days: 2
|
|
@ -1,59 +0,0 @@
|
|||
let-env config = {
|
||||
show_banner: false
|
||||
}
|
||||
|
||||
# Setup
|
||||
## Starship
|
||||
source ~/.nu/starship/init.nu
|
||||
## Zoxide
|
||||
source ~/.nu/zoxide.nu
|
||||
|
||||
# Aliases
|
||||
## Safety options
|
||||
alias rm = trash
|
||||
alias cp = cp -i
|
||||
alias mv = mv -i
|
||||
|
||||
## Default options
|
||||
alias rsync = rsync -avhL --partial --zc=zstd --zl=8 --no-i-r --info=progress2
|
||||
alias onefetch = onefetch --no-color-palette
|
||||
|
||||
## Podman
|
||||
alias sage = podman run --pull newer -it --rm docker.io/sagemath/sagemath:latest
|
||||
alias sage-jupyter = podman run --pull newer -it --rm -p8888:8888 docker.io/sagemath/sagemath:latest sage-jupyter
|
||||
|
||||
alias fedora = podman run --pull newer -it --rm registry.fedoraproject.org/fedora:(rpm -E %fedora)
|
||||
|
||||
alias adoc = podman run --pull newer -it --rm -v (pwd):/documents/:Z docker.io/asciidoctor/docker-asciidoctor:latest
|
||||
|
||||
alias pps = podman ps --format '{{.Names}}'
|
||||
|
||||
## Replacements
|
||||
alias cd = z
|
||||
alias cat = bat
|
||||
alias lg = lazygit
|
||||
alias zola = flatpak run org.getzola.zola
|
||||
|
||||
# Functions
|
||||
def tal [project: string, ...args: string] {
|
||||
task add $"project:($project)" priority:L $args
|
||||
}
|
||||
|
||||
def tam [project: string, ...args: string] {
|
||||
task add $"project:($project)" priority:M $args
|
||||
}
|
||||
|
||||
def tah [project: string, ...args: string] {
|
||||
task add $"project:($project)" priority:H $args
|
||||
}
|
||||
|
||||
def vp [project: string] {
|
||||
vit $"project:($project)"
|
||||
}
|
||||
|
||||
def julia [...args: string] {
|
||||
JULIA_NUM_THREADS=16 LD_PRELOAD=/usr/lib64/libstdc++.so.6 ~/.julia/juliaup/bin/julia
|
||||
}
|
||||
|
||||
# Private config
|
||||
source ~/.config/nushell/private_config.nu
|
|
@ -1,6 +0,0 @@
|
|||
# Zoxide
|
||||
zoxide init nushell | save ~/.nu/zoxide.nu
|
||||
|
||||
# Starship
|
||||
# TODO: Remove str replace after starship update
|
||||
starship init nu | str replace --string "term size -c" "term size" | save ~/.nu/starship/init.nu
|
|
@ -1,52 +0,0 @@
|
|||
local wezterm = require("wezterm")
|
||||
local act = wezterm.action
|
||||
local mux = wezterm.mux
|
||||
|
||||
wezterm.on("gui-startup", function(cmd)
|
||||
local tab, pane, window = mux.spawn_window({ args = cmd.args })
|
||||
window:gui_window():maximize()
|
||||
end)
|
||||
|
||||
return {
|
||||
default_prog = { "/home/mo/.cargo/bin/zellij" },
|
||||
|
||||
disable_default_key_bindings = true,
|
||||
keys = {
|
||||
{ key = "V", mods = "SHIFT|CTRL", action = act.PasteFrom("Clipboard") },
|
||||
{ key = "_", mods = "SHIFT|CTRL", action = act.DecreaseFontSize },
|
||||
{ key = "*", mods = "SHIFT|CTRL", action = act.IncreaseFontSize },
|
||||
{ key = "=", mods = "SHIFT|CTRL", action = act.ResetFontSize },
|
||||
},
|
||||
|
||||
disable_default_mouse_bindings = true,
|
||||
mouse_bindings = {
|
||||
{
|
||||
event = { Up = { streak = 1, button = "Left" } },
|
||||
mods = "SHIFT",
|
||||
action = act.OpenLinkAtMouseCursor,
|
||||
},
|
||||
},
|
||||
|
||||
cursor_blink_rate = 0,
|
||||
|
||||
enable_tab_bar = false,
|
||||
|
||||
enable_scroll_bar = false,
|
||||
scrollback_lines = 0,
|
||||
|
||||
window_decorations = "RESIZE",
|
||||
window_padding = {
|
||||
left = "0cell",
|
||||
right = "0cell",
|
||||
top = "0cell",
|
||||
bottom = "0cell",
|
||||
},
|
||||
|
||||
audible_bell = "Disabled",
|
||||
|
||||
allow_win32_input_mode = false,
|
||||
|
||||
automatically_reload_config = false,
|
||||
|
||||
check_for_updates = false,
|
||||
}
|
|
@ -5,6 +5,8 @@ mouse_mode false
|
|||
default_shell "/usr/bin/fish"
|
||||
scrollback_editor "/home/mo/.cargo/bin/hx"
|
||||
|
||||
theme "dracula"
|
||||
|
||||
keybinds clear-defaults=true {
|
||||
normal {
|
||||
bind "Alt l" { NextSwapLayout; }
|
||||
|
@ -21,7 +23,7 @@ keybinds clear-defaults=true {
|
|||
bind "Alt t" { NewTab; }
|
||||
bind "Alt o" { GoToNextTab; }
|
||||
bind "Alt i" { GoToPreviousTab; }
|
||||
bind "Alt D" { Detach; }
|
||||
bind "Alt X" { CloseTab; }
|
||||
}
|
||||
locked {
|
||||
bind "Alt L" { SwitchToMode "normal"; }
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
swap_tiled_layout name="vertical" {
|
||||
tab max_panes=5 {
|
||||
pane split_direction="vertical" {
|
||||
pane
|
||||
pane { children; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
swap_tiled_layout name="stacked" {
|
||||
tab {
|
||||
pane split_direction="vertical" {
|
||||
pane
|
||||
pane {
|
||||
pane
|
||||
pane stacked=true { children; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
40
.config/zellij/layouts/info_monitor.kdl
Normal file
40
.config/zellij/layouts/info_monitor.kdl
Normal file
|
@ -0,0 +1,40 @@
|
|||
layout {
|
||||
default_tab_template {
|
||||
children
|
||||
pane size=1 borderless=true {
|
||||
plugin location="zellij:compact-bar"
|
||||
}
|
||||
}
|
||||
|
||||
cwd "/home/mo/code/info_monitor"
|
||||
|
||||
tab name="hx" split_direction="vertical" focus=true {
|
||||
pane {
|
||||
focus true
|
||||
command "fish"
|
||||
args "-C" "hx src/main.rs"
|
||||
close_on_exit true
|
||||
}
|
||||
pane {
|
||||
command "bacon"
|
||||
}
|
||||
}
|
||||
tab name="git" split_direction="vertical" {
|
||||
pane {
|
||||
command "fish"
|
||||
args "-C" "gitui"
|
||||
close_on_exit true
|
||||
}
|
||||
}
|
||||
tab name="bg" split_direction="vertical"{
|
||||
pane {
|
||||
command "podman"
|
||||
args "run" "-it" "--rm" "-p" "5432:5432" "-v" "/home/mo/.tmp/info_monitor_db:/var/lib/postgresql/data:Z" "--env-file" ".env" "docker.io/library/postgres:15-alpine"
|
||||
}
|
||||
pane {
|
||||
command "npx"
|
||||
args "tailwindcss" "-mw" "-i" "input.css" "-o" "static/main.css"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -16,9 +16,7 @@ layout {
|
|||
close_on_exit true
|
||||
}
|
||||
pane {
|
||||
command "fish"
|
||||
args "-C" "bacon"
|
||||
close_on_exit true
|
||||
command "bacon"
|
||||
}
|
||||
}
|
||||
tab name="git" split_direction="vertical" {
|
||||
|
@ -30,14 +28,12 @@ layout {
|
|||
}
|
||||
tab name="bg" split_direction="vertical"{
|
||||
pane {
|
||||
command "fish"
|
||||
args "-C" "podman run -it --rm -p 5432:5432 --env-file .env docker.io/library/postgres:15-alpine"
|
||||
close_on_exit true
|
||||
command "podman"
|
||||
args "run" "-it" "--rm" "-p" "5432:5432" "-v" "/home/mo/.tmp/oxiform_db:/var/lib/postgresql/data:Z" "--env-file" ".env" "docker.io/library/postgres:15-alpine"
|
||||
}
|
||||
pane {
|
||||
command "fish"
|
||||
args "-C" "npx tailwindcss -mw -i input.css -o static/main.css"
|
||||
close_on_exit true
|
||||
command "npx"
|
||||
args "tailwindcss" "-mw" "-i" "input.css" "-o" "static/main.css"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
/var/home/mo/.dotfiles/.config/zellij/layouts/default.swap.kdl
|
|
@ -6,19 +6,13 @@ layout {
|
|||
}
|
||||
}
|
||||
|
||||
cwd "/home/mo/Downloads/pgp"
|
||||
cwd "/home/mo/code/pgp"
|
||||
|
||||
tab name="jupyterlab" focus=true {
|
||||
pane {
|
||||
focus true
|
||||
command "fish"
|
||||
args "-c" "./container.fish"
|
||||
close_on_exit true
|
||||
}
|
||||
}
|
||||
tab name="shell" {
|
||||
pane {
|
||||
command "fish"
|
||||
close_on_exit true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,49 +1,51 @@
|
|||
layout {
|
||||
pane split_direction="vertical" {
|
||||
pane {
|
||||
command "fish"
|
||||
args "-c" "~/.scripts/update.py rpm-ostree"
|
||||
close_on_exit true
|
||||
}
|
||||
pane focus=true {
|
||||
command "fish"
|
||||
args "-c" "~/.scripts/update.py flatpak"
|
||||
close_on_exit true
|
||||
default_tab_template {
|
||||
children
|
||||
pane size=1 borderless=true {
|
||||
plugin location="zellij:compact-bar"
|
||||
}
|
||||
}
|
||||
|
||||
pane split_direction="vertical" {
|
||||
pane {
|
||||
command "fish"
|
||||
args "-c" "~/.scripts/update.py cargo"
|
||||
close_on_exit true
|
||||
tab name="update" split_direction="horizontal" focus=true {
|
||||
pane split_direction="vertical" {
|
||||
pane {
|
||||
command "rpm-ostree"
|
||||
args "upgrade"
|
||||
}
|
||||
pane {
|
||||
focus true
|
||||
command "fish"
|
||||
args "-c" "flatpak update -y && flatpak --delete-data --unused"
|
||||
}
|
||||
}
|
||||
pane {
|
||||
cwd "/home/mo/code/compile/helix"
|
||||
command "fish"
|
||||
args "-c" "git pull -r && cargo +stable install --path helix-term"
|
||||
close_on_exit true
|
||||
}
|
||||
}
|
||||
|
||||
pane split_direction="vertical" {
|
||||
pane {
|
||||
cwd "/home/mo/servers/ansible"
|
||||
command "fish"
|
||||
args "-c" "ansible-playbook playbooks/update_dnf.yaml; read -P Enter"
|
||||
close_on_exit true
|
||||
pane split_direction="vertical" {
|
||||
pane {
|
||||
command "fish"
|
||||
args "-c" "rustup update stable && cargo install-update -a"
|
||||
}
|
||||
pane {
|
||||
cwd "/home/mo/code/compile/helix"
|
||||
command "fish"
|
||||
args "-c" "git pull -r && cargo +stable install --path helix-term"
|
||||
}
|
||||
}
|
||||
pane {
|
||||
cwd "/home/mo/servers/ansible"
|
||||
command "fish"
|
||||
args "-c" "ansible-playbook playbooks/update_apt.yaml; read -P Enter"
|
||||
close_on_exit true
|
||||
}
|
||||
pane {
|
||||
cwd "/home/mo/servers/ansible"
|
||||
command "fish"
|
||||
args "-c" "ansible-playbook playbooks/update_local.yaml"
|
||||
close_on_exit true
|
||||
|
||||
pane split_direction="vertical" {
|
||||
pane {
|
||||
cwd "/home/mo/servers/ansible"
|
||||
command "ansible-playbook"
|
||||
args "playbooks/update_dnf.yaml"
|
||||
}
|
||||
pane {
|
||||
cwd "/home/mo/servers/ansible"
|
||||
command "ansible-playbook"
|
||||
args "playbooks/update_apt.yaml"
|
||||
}
|
||||
pane {
|
||||
command "pipx"
|
||||
args "upgrade-all"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,14 +25,12 @@ layout {
|
|||
}
|
||||
tab name="bg" split_direction="vertical"{
|
||||
pane {
|
||||
command "fish"
|
||||
args "-C" "zola serve --open --drafts"
|
||||
close_on_exit true
|
||||
command "just"
|
||||
args "zola"
|
||||
}
|
||||
pane {
|
||||
command "fish"
|
||||
args "-C" "npx tailwindcss -mw -i input.css -o static/main.css"
|
||||
close_on_exit true
|
||||
command "just"
|
||||
args "tailwind"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
/var/home/mo/.dotfiles/.config/zellij/layouts/default.swap.kdl
|
|
@ -1,64 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import subprocess
|
||||
from getpass import getpass
|
||||
from sys import argv
|
||||
|
||||
|
||||
def run(command, **kwargs):
|
||||
return subprocess.run(command, shell=True, **kwargs)
|
||||
|
||||
|
||||
def cap_live_lines(command, **kwargs):
|
||||
lines = []
|
||||
with subprocess.Popen(
|
||||
command, shell=True, stdout=subprocess.PIPE, text=True, **kwargs
|
||||
) as proc:
|
||||
for line in proc.stdout:
|
||||
print(line, end="")
|
||||
lines.append(line.strip())
|
||||
|
||||
return lines
|
||||
|
||||
|
||||
def press_to_exit():
|
||||
getpass("\n<<-<>===EXIT===<>->>")
|
||||
|
||||
|
||||
def update_rpm_ostree():
|
||||
lines = cap_live_lines("rpm-ostree upgrade")
|
||||
|
||||
if "no upgrade" not in lines[-1].lower():
|
||||
press_to_exit()
|
||||
|
||||
|
||||
def update_flatpak():
|
||||
lines = cap_live_lines("flatpak update -y")
|
||||
done_updates = "nothing to do" not in lines[-1].lower()
|
||||
|
||||
run("flatpak remove --delete-data --unused")
|
||||
|
||||
if done_updates:
|
||||
press_to_exit()
|
||||
|
||||
|
||||
def update_cargo():
|
||||
lines = cap_live_lines("rustup update stable && cargo install-update -a")
|
||||
|
||||
if "no packages need updating" not in lines[-2].lower():
|
||||
press_to_exit()
|
||||
|
||||
|
||||
def main(input):
|
||||
if input == "rpm-ostree":
|
||||
update_rpm_ostree()
|
||||
elif input == "flatpak":
|
||||
update_flatpak()
|
||||
elif input == "cargo":
|
||||
update_cargo()
|
||||
else:
|
||||
print(f"Input {input} not valid!")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(argv[1])
|
Loading…
Reference in a new issue