From 001d17542cdda531fa7a2ee8ab90d47e01d251dc Mon Sep 17 00:00:00 2001 From: Mehdi Sadeghi Date: Wed, 23 Feb 2022 08:02:30 +0100 Subject: [PATCH] Replace hostname with proc --- .config/sway/config | 4 ++-- .env | 4 +++- .local/bin/prompt | 2 +- .profile | 5 +++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.config/sway/config b/.config/sway/config index 2e4eb3d..92af8b1 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -4,11 +4,11 @@ set $down j set $up k set $right l set $mod Mod4 -set $term foot-extra +set $term foot # Note: pass the final command to swaymsg so that the resulting window can be opened # on the original workspace that the command was run on. -set $menu dmenu_path | dmenu | xargs swaymsg exec -- +set $menu dmenu_path | dmenu -fn 'SourceCodePro' | xargs swaymsg exec -- ### Output configuration # diff --git a/.env b/.env index 2132db0..e8c565e 100644 --- a/.env +++ b/.env @@ -37,11 +37,13 @@ alias mbsync="mbsync -c ~/.config/isync/mbsyncrc" export GPG_TTY="$(tty)" gpg-connect-agent updatestartuptty /bye >/dev/null export PATH=$HOME/.local/bin:$PATH -export PATH=$HOME/.local/bin/`hostname`:$PATH +HOSTNAME=$(cat /proc/sys/kernel/hostname) +export PATH=$HOME/.local/bin/$HOSTNAME:$PATH export PATH=$HOME/.local/bin/`uname -m`:$PATH export PATH=$HOME/.cargo/bin:$PATH export GOPATH="$HOME/.local/share/go" export PATH=$GOPATH/bin:$PATH export BROWSER=w3m +export LANGUAGE=en echo .env end diff --git a/.local/bin/prompt b/.local/bin/prompt index f9b3836..27e0039 100755 --- a/.local/bin/prompt +++ b/.local/bin/prompt @@ -1,7 +1,7 @@ #!/bin/sh BRANCH=$(git branch --show-current 2>/dev/null) BRANCH=$(test -n "$BRANCH" && echo "($BRANCH)") -PROMPT="$USER@$(hostname):$( test "$PWD" = $HOME && echo '~' || echo "$PWD")$BRANCH" +PROMPT="$USER@$(cat /proc/sys/kernel/hostname):$( test "$PWD" = $HOME && echo '~' || echo "$PWD")$BRANCH" case $(id -u) in 0) echo "$PROMPT# " ;; *) echo "$PROMPT$ " ;; diff --git a/.profile b/.profile index cb54b12..ae6ffb5 100644 --- a/.profile +++ b/.profile @@ -14,7 +14,8 @@ export CXXFLAGS="${CFLAGS}" export _JAVA_AWT_WM_NONREPARENTING=1 export GDK_BACKEND=wayland -[ -e .config/$(hostname).profile ] && . .config/$(hostname).profile -[ $0 != sh ] && [ -n $BASH_VERSION ] && shopt login_shell 2>&1 > /dev/null && [ -f ~/.bashrc ] && . ~/.bashrc +HOSTNAME=$(cat /proc/sys/kernel/hostname) +[ -e .config/$HOSTNAME.profile ] && . .config/$HOSTNAME.profile +[ $0 != sh ] && [ -n "$BASH_VERSION" ] && shopt login_shell 2>&1 > /dev/null && [ -f ~/.bashrc ] && . ~/.bashrc echo .profile end -- 2.45.2