M root/etc/skel/.bashrc => root/etc/skel/.bashrc +19 -0
@@ 13,3 13,22 @@ chtitle () {
PROMPT_COMMAND=chtitle
PS1="[\u@\h \W]\$ "
+profile_dirs="$HOME/.config/profile_dirs"
+
+# Allow a path to load .profile on cd
+allow_profile () {
+ (realpath $1 2>/dev/null || pwd) >> "$profile_dirs"
+ # sort and remove dupes
+ sort -u "$profile_dirs" -o "$profile_dirs"
+}
+
+# Load local .profile files on each cd (if allowed)
+cd () {
+ command cd $@
+ test -f .profile && grep -q "^$(pwd)\$" "$profile_dirs" 2>/dev/null && . .profile
+}
+
+# Spawn new shell on current directory
+shpawn () {
+ swaymsg exec "\$term --working-directory '$(pwd)'"
+}
M root/etc/sway/config.d/defaults => root/etc/sway/config.d/defaults +1 -1
@@ 6,7 6,7 @@
include ~/.config/sway/vars
# Terminal emulator
-set $term alacritty
+set $term alacritty
# Application launcher
set $menu bemenu-run | xargs swaymsg exec --