Compare commits

...

31 Commits

Author SHA1 Message Date
00a6d6523d dot_local: update npm wrapper
Use a dedicated wrapper for npm with mise. This is easier than try-
ing to have a single tool wrapper that covers multiple tools like
yarn and npm, and environments with and without mise.
2025-10-07 09:59:45 +03:00
f6fffb906a Remove dotdrop dotfiles 2025-09-27 11:50:19 +03:00
984018cfc9 Add ~/.mise.toml
Top-level mise config to prepend ~/.local/bin to the $PATH so we
can run the bubblewrapped npm and yarn instad of those that are
in the respective mise Node.js environments.
2025-09-17 08:23:48 +03:00
1800320e47 Add ~/.local/bin/bwrap_tool.sh
Bubblewrap script to run npm and yarn more safely.
2025-09-17 08:22:51 +03:00
2c794e365f .chezmoiignore: ignore license and readme 2025-09-15 18:55:48 +03:00
ab44e2ee8e dot_vimrc: adjust column width
Don't force wrapping at 80.
2025-09-15 13:06:46 +03:00
c125d1ece8 Switch to chezmoi
Update the README and remove dotdrop submodule.
2025-09-15 10:16:50 +03:00
b67c32686f .chezmoiignore: paths are relative to home 2025-09-15 10:11:56 +03:00
c0e8d5a21e .chezmoiignore: reverse logic
We need to ignore these targets when the host is peanut.
2025-09-15 10:11:56 +03:00
50eaea5525 Add .chezmoiignore
The logic in here is not intuitive coming from dotdrop. We need to
exclude certain files on peanut because it doesn't have a desltop
environment.
2025-09-15 10:11:56 +03:00
8d5e23002a dot_zshrc.tmpl: set ELECTRON_OZONE_PLATFORM_HINT=auto
For Electron 28+.

See: https://wiki.archlinux.org/title/Wayland
2025-09-15 10:11:56 +03:00
9385864241 dot_zshrc.tmpl: remove MOZ_ENABLE_WAYLAND
As of Firefox 121 and Thunderbird 128 Wayland is the default so we
do not need these anymore.
2025-09-15 10:11:56 +03:00
392b31ee59 Add ~/.psqlrc 2025-09-15 10:11:56 +03:00
8869fabefe Add ~/.local/share
Dark mode and light mode scripts for darkman.
2025-09-15 10:11:56 +03:00
6d2ec139ab Add ~/.local/bin 2025-09-15 10:11:56 +03:00
6c26d690a4 Add ~/.config/xdg-desktop-portal 2025-09-15 10:11:55 +03:00
8ae937a387 Add ~/.config/xdg-desktop-portal-wlr 2025-09-15 10:11:55 +03:00
92bca56efa Remove wofi config
I've been using fuzzel for a while now.
2025-09-15 10:11:55 +03:00
dd8472ea3c Add ~/.config/wofi 2025-09-15 10:11:55 +03:00
de957f0e41 dot_config/waybar/style.css: Font Awesome 7 2025-09-15 10:11:55 +03:00
0f46d4633e Add ~/.config/waybar 2025-09-15 10:11:55 +03:00
fc37ef1c6f Add ~/.config/systemd/user 2025-09-15 10:11:55 +03:00
d321b3c26f Add ~/.config/sway 2025-09-15 10:11:55 +03:00
3e685faddb Add ~/.config/mako 2025-09-15 10:11:54 +03:00
d770f47405 Add ~/.config/kanshi 2025-09-15 10:11:54 +03:00
c0cff5d8e2 Add ~/.config/foot 2025-09-15 10:11:54 +03:00
9764189920 Add ~/.config/fuzzel 2025-09-15 10:11:54 +03:00
deeed096ac Add ~/.zshrc 2025-09-15 10:11:54 +03:00
6c4ac2fc4a Add ~/.config/tmux 2025-09-15 10:11:54 +03:00
f721fad56f Add ~/.config/darkman 2025-09-15 10:11:54 +03:00
2c982c2706 Add ~/.vim and ~/.vimrc 2025-09-15 10:11:53 +03:00
41 changed files with 140 additions and 363 deletions

17
.chezmoiignore Normal file
View File

@@ -0,0 +1,17 @@
LICENSE.txt
README.md
# Dotfiles for hosts with a desktop environment
{{- if eq .chezmoi.hostname "peanut" }}
.config/darkman
.config/foot
.config/fuzzel
.config/kanshi
.config/mako
.config/sway
.config/systemd
.config/waybar
.config/xdg-desktop-portal
.config/xdg-desktop-portal-wlr
# dark and light mode scripts for darkman
.local/share
{{ end -}}

View File

@@ -1,26 +1,25 @@
# Alan's dotfiles
Alan's dotfiles are managed with [dotdrop](https://github.com/deadc0de6/dotdrop). To set up on a new Arch Linux machine install [dotdrop from AUR](https://aur.archlinux.org/packages/dotdrop) and do this:
Alan's dotfiles are managed with [chezmoi](https://www.chezmoi.io/).
## Setup on Arch Linux
Install [dotdrop from AUR](https://aur.archlinux.org/packages/dotdrop) and then install the dotfiles:
Install [`chezmoi` from the official package repository](https://archlinux.org/packages/?q=chezmoi):
```console
$ git clone --recursive https://git.mjanja.ch/alanorth/dotfiles.git
$ dotdrop install
$ sudo pacman -S chezmoi
```
## Setup on Other Linux
Bootstrap the repository's copy of dotdrop, prepare Python deps, and then install the dotfiles:
## Initialize dotfiles
```console
$ git clone --recursive https://git.mjanja.ch/alanorth/dotfiles.git
$ ./dotdrop/bootstrap.sh
$ pip3 install -r dotdrop/requirements.txt --user
$ ./dotdrop.sh install
$ chezmoi init
$ chezmoi cd
$ git remote add origin https://git.mjanja.ch/alanorth/dotfiles.git
$ git pull
$ chezmoi apply
```
## License
Copyright (C) 20152022 Alan Orth
Copyright (C) 20152025 Alan Orth
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,154 +0,0 @@
config:
backup: true
create: true
dotpath: dotfiles
dotfiles:
d_vim:
src: vim
dst: ~/.vim
f_vimrc:
src: vimrc
dst: ~/.vimrc
f_tmux.conf:
src: config/tmux/tmux.conf
dst: ~/.config/tmux/tmux.conf
f_foot.ini:
src: config/foot/foot.ini
dst: ~/.config/foot/foot.ini
f_mako_config:
src: config/mako/config
dst: ~/.config/mako/config
f_kanshi_config:
src: config/kanshi/config
dst: ~/.config/kanshi/config
d_wofi:
src: config/wofi
dst: ~/.config/wofi
f_zshrc:
src: zshrc
dst: ~/.zshrc
d_sway:
src: config/sway
dst: ~/.config/sway
f_kanshi.service:
src: config/systemd/user/kanshi.service
dst: ~/.config/systemd/user/kanshi.service
f_swayidle.service:
src: config/systemd/user/swayidle.service
dst: ~/.config/systemd/user/swayidle.service
f_wob.service:
src: config/systemd/user/wob.service
dst: ~/.config/systemd/user/wob.service
f_wob.socket:
src: config/systemd/user/wob.socket
dst: ~/.config/systemd/user/wob.socket
f_sway-session.target:
src: config/systemd/user/sway-session.target
dst: ~/.config/systemd/user/sway-session.target
f_psqlrc:
src: psqlrc
dst: ~/.psqlrc
f_bashrc:
src: bashrc
dst: ~/.bashrc
f_xdg_desktop_portal_wlr_config:
src: config/xdg-desktop-portal-wlr/config
dst: ~/.config/xdg-desktop-portal-wlr/config
f_geoclue-agent.service:
src: config/systemd/user/geoclue-agent.service
dst: ~/.config/systemd/user/geoclue-agent.service
d_local_bin:
src: local/bin
dst: ~/.local/bin
f_ssh_config:
src: ssh/config
dst: ~/.ssh/config
f_ssh-agent.service:
src: config/systemd/user/ssh-agent.service
dst: ~/.config/systemd/user/ssh-agent.service
d_waybar:
src: config/waybar
dst: ~/.config/waybar
f_fuzzel.ini:
src: config/fuzzel/fuzzel.ini
dst: ~/.config/fuzzel/fuzzel.ini
f_wezterm.lua:
src: wezterm.lua
dst: ~/.wezterm.lua
f_convert-libaom.sh:
src: local/bin/convert-libaom.sh
dst: ~/.local/bin/convert-libaom.sh
chmod: '755'
f_dark-mode-theme.sh:
src: local/share/dark-mode.d/01-gtk-theme.sh
dst: ~/.local/share/dark-mode.d/01-gtk-theme.sh
chmod: '755'
f_light-mode-theme.sh:
src: local/share/light-mode.d/01-gtk-theme.sh
dst: ~/.local/share/light-mode.d/01-gtk-theme.sh
chmod: '755'
f_darkman_config.yaml:
src: config/darkman/config.yaml
dst: ~/.config/darkman/config.yaml
profiles:
everywhere:
dotfiles:
- d_vim
- f_vimrc
- f_tmux.conf
- f_zshrc
balozi:
dotfiles:
- d_vim
- f_vimrc
- f_tmux.conf
- f_foot.ini
- f_mako_config
- f_kanshi_config
- d_wofi
- f_zshrc
- d_sway
- f_kanshi.service
- f_swayidle.service
- f_wob.service
- f_wob.socket
- f_sway-session.target
- f_psqlrc
- f_xdg_desktop_portal_wlr_config
- d_local_bin
- f_ssh-agent.service
- d_waybar
- f_fuzzel.ini
- f_wezterm.lua
- f_convert-libaom.sh
- f_dark-mode-theme.sh
- f_light-mode-theme.sh
- f_darkman_config.yaml
knafeh:
dotfiles:
- d_vim
- f_vimrc
- f_tmux.conf
- f_foot.ini
- f_mako_config
- f_kanshi_config
- d_wofi
- f_zshrc
- d_sway
- f_kanshi.service
- f_swayidle.service
- f_wob.service
- f_wob.socket
- f_sway-session.target
- f_psqlrc
- f_xdg_desktop_portal_wlr_config
- f_geoclue-agent.service
- d_local_bin
- f_ssh-agent.service
- d_waybar
- f_fuzzel.ini
- f_wezterm.lua
- f_convert-libaom.sh
- f_dark-mode-theme.sh
- f_light-mode-theme.sh
- f_darkman_config.yaml

View File

@@ -5,22 +5,17 @@
term=xterm-256color
# Use fc-list to check fonts and styles
{%@@ if profile == "knafeh" @@%}
{{- if eq .chezmoi.hostname "knafeh" }}
font=Cascadia Mono:style=Roman:size=12
font-bold=Cascadia Mono:style=SemiBold:size=12
font-italic=Cascadia Mono:style=Italic:size=12
{%@@ elif profile == "balozi" @@%}
font-bold-italic=Cascadia Mono:style=Bold Italic:size=12
{{- else if eq .chezmoi.hostname "balozi" }}
font=Cascadia Mono:style=Roman:size=13.5
font-bold=Cascadia Mono:style=SemiBold:size=13.5
font-italic=Cascadia Mono:style=Italic:size=13.5
{%@@ endif @@%}
# I don't know where any bold italic is used, but this should work if I ever
# find any.
{%@@ if profile == "knafeh" @@%}
font-bold-italic=Cascadia Mono:style=Bold Italic:size=12
{%@@ elif profile == "balozi" @@%}
font-bold-italic=Cascadia Mono:style=Bold Italic:size=13.5
{%@@ endif @@%}
{{- end }}
# Selenized dark
include=/usr/share/foot/themes/selenized-dark

View File

@@ -27,9 +27,9 @@ profile external-hp2 {
}
profile internal {
{%@@ if profile == "knafeh" @@%}
{{- if eq .chezmoi.hostname "knafeh" }}
output eDP-1 enable mode 2560x1440 scale 1.75 position 0,0
{%@@ elif profile == "balozi" @@%}
{{- else if eq .chezmoi.hostname "balozi" }}
output eDP-1 enable mode 1920x1080 scale 1.33 position 0,0
{%@@ endif @@%}
{{- end }}
}

View File

@@ -22,7 +22,7 @@
* {
border: none;
border-radius: 0;
font-family: Source Sans Pro Semibold, "Font Awesome 6 Free", sans-serif;
font-family: Source Sans Pro Semibold, "Font Awesome 7 Free", sans-serif;
font-size: 13px;
min-height: 0;
}

View File

@@ -0,0 +1,14 @@
# 2025-04-02: copied from /usr/share/xdg-desktop-portal/sway-portals.conf
[preferred]
default=gtk
org.freedesktop.impl.portal.ScreenCast=wlr
org.freedesktop.impl.portal.Screenshot=wlr
# xdg-desktop-portal-gtk's implementation uses org.gnome.SessionManager and
# org.freedesktop.ScreenSaver, neither of which is implemented by Sway. This
# will cause some programs (e.g. Firefox) to use Wayland's idle-inhibit
# protocol instead, which sway does implement.
org.freedesktop.impl.portal.Inhibit=none
# 2025-04-02: needed for GTK applications?
# See: https://gitlab.com/WhyNotHugo/darkman/-/issues/65
org.freedesktop.impl.portal.Settings=darkman

View File

@@ -0,0 +1,43 @@
#!/usr/bin/env bash
#
# Wrap npm in bubblewrap, modified to use mise's node environment.
#
# See: https://news.ycombinator.com/item?id=45034496
mise_npm_path=$(mise which npm 2> /dev/null)
if [[ $? -ne 0 ]]; then
echo "There is no active mise environment providing npm"
exit 1
fi
# Get path to this environment's node
mise_node_path=$(mise where node)
echo "================================="
echo "Wrapping mise's npm in bubblewrap"
echo "================================="
exec bwrap \
--ro-bind "$mise_node_path" "$mise_node_path" \
--bind ~/.cache ~/.cache \
--bind "${PWD}" "${PWD}" \
--dev /dev \
--die-with-parent \
--disable-userns \
--new-session \
--proc /proc \
--ro-bind /etc/ca-certificates /etc/ca-certificates \
--ro-bind /etc/resolv.conf /etc/resolv.conf \
--ro-bind /etc/ssl /etc/ssl \
--ro-bind /usr /usr \
--setenv PATH /usr/bin \
--symlink /usr/bin /bin \
--symlink /usr/bin /sbin \
--symlink /usr/lib /lib \
--symlink /usr/lib64 /lib64 \
--tmpfs /tmp \
--unshare-all \
--unshare-user \
--share-net \
"$mise_npm_path" "$@"

View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
#
# See: https://news.ycombinator.com/item?id=45034496
bin=$(basename "$0")
echo "==========================="
echo "Wrapping $bin in bubblewrap"
echo "==========================="
exec bwrap \
--bind ~/.cache ~/.cache \
--bind "${PWD}" "${PWD}" \
--dev /dev \
--die-with-parent \
--disable-userns \
--new-session \
--proc /proc \
--ro-bind /etc/ca-certificates /etc/ca-certificates \
--ro-bind /etc/resolv.conf /etc/resolv.conf \
--ro-bind /etc/ssl /etc/ssl \
--ro-bind /usr /usr \
--setenv PATH /usr/bin \
--symlink /usr/bin /bin \
--symlink /usr/bin /sbin \
--symlink /usr/lib /lib \
--symlink /usr/lib64 /lib64 \
--tmpfs /tmp \
--unshare-all \
--unshare-user \
--share-net \
/usr/bin/env "$bin" "$@"

View File

@@ -0,0 +1 @@
/home/aorth/.local/bin/bwrap_npm_mise.sh

View File

@@ -0,0 +1 @@
/home/aorth/.local/bin/bwrap_tool.sh

3
dot_mise.toml Normal file
View File

@@ -0,0 +1,3 @@
[env]
# prepend PATH with local one so we can use npm wrapper (bwrap)
_.path = ["~/.local/bin"]

View File

@@ -6,8 +6,7 @@ set expandtab " tabs are spaces
set backspace=2 " backspace like in a graphical text editor
set wildmode=longest,list " change filename autocomplete to be more like bash
set mouse=v " some vim defaults to mouse=a, which sucks for copying and pasting in Xorg
set textwidth=80 " set textwidth to 80 characters
set colorcolumn=+1 " make it obvious where 80 characters is
set colorcolumn=81 " make it obvious where 80 characters is
syntax on
filetype on " enable file type detection
filetype plugin on " enable file type plugins

View File

@@ -28,14 +28,13 @@ if [[ "$OSTYPE" =~ ^linux.*$ ]]; then
# Only add local bin if it's not already present
[[ ! $PATH == *.local/bin* ]] && PATH=~/.local/bin:$PATH
{%@@ if profile == "knafeh" or profile == "balozi" @@%}
# Export these variables in our TTY so that Sway can read them when it
# starts. It's not pretty, but it's all we can do since support for
# ~/.pam_environment was removed from pambase in Arch Linux recently.
export MOZ_ENABLE_WAYLAND=1
{{ if or (eq .chezmoi.hostname "knafeh") (eq .chezmoi.hostname "balozi") }}
# 2021-06-22: fix "Firefox is already running" message
# See: https://mastransky.wordpress.com/2020/03/16/wayland-x11-how-to-run-firefox-in-mixed-environment/
export MOZ_DBUS_REMOTE=1
# 2025-09-05: Electron 28+
# See: https://wiki.archlinux.org/title/Wayland
export ELECTRON_OZONE_PLATFORM_HINT=auto
export QT_QPA_PLATFORM=wayland-egl
export CLUTTER_BACKEND=wayland
# 2020-02-10: https://github.com/swaywm/sway/wiki#issues-with-java-applications
@@ -52,11 +51,14 @@ if [[ "$OSTYPE" =~ ^linux.*$ ]]; then
# For rsync breaking change in arg parsing since 2022
# See: https://github.com/bit-team/backintime/issues/1247
export RSYNC_OLD_ARGS=1
{%@@ endif @@%}
{{- end }}
{%@@ if profile == "knafeh" or profile == "balozi" @@%}
{{ if or (eq .chezmoi.hostname "knafeh") (eq .chezmoi.hostname "balozi") }}
# 2023-12-27: use Vulkan renderer in Sway
# 2024-03-23: still buggy
# 2025-01-02: seem to work on newer Intel
export WLR_RENDERER=vulkan
{%@@ endif @@%}
{{- end }}
fi
# Enable zsh completions for mise version manager

Submodule dotdrop deleted from 296c179f62

View File

@@ -1,64 +0,0 @@
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# OS-specific things
if [[ "$OSTYPE" =~ ^darwin.*$ ]]; then
PATH=$(brew --prefix coreutils)/libexec/gnubin:/usr/local/sbin:$PATH
if [[ -f $(brew --prefix)/etc/bash_completion ]]; then
. $(brew --prefix)/etc/bash_completion
fi
fi
# Aliases
alias ls='ls -F --color=auto'
alias less='less -R' # preserves colors in GNU coreutils' `less`
# Environment
PS1='[\u@\h: \w]\$ '
export EDITOR=/usr/bin/vim
export PAGER=/usr/bin/less
# sequence to set the terminal title to "user@hostname: pwd"
TITLEBAR='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
# ignore commands starting with space and duplicates
HISTCONTROL=ignoreboth
# ignore common commands in bash history
HISTIGNORE='ls:bg:fg:history'
PROMPT_COMMAND="$TITLEBAR"
# look for Ansible hosts file in current directory
export ANSIBLE_HOSTS=hosts
# look for Node binaries in current directory
# if we have npm, we probably want to use npm binaries
# I don't like installing globally (npm -g), so add local
# node modules' bin to PATH
command -v npm >/dev/null 2>&1
if [[ $? -eq 0 ]]; then
export PATH=$PATH:node_modules/.bin
fi
# If a private bin directory exists, add it to PATH
[[ -d ~/bin ]] && PATH="$PATH:~/bin"
# selenized dircolors
# see: https://github.com/jan-warchol/selenized/tree/master/other-apps/dircolors
export LS_COLORS="$LS_COLORS:ow=1;7;34:st=30;44:su=30;41"
# Settings
# Don't exit when accidentally pressing ^D
set -o ignoreeof
# Append, rather than overwrite history files
# Useful for when multiple bash sessions are running
shopt -s histappend
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
export PATH

View File

@@ -1,17 +0,0 @@
#show=drun
#filter_rate=100
#allow_markup=true
#no_actions=true
#halign=fill
#orientation=vertical
#content_halign=fill
#insensitive=true
allow_images=true
image_size=40
#width=300
#height=200
insensitive=true
mode=drun,run
columns=1
padding:5
lines=6

View File

@@ -1,60 +0,0 @@
/**
* Selenized dark variant Wofi Color theme
**/
window {
margin: 1px;
border: 1px solid #adbcbc;
background-color: #103c48;
}
#input {
margin: 1px;
border: 2px dashed #84c747;
border-top-color: #103c48;
border-left-color: #103c48;
border-right-color: #103c48;
border-bottom-color: #84c747;
background-color: #103c48;
color: #adbcbc;
font: 14px DejaVu Sans Mono;
}
#inner-box {
margin: 1px;
border: 2px none #103c48;
background-color: #103c48;
}
#outer-box {
margin: 1px;
border: 2px none #103c48;
background-color: #103c48;
}
#scroll {
margin: 1px;
border: 2px solid #103c48;
background-color: #103c48;
color: #adbcbc;
}
#text {
margin: 1px;
border: 1px none #103c48;
font: 14px DejaVu Sans Mono;
}
#selected {
margin: 0px;
border: 2px none #325b66;
background-color: #325b66;
color: #adbcbc;
}
#entry {
margin: 1px;
border: 1px none #103c48;
background-color: #103c48;
}

View File

@@ -1 +0,0 @@
AddKeysToAgent yes

View File

@@ -1,32 +0,0 @@
-- Pull in the wezterm API
local wezterm = require 'wezterm'
-- This table will hold the configuration.
local config = {}
-- In newer versions of wezterm, use the config_builder which will
-- help provide clearer error messages
if wezterm.config_builder then
config = wezterm.config_builder()
end
config.font = wezterm.font 'Cascadia Mono'
config.font_size = 13.5
-- This is where you actually apply your config choices
config.color_scheme = 'Selenized Dark (Gogh)'
-- Disable bold colors for Solarized / Selenized
config.bold_brightens_ansi_colors = false
config.hide_tab_bar_if_only_one_tab = true
-- Disable default padding
config.window_padding = {
left = 0,
right = 0,
top = 0,
bottom = 0,
}
-- and finally, return the configuration to wezterm
return config