Compare commits

...

21 Commits

Author SHA1 Message Date
Henrik Bakken 8512162cd0 endos.py 2025-10-27 15:42:47 +01:00
Henrik Bakken 22d1213032 minor fixes 2025-10-26 22:33:33 +01:00
Henrik Bakken 4dfa974b3f qutebrowser remove non-working search engines 2025-10-21 20:32:26 +02:00
Henrik Bakken c58cb97c90 updates 2025-10-12 20:02:09 +02:00
Henrik Bakken e7cc6e75e8 nvim fugitive made async 2025-10-10 20:17:48 +02:00
Henrik Bakken 9fdc4166b5 nvim+qutebrowser tweaks 2025-10-06 23:03:46 +02:00
Henrik Bakken cecef6723b manjaro.sh added bandwhich 2025-09-26 23:23:54 +02:00
Henrik Bakken f668bab3be yazi openers 2025-09-26 01:44:57 +02:00
Henrik Bakken c669e01f11 nvim drop vim-table-mode 2025-09-24 21:00:14 +02:00
Henrik Bakken 25952f6986 terminal configs: foot+tmux 2025-09-24 20:58:48 +02:00
Henrik Bakken 4ccaf51e65 nvim lsp only use ty for python 2025-09-24 00:10:15 +02:00
Henrik Bakken 159e756f26 nvim drop Trouble 2025-09-24 00:09:50 +02:00
Henrik Bakken 0e1ed53ff7 nvim lsp pyright added 2025-09-18 11:52:05 +02:00
Henrik Bakken 32016780c4 nvim lspconfig deprecation fix 2025-09-18 11:51:54 +02:00
Henrik Bakken c88cb8d559 hetzner ufw settings 2025-09-18 10:49:34 +02:00
Henrik Bakken b70757a156 nvim neotree unbind / 2025-09-18 10:49:34 +02:00
Henrik Bakken f6513daf77 nvim+mypy 2025-09-12 13:02:23 +02:00
Henrik Bakken ddebef05e0 nvim drop org-mode 2025-09-11 08:45:53 +02:00
Henrik Bakken 0c8da5e9dd nvim bugfix vim-hexokinase build 2025-09-11 08:45:28 +02:00
Henrik Bakken f9a270ac3e nvim pyright root_dir 2025-09-10 21:57:37 +02:00
Henrik Bakken 517d0111aa gitconfig disable diff3 2025-09-10 21:25:47 +02:00
25 changed files with 849 additions and 700 deletions
+2 -2
View File
@@ -13,8 +13,8 @@
required = true required = true
[interactive] [interactive]
diffFilter = delta --color-only diffFilter = delta --color-only
[merge] ; [merge]
conflictstyle = diff3 ; conflictstyle = diff3
[delta] [delta]
navigate = true navigate = true
light = false light = false
-16
View File
@@ -1,16 +0,0 @@
[terminal]
# The VT to run the greeter on. Can be "next", "current" or a number
# designating the VT.
vt = 1
# The default session, also known as the greeter.
[default_session]
# `agreety` is the bundled agetty/login-lookalike. You can replace `/bin/sh`
# with whatever you want started, such as `sway`.
command = "start-sway --unsupported-gpu --config /etc/greetd/sway-config 2> /etc/sway/sway.log"
# The user to run the command as. The privileges this user must have depends
# on the greeter. A graphical greeter may for example require the user to be
# in the `video` group.
user = "greeter"
-2
View File
@@ -1,2 +0,0 @@
sway
bash
-23
View File
@@ -1,23 +0,0 @@
[General]
Backend = GreetD
Theme = sidebar
BlurBackground = true
IconTheme = breeze
[Overrides]
Background = /usr/share/qtgreet/backgrounds/Water.svg
BaseColor = Theme
TextColor = Theme
FontFamily = Noto Sans
[videobg]
File =
Playlist =
[Environment]
[PowerCommands]
Suspend = dbus
Hibernate = dbus
Shutdown = dbus
Reboot = dbus
@@ -0,0 +1,8 @@
[Login]
IdleAction=suspend-then-hibernate
IdleActionSec=10min
HandlePowerKey=suspend-then-hibernate
HandlePowerKeyLongPress=poweroff
HandleLidSwitch=suspend-then-hibernate
HandleLidSwitchExternalPower=suspend-then-hibernate
HandleLidSwitchDocked=ignore
@@ -0,0 +1,2 @@
[sleep]
HibernateDelaySec=30min
-19
View File
@@ -1,19 +0,0 @@
#!/bin/sh
# Session
export XDG_SESSION_TYPE=wayland
export XDG_SESSION_DESKTOP=sway
export XDG_CURRENT_DESKTOP=sway
# Environment
# Source environmental variable from all files in PATH_ENVIRONMENT
# file should be named *.conf and have KEY=value format use # for comment
PATH_ENVIRONMENT=$HOME/.config/environment.d
if [ -d "$PATH_ENVIRONMENT" ]; then
for i in "$PATH_ENVIRONMENT"/*.conf ; do
if [ -f "$i" ]; then
set -a; . "$i"; set +a
fi
done
fi
exec sway "$@"
Executable
+324
View File
@@ -0,0 +1,324 @@
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.13"
# dependencies = [
# "defopt",
# ]
# ///
from difflib import unified_diff
from pathlib import Path
from subprocess import run
from urllib.request import urlretrieve
CFG = Path("~/.config").expanduser()
DOTFILES = Path("~/dotfiles").expanduser()
installmap = dict(
fonts=("noto-fonts-emoji", "ttf-hack", "font-manager"),
nushell=("nushell", "oh-my-posh", "carapace-bin", "zoxide"),
tmux=("tmux", "urlscan"),
nvim=("neovim", "ripgrep"),
utils=("uv", "bat", "ncdu", "unzip", "jq"),
gittools=("tig", "diff-so-fancy", "git-secret", "git-delta", "git-lfs", "lazygit"),
pdftools=("sioyek", "zathura", "zathura-pdf-mupdf", "zathura-djvu", "zathura-ps"),
media=("vlc", "mpv", "protobuf", "yt-dlp", "quodlibet", "qimgv"),
filebrowsers=("pcmanfm", "yazi", "zoxide", "eza"),
netbrowsers=(
"qutebrowser",
"firefox",
"python-adblock",
"python-tldextract",
"bitwarden-cli", # for qutebrowser autofill
),
emailcalrss=(
"vdirsyncer", # sync calendar+contacts
"khard", # contacts
"khal", # calendar
"aerc", # email
"pandoc", # md2html emails
"pass", # password manager
"w3m", # terminal browser
"newsboat", # rss reader
"python-aiohttp-oauthlib", # for google vdirsyncer
),
monitors=(
"btop", # hardware
"nvtop", # gpu
"lazyjournal", # journald
"isd", # systemd
"bandwhich", # network
),
apps=("bitwarden", "qalculate-gtk", "vesktop"),
swaytools=(
"flashfocus", # quick flash when changing app in focus
"noisetorch", # noise cancellation
"unipicker", # unicode symbol selector
"wl-clip-persist", # keep clipboard after close
"wlsunset", # eye saver
"blueman", # bluetooth
"wdisplays", # ui for display settings
"wev", # debugging of ui
"gtklock", # lock screen
),
remotedata=("rclone", "dropbox", "minio-client"),
screensharing=(
"wireplumber",
"xdg-desktop-portal",
"xdg-desktop-portal-wlr",
),
optional_nvidia=("cuda", "nvidia-settings"),
optional_coolercontrol=("coolercontrol",),
optional_containers=(
"docker",
"docker-compose",
"docker-buildx", # advanced build
"qemu-user-static-binfmt", # build arm64
"qemu-user-static", # build arm64
"dry-bin", # docker tui
"k9s", # kubernetes tui
),
optional_nvidia_containers=("nvidia-docker",),
)
def compare_files(a: Path, b: Path) -> str:
return "".join(
unified_diff(open(a).readlines(), open(b).readlines(), str(a), str(b))
)
def helper_symlink_contents(
source_folder: str | Path, target_folder: str | Path, overwrite: bool
) -> None:
source_folder = Path(source_folder).expanduser()
target_folder = Path(target_folder).expanduser()
target_folder.mkdir(exist_ok=True)
for folder in [source_folder, target_folder]:
assert folder.expanduser().is_dir()
for src in source_folder.iterdir():
tgt = target_folder / src.name
if tgt.exists():
if src.is_dir():
if overwrite:
tgt.rmdir()
tgt.symlink_to(src)
else:
diff = ""
for subsrc in src.glob("**/*"):
subpath = subsrc.relative_to(source_folder)
subtgt = target_folder / subpath
if subtgt.exists():
diff += compare_files(subsrc, subtgt)
if diff:
print("DIFF:\n" + diff)
if input("overwrite? (y/n) ") == "y":
tgt.rmdir()
tgt.symlink_to(src)
else:
if overwrite:
tgt.unlink()
tgt.symlink_to(src)
else:
tgt = target_folder / src.name
diff = compare_files(src, tgt)
if diff:
print("DIFF:\n" + diff)
if input("overwrite? (y/n) ") == "y":
tgt.unlink()
tgt.symlink_to(src)
def helper_maybe_continue(path: Path, overwrite: bool) -> bool:
path = path.expanduser()
match path.exists(), overwrite:
case False, _:
return True
case True, True:
path.unlink()
return True
case True, False:
return False
case err:
raise ValueError(err)
def helper_check_if_installed(pkg: str) -> bool:
return run(["yay", "-Qs", pkg], capture_output=True).returncode == 0
def helper_uninstall(*pkgs: str) -> None:
for pkg in pkgs:
run(["yay", "-Rns", pkg], capture_output=True)
def helper_install(*pkgs: str, reinstall: bool) -> None:
for pkg in pkgs:
if reinstall or not helper_check_if_installed(pkg):
assert run(["yay", "-S", pkg]).returncode == 0
def install_fonts(reinstall: bool) -> None:
urlretrieve(
"https://raw.githubusercontent.com/SUNET/static_sunet_se/refs/heads/master/fonts/Akkurat-Mono.otf",
Path("~/.local/share/fonts/Akkurat-Mono.otf").expanduser(),
)
helper_install(*installmap["fonts"], reinstall=reinstall)
def install_nushell(overwrite: bool, reinstall: bool) -> None:
helper_install(*installmap["nushell"], reinstall=reinstall)
helper_symlink_contents(DOTFILES / "nushell", CFG / "nushell", overwrite)
run("sudo chsh -s /usr/bin/nu".split())
url = "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/refs/heads/main/themes/peru.omp.json"
run(["oh-my-posh", "init", "nu", "--config", url])
def install_tmux(overwrite: bool, reinstall: bool) -> None:
helper_install(*installmap["tmux"], reinstall=reinstall)
helper_symlink_contents(DOTFILES / "tmux", CFG / "tmux", overwrite)
tpmpath = CFG / "tmux/plugins/tpm"
if overwrite or not tpmpath.exists():
if tpmpath.exists():
tpmpath.rmdir()
run(["git", "clone", "https://github.com/tmux-plugins/tpm", tpmpath])
def install_nvim(overwrite: bool, reinstall: bool) -> None:
helper_install(*installmap["nvim"], reinstall=reinstall)
helper_symlink_contents(DOTFILES / "nvim", CFG / "nvim", overwrite)
def install_gittools(overwrite: bool, reinstall: bool) -> None:
helper_install(*installmap["gittools"], reinstall=reinstall)
helper_symlink_contents(DOTFILES / "tig", CFG / "tig", overwrite)
gitcfgpath = Path("~/.gitconfig").expanduser()
if overwrite or not gitcfgpath.exists():
if gitcfgpath.exists():
gitcfgpath.unlink()
gitcfgpath.expanduser().symlink_to(DOTFILES / "HOME/.gitconfig")
def install_pdftools(overwrite: bool, reinstall: bool) -> None:
helper_install(*installmap["pdftools"], reinstall=reinstall)
helper_symlink_contents(DOTFILES / "sioyek", CFG / "sioyek", overwrite)
helper_symlink_contents(DOTFILES / "zathura", CFG / "zathura", overwrite)
def install_filebrowsers(overwrite: bool, reinstall: bool) -> None:
helper_install(*installmap["filebrowsers"], reinstall=reinstall)
helper_symlink_contents(DOTFILES / "yazi", CFG / "yazi", overwrite)
for plugin in [
"chmod",
"git",
"mount",
"piper",
"smart-enter",
"smart-filter",
"toggle-pane",
]:
run(f"ya pkg add yazi-rs/plugins:{plugin}".split())
def install_emailcalrss(overwrite: bool, reinstall: bool) -> None:
helper_install(*installmap["emailcalrss"], reinstall=reinstall)
for tgt in ["vdirsyncer", "khard", "khal", "aerc", "newsboat"]:
helper_symlink_contents(DOTFILES / tgt, CFG / tgt, overwrite)
run(f"chmod 600 {CFG / 'aerc/accounts.conf'}".split())
def install_swaytools(overwrite: bool, reinstall: bool) -> None:
helper_install(*installmap["swaytools"], reinstall=reinstall)
sub = "sway/config.d"
helper_symlink_contents(DOTFILES / sub, CFG / sub, overwrite)
run("sudo systemctl enable --now bluetooth".split())
for sub in [
"etc/systemd/logind.conf.d/suspend.conf",
"etc/systemd/sleep.conf.d/hibernate.conf",
]:
run(["sudo", "cp", str(DOTFILES / "ROOT" / sub), str(Path("/") / sub)])
run("sudo systemctl enable --now bluetooth".split())
def configure_pytools(overwrite: bool) -> None:
for sub in [".ipython/profile_default", ".jupyter"]:
helper_symlink_contents(DOTFILES / "HOME" / sub, Path("~") / sub, overwrite)
def installer(
overwrite: bool = False,
reinstall: bool = False,
with_gpu: bool = False,
with_containers: bool = False,
with_coolercontrol: bool = False,
) -> None:
if helper_check_if_installed("cliphist"):
helper_uninstall("cliphist")
print("removed cliphist")
install_fonts(reinstall)
print("installed fonts")
install_nushell(overwrite, reinstall)
print("installed nushell")
install_tmux(overwrite, reinstall)
print("installed tmux")
install_nvim(overwrite, reinstall)
print("installed nvim")
helper_install(*installmap["utils"], reinstall=reinstall)
print("installed utils")
install_gittools(overwrite, reinstall)
print("installed gittools")
install_pdftools(overwrite, reinstall)
print("installed pdftools")
helper_install(*installmap["media"], reinstall=reinstall)
print("installed media")
install_filebrowsers(overwrite, reinstall)
print("installed filebrowsers")
helper_install(*installmap["netbrowsers"], reinstall=reinstall)
print("installed netbrowsers")
install_emailcalrss(overwrite, reinstall)
print("installed emailcalrss")
helper_install(*installmap["monitors"], reinstall=reinstall)
print("installed monitors")
helper_install(*installmap["apps"], reinstall=reinstall)
print("installed apps")
install_swaytools(overwrite, reinstall)
print("installed sway")
helper_install(*installmap["remotedata"], reinstall=reinstall)
print("installed remotedata")
helper_install(*installmap["screensharing"], reinstall=reinstall)
print("installed screensharing")
configure_pytools(overwrite=overwrite)
print("configured python tools")
if with_gpu:
helper_install(*installmap["optional_nvidia"], reinstall=reinstall)
print("installed nvidia")
if with_containers:
helper_install(*installmap["optional_containers"], reinstall=reinstall)
run("sudo systemctl enable --now docker.service".split())
print("installed containers")
if with_gpu and with_containers:
helper_install(*installmap["optional_nvidia_containers"], reinstall=reinstall)
print("installed nvidia containers")
if with_coolercontrol:
helper_install(*installmap["optional_coolercontrol"], reinstall=reinstall)
run("sudo systemctl enable --now coolercontrold.service".split())
print("installed coolercontrol")
print("""
MANUAL NEXT STEPS:
set up vdirsyncer with google calendar using
https://vdirsyncer.pimutils.org/en/stable/config.html#google
allow firefox windowed fullscreen by setting full-screen-api.ignore-widgets
to true in about:config
set coolercontrold log level to WARN:
`sudo systemctl edit coolercontrold.service`
docker with non-root daemon
`sudo groupadd docker && sudo usermod -aG docker $USER`
""")
if __name__ == "__main__":
import defopt
defopt.run(installer)
+10 -3
View File
@@ -1,9 +1,16 @@
term=xterm-256color [main]
font=monospace:size=12,JetBrainsMono Nerd Font:size=12 font=monospace:size=7,JetBrainsMono Nerd Font:size=7
dpi-aware=yes dpi-aware=yes
[environment]
SYSTEMD_EDITOR=/usr/bin/nvim
EDITOR=/usr/bin/nvim
VISUAL=/usr/bin/nvim
PAGER="bat --style=header,rule,snip"
BROWSER=/usr/bin/qutebrowser
[scrollback] [scrollback]
lines=10000 lines=100000
[key-bindings] [key-bindings]
search-start=Control+Shift+F search-start=Control+Shift+F
+3
View File
@@ -33,6 +33,9 @@ runcmd:
- ufw allow 2222 - ufw allow 2222
- ufw allow 51820/udp - ufw allow 51820/udp
- ufw allow in on hjarl - ufw allow in on hjarl
- ufw allow in on cni0
- ufw allow in on flannel.1
- ufw allow routed
- ufw enable - ufw enable
- sed -i -e '/^\(#\|\)PermitRootLogin/s/^.*$/PermitRootLogin no/' /etc/ssh/sshd_config - sed -i -e '/^\(#\|\)PermitRootLogin/s/^.*$/PermitRootLogin no/' /etc/ssh/sshd_config
- sed -i -e '/^\(#\|\)PasswordAuthentication/s/^.*$/PasswordAuthentication no/' /etc/ssh/sshd_config - sed -i -e '/^\(#\|\)PasswordAuthentication/s/^.*$/PasswordAuthentication no/' /etc/ssh/sshd_config
-125
View File
@@ -1,125 +0,0 @@
#!/bin/sh
set -e
# general
sudo systemctl enable --now sshd.service
sudo systemctl enable --now fstrim.timer
yay -S plymouth tldextract go nodejs unzip exa topgrade
# display manager
yay -S greetd qtgreet
# sway
yay -S manjaro-sway-settings swaytools swaylock-effects pamac-tray-plasma unipicker mako ly wlsunset pcmanfm-qt wev gtklock idlehack sworkstyle foot
systemctl --now --user enable foot-server.socket
# systemctl --now --user enable foot-server
# systemctl --now --user enable idlehack
# systemctl --now --user enable sworkstyle
# systemctl --now --user enable pcmanfm
# nvidia
yay -S cuda nvidia-settings nvidia-docker
# python
yay -S python-pip pyenv ipython
# sound
yay -S manjaro-pipewire pavucontrol-qt
# theme
yay -S mint-themes mint-y-icons kvantum-theme-catppuccin-git catppuccin-gtk-theme-latte catppuccin-gtk-theme-mocha breeze-grub breeze-gtk breeze-icons
yay -S lxinput-gtk3 qt6ct pamac-gtk3
# terminal and shell
yay -S nushell oh-my-posh carapace-bin zoxide
chsh -s /usr/bin/nu
oh-my-posh init nu --config https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/refs/heads/main/themes/peru.omp.json
# code
yay -S neovim tmux tig diff-so-fancy ripgrep nvimpager urlscan
git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm
# git
yay -S git-secret git-delta git-lfs lazygit
# formatters
yay -S python-black python-blackdoc python-pyment python-isort \
eslint_d eslint jq yamlfmt shfmt prettierd
# file sync
yay -S rclone dropbox
systemctl --user daemon-reload
rclone config # follow instructions and paste creds from https://console.cloud.google.com/apis/credentials
systemctl --now --user enable rclone-gdrive
systemctl --now --user enable dropbox
# docker incl non-root daemon
yay -S docker docker-compose dry-bin nvidia-docker docker-buildx
docker plugin install grafana/loki-docker-driver --alias loki --grant-all-permissions
sudo groupadd docker && sudo usermod -aG docker $USER
sudo systemctl enable --now containerd.service
sudo systemctl enable --now docker.service
# docker multi-platform build
yay -S qemu-user-static-binfmt qemu-user-static
# printer
yay -S manajaro-printer samsung-unified-driver-printer
# monitors
yay -S iftop btop nvtop lazyjournal isd
# pdf
yay -S sioyek zathura zathura-pdf-mupdf zathura-djvu zathura-ps
# fonts
yay -S noto-fonts-emoji ttf-hack
# coolercontrol
yay -S coolercontrol
sudo systemctl enable --now coolercontrold.service
sudo systemctl edit coolercontrold.service # set log level to WARN
# video streaming
yay -S vlc protobuf yt-dlp
yay -S castnow
# cal+email+contacts
yay -S khard aerc khal vdirsyncer python-aiohttp-oauthlib pandoc
# latex
yay texlive-latexextra
# div applications
yay -S \
vesktop \
qimgview-git \
firefox \
font-manager \
i3status \
ncspot \
qalculate-qt \
qbittorrent \
quodlibet \
qutebrowser \
pass \
rofi \
steam \
teamviewer \
yazi
# firefox windowed fullscreen
# can be achieved by setting full-screen-api.ignore-widgets to true in about:config
wget -P ~/.local/share/fonts/ https://raw.githubusercontent.com/SUNET/static_sunet_se/refs/heads/master/fonts/Akkurat-Mono.otf
sudo mkdir -p /usr/share/backgrounds/ultrawide/
sudo wget -O rainbowsmoke.jpg -P /usr/share/backgrounds/ultrawide https://superultrawidewallpaper.com/wp-content/uploads/2022/02/rainbow-smoke-3840x1080-1860x523.jpg
# set up vdirsyncer with google calendar using
# https://vdirsyncer.pimutils.org/en/stable/config.html#google
# yazi plugins
ya pkg add yazi-rs/plugins:chmod
ya pkg add yazi-rs/plugins:git
ya pkg add yazi-rs/plugins:mount
ya pkg add yazi-rs/plugins:piper
ya pkg add yazi-rs/plugins:smart-enter
ya pkg add yazi-rs/plugins:smart-filter
ya pkg add yazi-rs/plugins:toggle-pane
+5 -17
View File
@@ -1,18 +1,6 @@
[mypy] [mypy]
show_error_context = True strict = true
show_error_codes = True local_partial_types = true
show_column_numbers = True warn_return_any = false
pretty = True disallow_subclassing_any = false
color_output = True pretty = true
disallow_untyped_calls = False
disallow_untyped_defs = True
disallow_incomplete_defs = True
disallow_untyped_decorators = True
# warn_redundant_casts = True
# warn_unused_ignores = True
# warn_unreachable = True
warn_return_any = False
no_implicit_optional = True
strict_optional = True
+72 -112
View File
@@ -49,7 +49,7 @@ vim.o.smartindent = false
vim.opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize", "help", "globals", "skiprtp", "folds" } vim.opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize", "help", "globals", "skiprtp", "folds" }
-- Completion Window/Popup settings -- Completion Window/Popup settings
vim.o.completeopt = "menu,menuone,popup,fuzzy" vim.o.completeopt = "menu,popup,preview"
vim.o.pumblend = 10 vim.o.pumblend = 10
vim.o.pumheight = 10 vim.o.pumheight = 10
vim.o.winminwidth = 5 vim.o.winminwidth = 5
@@ -246,9 +246,6 @@ map({ "n", "i" }, "<M-x>", vim.lsp.buf.signature_help)
map("n", "K", vim.lsp.buf.hover) map("n", "K", vim.lsp.buf.hover)
map("n", "<M-r>", vim.lsp.buf.rename) map("n", "<M-r>", vim.lsp.buf.rename)
map({ "n", "x" }, "<leader>ca", vim.lsp.buf.code_action, { desc = "Code Action" }) map({ "n", "x" }, "<leader>ca", vim.lsp.buf.code_action, { desc = "Code Action" })
-- replaced by Trouble
-- map("n", "<leader>cs", vim.lsp.buf.document_symbol, { desc = "Document Symbols" })
-- map("n", "<leader>cw", vim.lsp.buf.workspace_symbol, { desc = "Workspace Symbols" })
-- ---------------------------------------- -- ----------------------------------------
-- AUTOCMD -- AUTOCMD
@@ -283,10 +280,9 @@ vim.api.nvim_create_autocmd("FileType", {
"qf", "qf",
}, },
callback = function(event) callback = function(event)
vim.bo[event.buf].buflisted = false
vim.schedule( vim.schedule(
function() function()
vim.keymap.set("n", "q", "<cmd>q<cr>", { buffer = event.buf, silent = true, desc = "Quit Buffer" }) vim.keymap.set("n", "q", "<cmd>close<cr>", { buffer = event.buf, silent = true, desc = "Close Buffer" })
end end
) )
end, end,
@@ -380,6 +376,11 @@ local function makespecs_themes()
end end
local function makespec_lspconfig() local function makespec_lspconfig()
local rootdirfix = function(root_markers)
return function(bufnr, on_dir)
on_dir(require("lspconfig").util.root_pattern(unpack(root_markers))(vim.fn.bufname(bufnr)))
end
end
return { return {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
lazy = false, lazy = false,
@@ -387,11 +388,7 @@ local function makespec_lspconfig()
cmd = { "LspInfo", "LspRestart", "LspStart", "LspStop" }, cmd = { "LspInfo", "LspRestart", "LspStart", "LspStop" },
keys = { { "<F4>", "<cmd>LspInfo<cr>", noremap = true } }, keys = { { "<F4>", "<cmd>LspInfo<cr>", noremap = true } },
config = function() config = function()
local lspconfig = require("lspconfig") vim.lsp.config("lua_ls", {
lspconfig.tinymist.setup({})
lspconfig.bashls.setup({})
lspconfig.nushell.setup({})
lspconfig.lua_ls.setup({
cmd = { "lua-language-server" }, cmd = { "lua-language-server" },
settings = { settings = {
Lua = { Lua = {
@@ -406,7 +403,7 @@ local function makespec_lspconfig()
}, },
}, },
}) })
lspconfig.clangd.setup({ vim.lsp.config("clangd", {
cmd = { cmd = {
"clangd", "clangd",
"--background-index", "--background-index",
@@ -418,7 +415,7 @@ local function makespec_lspconfig()
}, },
filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto" }, filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto" },
}) })
lspconfig.html.setup({ vim.lsp.config("html", {
cmd = { "vscode-html-language-server", "--stdio" }, cmd = { "vscode-html-language-server", "--stdio" },
settings = { settings = {
html = { html = {
@@ -431,7 +428,7 @@ local function makespec_lspconfig()
}, },
}, },
}) })
lspconfig.yamlls.setup({ vim.lsp.config("yamlls", {
settings = { settings = {
yaml = { yaml = {
schemas = { kubernetes = "/home/hjalmarlucius/src/hjarl/system/manifests/*.yaml" }, schemas = { kubernetes = "/home/hjalmarlucius/src/hjarl/system/manifests/*.yaml" },
@@ -439,23 +436,50 @@ local function makespec_lspconfig()
}, },
}, },
}) })
lspconfig.pyright.setup({ vim.lsp.config("ty", {
cmd = { "pyright-langserver", "--stdio", "--threads", "20" }, cmd = { "ty", "server" },
filetypes = { "python" }, filetypes = { "python" },
root_dir = rootdirfix({ ".git", "pyproject.toml", "setup.py", "setup.cfg" }),
settings = { ty = { experimental = { rename = true } } },
})
vim.lsp.config("pyrefly", {
cmd = { "pyrefly", "lsp" },
filetypes = { "python" },
root_dir = rootdirfix({ ".git", "pyproject.toml", "setup.py", "setup.cfg", "pyrefly.toml" }),
})
vim.lsp.config("pylsp", {
filetypes = { "python" },
root_dir = rootdirfix({ ".git", "pyproject.toml", "setup.py", "setup.cfg" }),
settings = {
pylsp = {
plugins = {
pylsp_mypy = {
enabled = true,
dmypy = true,
},
pycodestyle = { enabled = false },
mccabe = { enabled = false },
},
},
},
})
vim.lsp.config("basedpyright", {
cmd = { "basedpyright-langserver", "--stdio", "--threads", "20" },
filetypes = { "python" },
root_dir = rootdirfix({ ".git", "pyproject.toml", "setup.py", "setup.cfg", "pyrightconfig.json" }),
settings = { settings = {
python = { python = {
analysis = { analysis = {
-- logLevel = "Trace", -- logLevel = "Trace",
autoImportCompletions = false, autoImportCompletions = false,
diagnosticMode = "workspace", diagnosticMode = "workspace",
useLibraryCodeForTypes = true,
logTypeEvaluationTime = true, logTypeEvaluationTime = true,
typeEvaluationTimeThreshold = 2000, typeEvaluationTimeThreshold = 2000,
}, },
}, },
}, },
}) })
lspconfig.vtsls.setup({ vim.lsp.config("vtsls", {
settings = { settings = {
complete_function_calls = true, complete_function_calls = true,
vtsls = { vtsls = {
@@ -498,6 +522,19 @@ local function makespec_lspconfig()
}, },
}, },
}) })
vim.lsp.enable("bashls")
vim.lsp.enable("clangd")
vim.lsp.enable("html")
vim.lsp.enable("lua_ls")
vim.lsp.enable("nushell")
vim.lsp.enable("ty")
-- vim.lsp.enable("pyrefly")
-- vim.lsp.enable("pylsp")
-- vim.lsp.enable("basedpyright")
vim.lsp.enable("tinymist")
vim.lsp.enable("vtsls")
vim.lsp.enable("yamlls")
end, end,
} }
end end
@@ -506,7 +543,7 @@ local function makespec_hexokinase()
return { return {
-- coloring of colornames -- coloring of colornames
"rrethy/vim-hexokinase", "rrethy/vim-hexokinase",
build = "cd /home/hjalmarlucius/.local/share/nvim/lazy/vim-hexokinase && make hexokinase", build = "cd /home/hjalmarlucius/.local/share/nvim/lazy/vim-hexokinase; make hexokinase",
config = function() vim.g.Hexokinase_highlighters = { "virtual" } end, config = function() vim.g.Hexokinase_highlighters = { "virtual" } end,
} }
end end
@@ -652,6 +689,11 @@ local function makespec_neotree()
filesystem = { filesystem = {
filtered_items = { hide_gitignored = false }, filtered_items = { hide_gitignored = false },
follow_current_file = { enabled = false }, follow_current_file = { enabled = false },
window = {
mappings = {
["/"] = false, -- disable fancy and annoying filter, just search instead
},
},
}, },
commands = { commands = {
system_open = function(state) system_open = function(state)
@@ -831,8 +873,8 @@ local function makespec_fugitive()
end, end,
keys = { keys = {
{ "<leader>gg", "<cmd>vertical Git<cr>", desc = "Fugitive" }, { "<leader>gg", "<cmd>vertical Git<cr>", desc = "Fugitive" },
{ "<leader>gp", "<cmd>Git push<cr>", desc = "Git Push" }, { "<leader>gp", "<cmd>Git! push<cr>", desc = "Git Push" },
{ "<leader>gP", "<cmd>Git push -f<cr>", desc = "Git Force Push" }, { "<leader>gP", "<cmd>Git! push -f<cr>", desc = "Git Force Push" },
}, },
} }
end end
@@ -903,20 +945,6 @@ local function makespec_gitsigns()
} }
end end
local function makespec_orgmode()
return {
"nvim-orgmode/orgmode",
event = "VeryLazy",
config = function()
-- Setup orgmode
require("orgmode").setup({
org_agenda_files = "~/notes/orgfiles/**/*",
org_default_notes_file = "~/notes/orgfiles/refile.org",
})
end,
}
end
local function makespec_whichkey() local function makespec_whichkey()
return { return {
"folke/which-key.nvim", "folke/which-key.nvim",
@@ -1062,10 +1090,11 @@ local function makespec_snacks()
-- logs -- logs
{ "<leader>ll", function() Snacks.picker.notifications() end, desc = "Notification History" }, { "<leader>ll", function() Snacks.picker.notifications() end, desc = "Notification History" },
-- code -- code
{ "<leader>cS", function() Snacks.picker.lsp_symbols() end, desc = "LSP Symbols" }, { "<leader>cs", function() Snacks.picker.lsp_symbols() end, desc = "LSP Symbols" },
-- replaced by Trouble { "<leader>cw", function() Snacks.picker.lsp_workspace_symbols() end, desc = "LSP Workspace Symbols" },
-- { "<leader>cW", function() Snacks.picker.lsp_workspace_symbols() end, desc = "LSP Workspace Symbols" }, { "<leader>cr", function() Snacks.picker.lsp_references() end, desc = "LSP References" },
-- { "<leader>cd", function() Snacks.picker.diagnostics() end, desc = "Diagnostics" }, { "<leader>cc", function() Snacks.picker.diagnostics_buffer() end, desc = "Buffer Diagnostics" },
{ "<leader>cd", function() Snacks.picker.diagnostics() end, desc = "Diagnostics" },
-- terminal -- terminal
{ "<C-/>", function() Snacks.terminal.toggle() end, desc = "Snacks Terminal", mode={"n", "t"} }, { "<C-/>", function() Snacks.terminal.toggle() end, desc = "Snacks Terminal", mode={"n", "t"} },
{ "<C-_>", function() Snacks.terminal.toggle() end, desc = "which_key_ignore", mode={'n', "t"} }, { "<C-_>", function() Snacks.terminal.toggle() end, desc = "which_key_ignore", mode={'n', "t"} },
@@ -1140,65 +1169,6 @@ local function makespecs_mini()
} }
end end
local function makespec_trouble()
return {
"folke/trouble.nvim",
cmd = { "Trouble" },
opts = {
modes = {
lsp = { win = { position = "right", size = 100 } },
diagnostics = { win = { position = "right", size = 100 } },
symbols = { win = { position = "right", size = 100 } },
loclist = { win = { position = "right", size = 100 } },
qflist = { win = { position = "right", size = 100 } },
},
},
keys = {
{ "<leader>cc", "<cmd>Trouble diagnostics toggle filter.buf=0<cr>", desc = "Buffer Diagnostics" },
{ "<leader>cd", "<cmd>Trouble diagnostics toggle<cr>", desc = "Diagnostics" },
{ "<leader>cr", "<cmd>Trouble lsp_references toggle<cr>", desc = "References" },
{ "<leader>cs", "<cmd>Trouble symbols toggle<cr>", desc = "Document Symbols" },
{ "<leader>ca", "<cmd>Trouble lsp toggle<cr>", desc = "LSP references/definitions/..." },
{ "<leader>cl", "<cmd>Trouble loclist toggle<cr>", desc = "Location List" },
{ "<leader>cq", "<cmd>Trouble qflist toggle<cr>", desc = "Quickfix List" },
{
"[x",
function()
if require("trouble").is_open() then
require("trouble").prev({ skip_groups = true, jump = true })
else
local ok, err = pcall(vim.cmd.cprev)
if not ok then vim.notify(err, vim.log.levels.ERROR) end
end
end,
desc = "Previous Trouble/Quickfix Item",
},
{
"]x",
function()
if require("trouble").is_open() then
require("trouble").next({ skip_groups = true, jump = true })
else
local ok, err = pcall(vim.cmd.cnext)
if not ok then vim.notify(err, vim.log.levels.ERROR) end
end
end,
desc = "Next Trouble/Quickfix Item",
},
},
specs = {
"folke/snacks.nvim",
opts = function(_, opts)
return vim.tbl_deep_extend("force", opts or {}, {
picker = {
actions = require("trouble.sources.snacks").actions,
win = { input = { keys = { ["<c-t>"] = { "trouble_open", mode = { "n", "i" } } } } },
},
})
end,
},
}
end
local function makespec_todocomments() local function makespec_todocomments()
return { return {
"folke/todo-comments.nvim", "folke/todo-comments.nvim",
@@ -1231,12 +1201,8 @@ local function makespec_todocomments()
keys = { keys = {
{ "]t", function() require("todo-comments").jump_next() end, desc = "Next Todo Comment" }, { "]t", function() require("todo-comments").jump_next() end, desc = "Next Todo Comment" },
{ "[t", function() require("todo-comments").jump_prev() end, desc = "Previous Todo Comment" }, { "[t", function() require("todo-comments").jump_prev() end, desc = "Previous Todo Comment" },
{ "<leader>ct", "<cmd>Trouble todo toggle<cr>", desc = "Comments list" }, { "<leader>ct", "<cmd>TodoQuickFix keywords=TODO,MAYBE,FIX<cr>", desc = "Todo/Fix/Fixme list" },
{ { "<leader>cT", "<cmd>TodoQuickFix<cr>", desc = "Comments list" },
"<leader>cT",
"<cmd>Trouble todo toggle filter = {tag = {TODO,FIX,FIXME}}<cr>",
desc = "Todo/Fix/Fixme list",
},
{ "<leader>st", function() Snacks.picker.todo_comments() end, desc = "Todo" }, { "<leader>st", function() Snacks.picker.todo_comments() end, desc = "Todo" },
{ {
"<leader>sT", "<leader>sT",
@@ -1262,10 +1228,6 @@ local function makespec_smartsplits()
{ "<C-j>", function() require("smart-splits").resize_down() end, { desc = "Resize Window Down", remap = true } }, { "<C-j>", function() require("smart-splits").resize_down() end, { desc = "Resize Window Down", remap = true } },
{ "<C-k>", function() require("smart-splits").resize_up() end, { desc = "Resize Window Up", remap = true } }, { "<C-k>", function() require("smart-splits").resize_up() end, { desc = "Resize Window Up", remap = true } },
{ "<C-l>", function() require("smart-splits").resize_right() end, { desc = "Resize Window Right", remap = true } }, { "<C-l>", function() require("smart-splits").resize_right() end, { desc = "Resize Window Right", remap = true } },
{ "<leader><leader>h", function() require("smart-splits").swap_buf_left() end, { desc = "Swap Buffer Left", remap = true } },
{ "<leader><leader>j", function() require("smart-splits").swap_buf_down() end, { desc = "Swap Buffer Down", remap = true } },
{ "<leader><leader>k", function() require("smart-splits").swap_buf_up() end, { desc = "Swap Buffer Up", remap = true } },
{ "<leader><leader>l", function() require("smart-splits").swap_buf_right() end, { desc = "Swap Buffer Right", remap = true } },
}, },
} }
end end
@@ -1450,7 +1412,8 @@ local function makespec_conform()
cmd = { "ConformInfo" }, cmd = { "ConformInfo" },
keys = { keys = {
{ "<leader>p", function() require("conform").format() end, silent = true, desc = "Autoformat" }, { "<leader>p", function() require("conform").format() end, silent = true, desc = "Autoformat" },
{ "<leader>lp", "<cmd>e ~/.local/state/nvim/conform.log<cr>", desc = "Conform log" }, { "<leader>lp", "<cmd>ConformInfo<cr>", desc = "Conform log" },
{ "<leader>lP", "<cmd>e ~/.local/state/nvim/conform.log<cr>", desc = "Conform log" },
}, },
opts = { opts = {
formatters_by_ft = { formatters_by_ft = {
@@ -1534,7 +1497,6 @@ end
-- ---------------------------------------- -- ----------------------------------------
local lazyspecs = { local lazyspecs = {
"dhruvasagar/vim-table-mode", -- tables
"itchyny/vim-qfedit", -- editable quickfix list "itchyny/vim-qfedit", -- editable quickfix list
{ "ethanholz/nvim-lastplace", opts = {} }, -- keep location upon reopening { "ethanholz/nvim-lastplace", opts = {} }, -- keep location upon reopening
"tpope/vim-eunuch", -- Move, Rename etc "tpope/vim-eunuch", -- Move, Rename etc
@@ -1548,11 +1510,9 @@ for _, spec in ipairs({
makespec_lspconfig(), makespec_lspconfig(),
makespec_treesitter(), makespec_treesitter(),
makespec_todocomments(), makespec_todocomments(),
makespec_trouble(),
makespec_autotag(), makespec_autotag(),
makespec_lint(), makespec_lint(),
makespec_mason(), makespec_mason(),
makespec_orgmode(),
-- navigation -- navigation
makespec_whichkey(), makespec_whichkey(),
makespec_smartsplits(), makespec_smartsplits(),
+7 -3
View File
@@ -80,6 +80,7 @@ c.completion.web_history.max_items = 10000
c.completion.height = "100%" c.completion.height = "100%"
c.confirm_quit = ["multiple-tabs", "downloads"] c.confirm_quit = ["multiple-tabs", "downloads"]
c.content.javascript.clipboard = "ask" c.content.javascript.clipboard = "ask"
c.content.local_content_can_access_remote_urls = True
c.content.autoplay = False c.content.autoplay = False
c.content.geolocation = False c.content.geolocation = False
c.content.cache.size = 52428800 c.content.cache.size = 52428800
@@ -133,8 +134,13 @@ c.input.insert_mode.auto_leave = False
c.input.insert_mode.plugins = True c.input.insert_mode.plugins = True
c.messages.timeout = 5000 c.messages.timeout = 5000
c.qt.args = [ c.qt.args = [
"enable-accelerated-video-decode", "disable-features=PermissionElement",
"ozone-platform-hint=wayland",
"ignore-gpu-blocklist",
"enable-gpu-rasterization", "enable-gpu-rasterization",
"enable-accelerated-video-decode",
"enable-quic",
"enable-zero-copy",
] ]
c.qt.highdpi = True c.qt.highdpi = True
c.scrolling.bar = "always" c.scrolling.bar = "always"
@@ -172,8 +178,6 @@ c.url.start_pages = "http://www.google.com/search?hl=en&source=hp&ie=ISO-8859-l"
c.url.default_page = "http://www.google.com/search?hl=en&source=hp&ie=ISO-8859-l" c.url.default_page = "http://www.google.com/search?hl=en&source=hp&ie=ISO-8859-l"
c.url.searchengines = dict( c.url.searchengines = dict(
DEFAULT="http://www.google.com/search?hl=en&source=hp&ie=ISO-8859-l&q={}", DEFAULT="http://www.google.com/search?hl=en&source=hp&ie=ISO-8859-l&q={}",
cg="https://chatgpt.com/?q={}",
kg="https://kagi.com/search/?q={}",
aw="https://wiki.archlinux.org/?search={}", aw="https://wiki.archlinux.org/?search={}",
ap="https://www.archlinux.org/packages/?sort=&q={}", ap="https://www.archlinux.org/packages/?sort=&q={}",
gh="https://github.com/search?q={}&type=Code", gh="https://github.com/search?q={}&type=Code",
-332
View File
@@ -1,332 +0,0 @@
include /etc/sway/config.d/10-service.conf
include /etc/sway/config.d/50-systemd-user.conf
# THEME
set $background /usr/share/backgrounds/wallpapers-juhraya/Austria_by_Rutger_Heijmerikx.jpg
set $gui-font Noto Sans 10
set $term-font Akkurat Mono
# light
# set $cursor-theme xcursor-breeze-snow
# set $gtk-theme catppuccin-latte-teal-standard+default
# set $icon-theme Papirus
# set $kvantum-theme catppuccin-latte-teal
# set $gtk-color-scheme prefer-light
# dark
set $cursor-theme xcursor-breeze
set $gtk-theme catppuccin-mocha-teal-standard+default
set $icon-theme Papirus-Dark
set $kvantum-theme catppuccin-mocha-teal
set $gtk-color-scheme prefer-dark
# colors
set $background-color #1E1E2E
set $text-color #CDD6F4
set $accent-color #89B4FA
# target title bg text indicator
client.focused #556064 #F9CE5C #000000 #FDF6E3
client.focused_inactive #CB4B16 #2F3D44 #1ABC9C #454948
client.unfocused #556064 #2F3D44 #1ABC9C #454948
client.urgent #CB4B16 #FDF6E3 #1ABC9C #268BD2
client.placeholder #000000 #0C0C0C #ffffff #000000
client.background #2B2C2B
# DEFINIIONS
# controls
set $mod Mod4
set $left h
set $down j
set $up k
set $right l
# Workspace numbers
set $ws1 number 1
set $ws2 number 2
set $ws3 number 3
set $ws4 number 4
set $ws5 number 5
set $ws6 number 6
set $ws7 number 7
set $ws8 number 8
set $ws9 number 9
set $ws10 number 10
# terminal editor
set $term footclient
set $term_float footclient --app-id floating_shell --window-size-chars 120x45
# swayidle
set $locking swaylock --screenshots --clock --grace 10 --fade-in 0.5 --effect-blur 5x5 --effect-greyscale
# scaling
set $scale_up /usr/share/sway/scripts/scale.sh up
set $scale_down /usr/share/sway/scripts/scale.sh down
set $scale_default /usr/share/sway/scripts/scale.sh default
# audio
set $pulseaudio $term_float pulsemixer
set $sink_volume pactl get-sink-volume @DEFAULT_SINK@ | grep '^Volume:' | cut -d / -f 2 | tr -d ' ' | sed 's/%//'
set $source_volume pactl get-source-volume @DEFAULT_SOURCE@ | grep '^Volume:' | cut -d / -f 2 | tr -d ' ' | sed 's/%//'
set $volume_down $(pactl set-sink-volume @DEFAULT_SINK@ -5% && $sink_volume)
set $volume_up $(pactl set-sink-volume @DEFAULT_SINK@ +5% && $sink_volume)
set $volume_mute $(pactl set-sink-mute @DEFAULT_SINK@ toggle && pactl get-sink-mute @DEFAULT_SINK@ | sed -En "/no/ s/.*/$($sink_volume)/p; /yes/ s/.*/0/p")
set $mic_mute $(pactl set-source-mute @DEFAULT_SOURCE@ toggle && pactl get-source-mute @DEFAULT_SOURCE@ | sed -En "/no/ s/.*/$($source_volume)/p; /yes/ s/.*/0/p")
# rofi
set $rofi_theme "* {\nlightbg: $background-color;\nbackground: $background-color;\nlightfg: $accent-color;\nforeground: $text-color;\n}\nwindow {\nwidth: 25em;\n}\n"
set $menu rofi -show combi -combi-modi "drun,run" -terminal "$term" -ssh-command "{terminal} {ssh-client} {host} [-p {port}]" -run-shell-command "{terminal} {cmd}" -show-icons -font "$gui-font" -lines 10
# Screenshot commands
set $grimshot grimshot
set $pipe_output $grimshot save output -
set $pipe_selection $grimshot save area -
set $notify_paste [[ $(wl-paste -l) == "image/png" ]] && notify-send "Screenshot copied to clipboard"
set $swappy swappy -f -
set $upload_pipe curl -s -F "file=@-;filename=.png" https://x0.at/ | tee >(wl-copy) >(xargs notify-send)
set $screenshot_screen $pipe_output | $swappy && $notify_paste
set $screenshot_screen_upload $pipe_output | $upload_pipe
set $screenshot_selection $pipe_selection | $swappy && $notify_paste
set $screenshot_selection_upload $pipe_selection | $upload_pipe
# AUTOSTART APPLICATIONS
exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
exec_always {
# theming (from manjaro sway desktop config)
/usr/share/sway/scripts/enable-gtk-theme.sh "$gtk-theme"
/usr/share/sway/scripts/fontconfig.sh "monospace" "$term-font"
gsettings set org.gnome.desktop.interface icon-theme "$icon-theme"
gsettings set org.gnome.desktop.interface cursor-theme "$cursor-theme"
gsettings set org.gnome.desktop.interface font-name "$gui-font"
gsettings set org.gnome.desktop.input-sources show-all-sources true
gsettings set org.gnome.desktop.interface monospace-font-name "$term-font"
gsettings set org.freedesktop.appearance color-scheme "$gtk-color-scheme"
gsettings set org.gnome.desktop.interface color-scheme "$gtk-color-scheme"
kvantummanager --set "$kvantum-theme"
}
exec {
pamac-tray-plasma
wlsunset -l 59.91:10.76
systemctl --user enable --now blueman-applet
# idle lock
systemctl --user enable --now swayidle
systemctl --user enable --now idlehack
# focus switch animations
systemctl --user enable --now flashfocus
# usb automount
systemctl --user enable --now pcmanfm
# workspace icons
systemctl --user enable --now sworkstyle
# foot server
systemctl --user enable --now foot-server
}
exec_always {
nm-applet
calcurse --daemon
# persist clipboard after close
pkill -x wl-clip-persist
wl-clip-persist --clipboard regular --all-mime-type-regex '(?i)^(?!image/x-inkscape-svg).+'
# mako daemon
pkill -x mako
mako --font "$term-font" --text-color "$text-color" --border-color "$accent-color" --background-color "$background-color" --border-size 3 --width 400 --height 200 --padding 20 --margin 20 --default-timeout 15000
# enable noisetorch
noisetorch -u
noisetorch -i
# update rofi theme
mkdir -p $HOME/.config/rofi/
echo $rofi_theme > $HOME/.config/rofi/config.rasi
}
# CONFIGS
font $gui-font
focus_follows_mouse no
mouse_warping none
workspace_auto_back_and_forth no
bar {
swaybar_command waybar
}
# don't show gaps if there's only one window on the desktop
smart_gaps on
gaps inner 5
# borders
default_border normal
default_floating_border normal
hide_edge_borders smart
# BINDINGS
include ~/.config/sway/local_config
bindsym $mod+Return exec $term
bindsym $mod+Shift+Return exec foot
bindsym $mod+Shift+q kill
bindsym $mod+d exec $menu
floating_modifier $mod normal
bindsym $mod+r reload
bindsym $mod+a focus parent
bindsym $mod+Shift+a focus child
# Moving around
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
# Moving
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
# splits
bindsym $mod+b splith
bindsym $mod+s splitv
bindsym $mod+q split toggle
# split formats
bindsym $mod+w layout stacking
bindsym $mod+t layout tabbed
bindsym $mod+e layout toggle split
bindsym $mod+f fullscreen
# floating
bindsym $mod+Shift+space floating toggle
bindsym $mod+Ctrl+space sticky toggle
bindsym $mod+space focus mode_toggle
# scratchpad
bindsym $mod+Shift+minus move scratchpad
bindsym $mod+Shift+slash move scratchpad
bindsym $mod+minus scratchpad show
bindsym $mod+slash scratchpad show
# sound
bindsym Scroll_Lock exec $volume_mute
bindsym Print exec $volume_down
bindsym Pause exec $volume_up
# screenshots
bindsym $mod+Shift+s exec --no-startup-id $screenshot_selection
# scale
bindsym $mod+greater exec $scale_up
bindsym $mod+less exec $scale_down
bindsym $mod+equal exec $scale_default
# apps
bindsym $mod+F1 exec qalculate-qt
bindsym $mod+F2 exec qutebrowser
bindsym $mod+F3 exec quodlibet
bindsym $mod+F4 exec $term_float ncspot
bindsym $mod+n exec makoctl dismiss
bindsym $mod+Shift+n exec makoctl dismiss -a
bindsym $mod+p exec pcmanfm-qt
bindsym $mod+Shift+p exec $term_float yazi
bindsym $mod+u exec unipicker --command "rofi -dmenu | wl-copy"
bindsym $mod+period exec $term_float khal interactive
bindsym $mod+comma exec $term_float aerc
# Special keys
bindsym --locked XF86AudioMute exec $volume_mute
bindsym --locked XF86AudioLowerVolume exec $volume_down
bindsym --locked XF86AudioRaiseVolume exec $volume_up
bindsym --locked XF86AudioMicMute exec $mic_mute
bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+
# resize
mode "resize" {
bindsym $left resize shrink width 10px
bindsym $down resize grow height 10px
bindsym $up resize shrink height 10px
bindsym $right resize grow width 10px
bindsym Shift+$left resize shrink width 50px
bindsym Shift+$down resize grow height 50px
bindsym Shift+$up resize shrink height 50px
bindsym Shift+$right resize grow width 50px
# Return to default mode
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+z mode "resize"
# shut down, restart and locking
set $mode_system System (l) lock, (e) exit, (s) suspend, (r) reboot, (p) shutdown
mode "$mode_system" {
bindsym e exec --no-startup-id swaymsg exit, mode "default"
bindsym s exec --no-startup-id systemctl suspend, mode "default"
bindsym r exec --no-startup-id systemctl reboot, mode "default"
bindsym p exec --no-startup-id systemctl poweroff -i, mode "default"
bindsym l exec --no-startup-id $locking, mode "default"
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+Shift+e mode "$mode_system"
# config tools
set $mode_config (b) bt, (c) cooling, (d) display, (g) gparted, (k) kvantum, (l) lxappearance, (m) manjaro, (p) packages, (q) qt5, (Q) qt6, (s) sound, (u) upgrade
mode "$mode_config" {
# bindsym b exec --no-startup-id blueman-manager, mode "default"
bindsym c exec --no-startup-id coolercontrol, mode "default"
bindsym d exec --no-startup-id wdisplays, mode "default"
bindsym g exec --no-startup-id gparted, mode "default"
bindsym k exec --no-startup-id kvantummanager, mode "default"
bindsym l exec --no-startup-id lxappearance, mode "default"
bindsym m exec --no-startup-id manjaro-settings-manager, mode "default"
bindsym p exec --no-startup-id pamac-manager, mode "default"
bindsym q exec --no-startup-id qt5ct, mode "default"
bindsym Shift+q exec --no-startup-id qt6ct, mode "default"
bindsym s exec --no-startup-id pavucontrol-qt, mode "default"
bindsym u exec --no-startup-id $term_float topgrade --only config_update --only system, mode "default"
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+c mode "$mode_config"
# config tools
set $mode_monitor (b) btop, (h) htop, (s) isd, (j) journal, (n) nvtop
mode "$mode_monitor" {
bindsym b exec $term_float btop, mode "default"
bindsym h exec $term_float htop, mode "default"
bindsym s exec $term_float isd, mode "default"
bindsym j exec $term_float lazyjournal, mode "default"
bindsym n exec $term_float nvtop, mode "default"
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+m mode "$mode_monitor"
# WINDOWS
for_window [all] title_format "%app_id - %title"
# set floating mode for generated windows
for_window [title="(?:Open|Save) (?:File|Folder|As)"] floating enable
for_window [title="(?:Open|Save) (?:File|Folder|As)"] resize set 800 600
for_window [title="Save File"] floating enable
for_window [window_role="pop-up"] floating enable
for_window [window_role="bubble"] floating enable
for_window [window_role="task_dialog"] floating enable
for_window [window_role="Preferences"] floating enable
for_window [window_type="dialog"] floating enable
for_window [window_type="menu"] floating enable
# remove title
for_window [app_id="foot"] border pixel 2
for_window [class="discord"] border pixel 2
for_window [app_id="thunderbird"] border pixel 2
for_window [app_id="qutebrowser"] border pixel 2
# Open specific applications in floating mode
for_window [app_id="GParted"] floating enable
for_window [app_id="qalculate-qt"] floating enable
for_window [class="pavucontrol-qt"] floating enable
# https://github.com/ValveSoftware/steam-for-linux/issues/1040
for_window [app_id="^steam$"] floating enable
for_window [app_id="^Steam$"] floating enable
for_window [app_id="^steam$" title="^Steam$"] floating disable
# set floating mode for specific applications
for_window [app_id="thunderbird"] border pixel 2
for_window [app_id="thunderbird" title=".*Reminder"] floating enable
for_window [app_id="floating_shell"] floating enable, border pixel 1
# Don't allow applications to inhibit shortcuts, i.e. grab total control of the
# keyboard. Chrome currently abuses this by enabling it for all "--app=..." shortcuts.
seat * shortcuts_inhibitor disable
# IO
output * bg $background fill
input type:keyboard {
xkb_layout "us"
xkb_variant "altgr-weur"
xkb_options "caps:escape"
repeat_delay 400
repeat_rate 30
}
input type:mouse {
accel_profile "flat"
pointer_accel 0.5
}
+31
View File
@@ -0,0 +1,31 @@
# Custom windowing rules
for_window [class="Yad" instance="yad"] floating enable
for_window [app_id="yad"] floating enable
for_window [app_id="blueman-manager"] floating enable, resize set width 40 ppt height 30 ppt
for_window [app_id="pavucontrol" ] floating enable, resize set width 40 ppt height 30 ppt
for_window [window_role="pop-up"] floating enable
for_window [window_role="bubble"] floating enable
for_window [window_role="task_dialog"] floating enable
for_window [window_role="Preferences"] floating enable
for_window [window_type="dialog"] floating enable
for_window [window_type="menu"] floating enable
for_window [window_role="About"] floating enable
for_window [title="File Operation Progress"] floating enable, border pixel 1, sticky enable, resize set width 40 ppt height 30 ppt
for_window [app_id="floating_shell_portrait"] floating enable, border pixel 1, sticky enable, resize set width 30 ppt height 40 ppt
for_window [title="Picture in picture"] floating enable, sticky enable
for_window [title="waybar_htop"] floating enable, resize set width 70 ppt height 70 ppt
for_window [title="waybar_nmtui"] floating enable
for_window [title="Save File"] floating enable
for_window [app_id="firefox" title="Firefox — Sharing Indicator"] kill
# https://github.com/ValveSoftware/steam-for-linux/issues/1040
for_window [app_id="^steam$"] floating enable
for_window [app_id="^Steam$"] floating enable
for_window [app_id="^steam$" title="^Steam$"] floating disable
# Inhibit idle
for_window [app_id="firefox"] inhibit_idle fullscreen
for_window [app_id="Chromium"] inhibit_idle fullscreen
# Don't allow applications to inhibit shortcuts, i.e. grab total control of the
# keyboard. Chrome currently abuses this by enabling it for all "--app=..." shortcuts.
seat * shortcuts_inhibitor disable
+50
View File
@@ -0,0 +1,50 @@
# Auth with polkit-gnome:
exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
# Import environment variables for user systemd service manager
exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
# Update dbus environments with display variables
exec hash dbus-update-activation-environment 2>/dev/null && \
dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK
# Idle configuration
exec swayidle idlehint 1
exec_always swayidle -w before-sleep "gtklock -d"
# Desktop notifications
exec mako
# Start foot server
exec_always --no-startup-id foot --server
# Autotiling
exec autotiling
# Network Applet
exec nm-applet --indicator
# Firewall Applet
exec sleep 2 && firewall-applet
# nwg-drawer
exec_always nwg-drawer -r -c 7 -is 90 -mb 10 -ml 50 -mr 50 -mt 10
# focus switch animations
exec systemctl --user enable --now flashfocus
# usb automount
exec systemctl --user enable --now pcmanfm
# persist clipboard after close
exec_always {
# persist clipboard after close
pkill -x wl-clip-persist
wl-clip-persist --clipboard regular --all-mime-type-regex '(?i)^(?!image/x-inkscape-svg).+'
}
# enable noisetorch
exec_always {
noisetorch -u
noisetorch -i
}
+247
View File
@@ -0,0 +1,247 @@
# Logo key. Use Mod1 for Alt.
set $mod Mod4
# Add Vim key support
set $left h
set $down j
set $up k
set $right l
# Set default terminal emulator
set $term footclient
# Application launcher
set $launcher fuzzel
# Application menu
set $menu nwg-drawer
# Power Menu
set $powermenu ~/.config/sway/scripts/power_menu.sh
### Key bindings
#
# Basics:
#
bindsym $mod+r reload
# Launch the terminal
bindsym $mod+Return exec $term
bindsym $mod+Shift+Return exec foot
# Open the power menu
bindsym $mod+Shift+e exec $powermenu
# Kill focused window
bindsym $mod+Shift+q kill
# Start your launcher
bindsym $mod+d exec $launcher
# Menu
bindsym $mod+Shift+d exec $menu
# Lock screen
bindsym $mod+f1 exec gtklock
# Activities
bindsym $mod+p exec ~/.config/sway/scripts/window_switcher.sh
# Move windows by holding down $mod and left mouse button.
# Resize them with right mouse button + $mod.
# Change "normal" to "inverse" to switch left and right
floating_modifier $mod normal
# Reload the configuration file
bindsym $mod+Shift+c reload
#
# Moving around:
#
bindsym {
# Change window focus
$mod+Left focus left
$mod+Down focus down
$mod+Up focus up
$mod+Right focus right
# Vim key support
$mod+$left focus left
$mod+$down focus down
$mod+$up focus up
$mod+$right focus right
# Move the focused window
$mod+Shift+Left move left
$mod+Shift+Down move down
$mod+Shift+Up move up
$mod+Shift+Right move right
# Vim key support
$mod+Shift+$left move left
$mod+Shift+$down move down
$mod+Shift+$up move up
$mod+Shift+$right move right
}
#
# Workspaces:
#
# Workspace bindings are using bindcode instead of bindsym for better Azerty compatibility.
# https://github.com/EndeavourOS-Community-Editions/sway/pull/81
# Use wev to find keycodes for setting up other bindings this way.
bindcode {
# Switch to workspace
$mod+10 workspace number 1
$mod+11 workspace number 2
$mod+12 workspace number 3
$mod+13 workspace number 4
$mod+14 workspace number 5
$mod+15 workspace number 6
$mod+16 workspace number 7
$mod+17 workspace number 8
$mod+18 workspace number 9
$mod+19 workspace number 10
# Move focused container to workspace
$mod+Shift+10 move container to workspace number 1
$mod+Shift+11 move container to workspace number 2
$mod+Shift+12 move container to workspace number 3
$mod+Shift+13 move container to workspace number 4
$mod+Shift+14 move container to workspace number 5
$mod+Shift+15 move container to workspace number 6
$mod+Shift+16 move container to workspace number 7
$mod+Shift+17 move container to workspace number 8
$mod+Shift+18 move container to workspace number 9
$mod+Shift+19 move container to workspace number 10
}
# Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default.
#
# Layout stuff:
#
# Set how the current window will be split
# Split the window vertically
# bindsym $mod+v splitv
# Split the window horizontally
# bindsym $mod+b splith
# Toggle
bindsym $mod+q split toggle
# Switch the current container between different layout styles
bindsym $mod+w layout stacking
bindsym $mod+t layout tabbed
bindsym $mod+e layout toggle split
# Make the current focus fullscreen
bindsym $mod+f fullscreen
# Toggle between tiling and floating mode
bindsym $mod+Shift+space floating toggle
bindsym $mod+Ctrl+space sticky toggle
# Swap focus between the tiling area and the floating area
bindsym $mod+space focus mode_toggle
# Move focus to the parent container
bindsym $mod+a focus parent
# Move focus to the child container
bindsym $mod+Shift+a focus child
#
# Scratchpad:
#
# Sway has a "scratchpad", which is a bag of holding for windows.
# You can send windows there and get them back later.
# Move the currently focused window to the scratchpad
bindsym $mod+Shift+minus move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+minus scratchpad show
#
# Resizing containers:
#
bindsym {
# Resize with arrow keys
$mod+ctrl+Right resize shrink width 10 px
$mod+ctrl+Up resize grow height 10 px
$mod+ctrl+Down resize shrink height 10 px
$mod+ctrl+Left resize grow width 10 px
# Resize with Vim keys
$mod+ctrl+$right resize shrink width 10 px
$mod+ctrl+$up resize grow height 10 px
$mod+ctrl+$down resize shrink height 10 px
$mod+ctrl+$left resize grow width 10 px
}
# Resize floating windows with mouse scroll:
bindsym --whole-window --border {
# Resize vertically
$mod+button4 resize shrink height 5 px or 5 ppt
$mod+button5 resize grow height 5 px or 5 ppt
# Resize horizontally
$mod+Shift+button4 resize shrink width 5 px or 5 ppt
$mod+Shift+button5 resize grow width 5 px or 5 ppt
}
#
# Media Keys
#
bindsym {
# Volume
XF86AudioRaiseVolume exec pamixer -ui 2
XF86AudioLowerVolume exec pamixer -ud 2
XF86AudioMute exec pamixer --toggle-mute
# Player
XF86AudioPlay exec playerctl play-pause
XF86AudioNext exec playerctl next
XF86AudioPrev exec playerctl previous
# Backlight
XF86MonBrightnessUp exec brightnessctl -c backlight set +5%
XF86MonBrightnessDown exec brightnessctl -c backlight set 5%-
}
#
# App shortcuts
#
bindsym $mod+u exec unipicker --command "rofi -dmenu | wl-copy"
# Launch the file explorer
bindsym $mod+b exec pcmanfm
# Dismiss message
bindsym $mod+n exec makoctl dismiss
bindsym $mod+Shift+n exec makoctl dismiss -a
# Launch the browser
bindsym $mod+o exec qutebrowser
# config tools
set $mode_monitor (b) btop, (h) htop, (s) isd, (j) journal, (n) nvtop
mode "$mode_monitor" {
bindsym b exec $term_float btop, mode "default"
bindsym h exec $term_float htop, mode "default"
bindsym s exec $term_float isd, mode "default"
bindsym j exec $term_float lazyjournal, mode "default"
bindsym n exec $term_float nvtop, mode "default"
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+m mode "$mode_monitor"
#
# Screenshots
#
# Snip a selection and pipe to swappy
bindsym print exec grim -g "$(slurp)" - | swappy -f -
# Screenshot a window and pipe to swappy
bindsym Ctrl+Print exec ~/.config/sway/scripts/screenshot_window.sh
# Screenshot the current display and pipe to swappy
bindsym Shift+Print exec ~/.config/sway/scripts/screenshot_display.sh
+20
View File
@@ -0,0 +1,20 @@
input type:touchpad {
dwt enabled
tap disabled
natural_scroll enabled
accel_profile "adaptive"
pointer_accel 0.8
}
input type:keyboard {
xkb_layout "us"
xkb_variant "altgr-weur"
xkb_options "caps:escape"
repeat_delay 400
repeat_rate 30
}
input type:mouse {
accel_profile "flat"
pointer_accel 0.5
}
+1
View File
@@ -0,0 +1 @@
output eDP-1 resolution 2496x1664 position 0,0 scale 1.3
+38
View File
@@ -0,0 +1,38 @@
# Apply gtk theming
exec_always ~/.config/sway/scripts/import-gsettings
# Set inner/outer gaps
gaps inner 2
gaps outer 0
# Hide titlebar on windows:
default_border pixel 1
# Default Font
font pango:Noto Sans Regular 10
# Thin borders:
smart_borders on
# Set wallpaper:
exec ~/.azotebg
# Title format for windows
for_window [shell="xdg_shell"] title_format "%title (%app_id)"
for_window [shell="x_wayland"] title_format "%class - %title"
# class border bground text indicator child_border
client.focused #6272A4 #6272A4 #F8F8F2 #6272A4 #6272A4
client.focused_inactive #44475A #44475A #F8F8F2 #44475A #44475A
client.unfocused #282A36 #282A36 #BFBFBF #282A36 #282A36
client.urgent #44475A #FF5555 #F8F8F2 #FF5555 #FF5555
client.placeholder #282A36 #282A36 #F8F8F2 #282A36 #282A36
client.background #F8F8F2
#
# Status Bar:
#
# Read `man 5 sway-bar` for more information about this section.
bar {
swaybar_command waybar
}
-29
View File
@@ -1,29 +0,0 @@
---
debug: true
wait: false
timeouts:
# idle_timeout
- timeout: 240
command: brightnessctl -s && brightnessctl set 10
resume: brightnessctl -r
# locking_timeout
- timeout: 1200
command: swaymsg exec \$locking
# screen_timeout
- timeout: 2400
command: swaymsg "output * power off"
resume: swaymsg "output * power on"
# dpms_timeout
# - timeout: 3600
# command: swaymsg "output * dpms off"
# resume: swaymsg "output * dpms on"
# sleep_timeout_bat
# - timeout: 900
# command: acpi --ac-adapter | grep -v 'on-line' && systemctl sleep
# sleep_timeout_ac
# - timeout: 3600
# command: acpi --ac-adapter | grep 'on-line' && systemctl sleep
before-sleep: swaymsg exec \$locking
after-resume: swaymsg "output * dpms on", exec "systemctl restart --user mako"
lock: swaymsg exec \$locking
idlehint: '240'
+3 -2
View File
@@ -9,11 +9,12 @@ set -g mouse on
# clipboard control # clipboard control
set -g set-clipboard on set -g set-clipboard on
set -g allow-passthrough set -g allow-passthrough
set -g history-limit 20000 set -g history-limit 100000
set -g focus-events on set -g focus-events on
# screen colors # screen colors
set -as terminal-features ",gnome*:RGB" set -g default-terminal "tmux-256color"
set -sa terminal-features ",xterm-256color:RGB"
# Start with index 1 # Start with index 1
set -g base-index 1 set -g base-index 1
+11
View File
@@ -10,6 +10,17 @@ image_delay = 50
max_width = 1500 max_width = 1500
max_height = 1500 max_height = 1500
[open]
prepend_rules = [
{ name = "*.csv", use = "text" },
]
[opener]
text = [
{ run = "bat $@", block = true, desc = "bat" },
{ run = "nvim $@", block = true, desc = "nvim" },
]
[input] [input]
cursor_blink = true cursor_blink = true