Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .config/distrobox/distrobox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[music-arch]
image="quay.io/toolbx/arch-toolbox:latest"
home="/mnt/lucie/distrobox-home/music"
additional_packages="picard pipewire pipewire-pulse pipewire-alsa libpulse git curl fish neovim lua luarocks"
pre_init_hooks="export SHELL=/usr/bin/fish;"
# mnt volumes are already mounted by default
pull=true
replace=false

45 changes: 45 additions & 0 deletions .config/distrobox/link_configs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env bash
#
# link_configs.sh - Symlink dotfiles from source to destination home directory
#
# Usage:
# ./link_configs.sh /home/lucie/dotfiles /home/lucie
#
# Arguments:
# homeDirSource - Directory containing the original config files/dirs
# homeDirDest - Destination home directory where symlinks will be created
#
# Notes:
# - Edit the 'paths' array below to add/remove configurations
# - Handles both files and directories (e.g. .config/fish/config.fish)
# - Parent directories are created automatically in the destination
# - Existing symlinks are overwritten (-f flag)

homeDirSource="$1"
homeDirDest="$2"

paths=(
".config/fontconfig"
".local/share"
".config/gtk-3.0"
".config/gtk-4.0"
".config/qt5ct"
".config/qt6ct"
".config/Kvantum"
".config/fish/config.fish"
".config/fish/conf.d"
".config/fish/functions"
".config/kitty"
".config/nvim"
".local/share/themes"
".local/share/icons"
".local/share/fonts"
"scripts"
".shell_env"
)

for p in "${paths[@]}"; do
mkdir -p "${homeDirDest}/$(dirname "${p}")"
ln -sf "${homeDirSource}/${p}" "${homeDirDest}/${p}"
done

19 changes: 11 additions & 8 deletions .config/fish/config.fish
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,13 @@ if status is-interactive

### OS SPECIFIC ###
if test (uname -s) = "Darwin"
set OS_NAME (sw_vers -productName)
set -g OS_NAME macos
else
set OS_NAME (lsb_release -is)
end
set -g OS_NAME linux
if test -e /etc/os-release
set -g OS_NAME (grep '^ID=' /etc/os-release | string replace -r '^ID="?(.+)"?$' '$1')
end
end

# if the variable $CONTAINER_ID exists, the sessions is in a distrobox container
if test -n "$CONTAINER_ID"
Expand All @@ -163,11 +166,11 @@ if status is-interactive
end

switch $OS_NAME
case "Ubuntu"
case "ubuntu"
abbr --add ca batcat --color=always
alias cat='batcat -p --color=always'
abbr --add upd "sudo apt update && sudo apt upgrade -y"
case "Arch"
case "arch"
abbr --add ca bat --color=always
alias cat='bat -p --color=always'
# pacman and yay
Expand All @@ -184,7 +187,7 @@ if status is-interactive
alias mirrors="sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist"
alias mirrora="sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist"

case "Fedora"
case "fedora"
alias dmenu='wofi --dmenu'
abbr --add vi "nvim"
abbr --add upd "sudo dnf upgrade"
Expand All @@ -194,10 +197,10 @@ if status is-interactive
exec Hyprland
end

case "macOS"
case "macos"
abbr --add ca bat --color=always
alias cat='bat -p --color=always'
case "Linuxmint"
case "linuxmint"
abbr --add ca batcat --color=always
alias cat='batcat -p --color=always'
abbr --add upd "sudo apt update && sudo apt upgrade -y"
Expand Down
20 changes: 11 additions & 9 deletions .config/xonsh/rc.d/00_rc.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,19 @@ def isDistrobox():
system = platform.system()

if system == "Darwin":
OS_NAME = subprocess.check_output(
["sw_vers", "-productName"], text=True
).strip()
OS_NAME = "macos"
else:
OS_NAME = system.lower()
try:
OS_NAME = subprocess.check_output(
["lsb_release", "-is"], text=True
).strip()
except Exception:
OS_NAME = system

with open("/etc/os-release", "r") as f:
for line in f:
if line.startswith("ID="):
# Strip 'ID=', then strip quotes and whitespace
OS_NAME = line.split("=", 1)[1].strip().strip('"').strip("'").lower()
break
except FileNotFoundError:
pass

__xonsh__.env['OS_NAME'] = OS_NAME

# --------------------------------------------------------
Expand Down
10 changes: 5 additions & 5 deletions .config/xonsh/rc.d/21_aliases_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
archUpdateCmd += " && sudo flatpak update --assumeyes"


if OS_NAME == "Arch":
if OS_NAME == "arch":
abbrevs["ca"] = "bat --color=always"
abbrevs["upd"] = archUpdateCmd
aliases["cat"] = "bat -p --color=always"
Expand All @@ -45,12 +45,12 @@
"mirrora": "sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist",
})

elif OS_NAME == "Ubuntu":
elif OS_NAME == "ubuntu":
abbrevs["ca"] = "batcat --color=always"
abbrevs["upd"] = debUpdateCmd
aliases["cat"] = "batcat -p --color=always"

elif OS_NAME == "Fedora":
elif OS_NAME == "fedora":
abbrevs["vi"] = "nvim"
abbrevs["upd"] = "sudo dnf upgrade"

Expand All @@ -61,11 +61,11 @@
except Exception:
pass

elif OS_NAME == "macOS":
elif OS_NAME == "macos":
abbrevs["ca"] = "bat --color=always"
aliases["cat"] = "bat -p --color=always"

elif OS_NAME == "Linuxmint":
elif OS_NAME == "linuxmint":
abbrevs["ca"] = "batcat --color=always"
abbrevs["upd"] = debUpdateCmd
aliases["cat"] = "batcat -p --color=always"
Expand Down
4 changes: 2 additions & 2 deletions .local/bin/distrobox-app-example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#!/usr/bin/env bash
if [ -x "/bin/full/path/of/executable" ]; then
. /bin/full/path/of/executable
exec /bin/full/path/of/executable "$@"
else
/usr/bin/distrobox enter container-name -- application "$@"
fi
Expand Down
7 changes: 7 additions & 0 deletions .local/bin/picard
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
if [ -x "/usr/bin/picard" ]; then
exec /usr/bin/picard "$@"
else
/usr/bin/distrobox enter music-arch -- picard "$@"
fi