#!/bin/sh # # Profile of Surdeus. # reload-profile(){ . $PROFILE } no-output() { $@ &> /dev/null } sctl(){ systemctl $@ } jctl(){ journalctl $@ } export-loop(){ # Chore, because I'm lazy to type "export" so many times. # Standard "export" command takes arguments # from variables from the start, but I want to # use other variables in definition for next of them. while test -n "$1" ; do # Doing until we have arguments. value="$(eval echo $2)" name="$1" export "$name"="$value" shift 2 done } source-if-exist() { for i in $@ ; do if test -r "$i" ; then . "$i" fi done } if test "$OS" != "Windows_NT" ; then PATH="$HOME/exe:$HOME/.local/bin:$PATH" fi # Custom. export APP="$HOME/app" export BIN="$HOME/bin" export LOAD="$HOME/load" export ETC="$HOME/etc" export PATH="$PATH:$BIN" export GIT="https://surdeus.su" export DEV="$HOME/dev" # CLI. export ENV="$HOME/.shrc" export PROMPT="; " export PS1="$PROMPT" export SUDO_PROMPT="# " export EDITOR=`bb which nvim vim vi ed` export VISUAL="$EDITOR" export GIT_EDITOR="$VISUAL" export PAGER=`bb which less more` export MANPAGER="$PAGER" export CMDHIST="$ETC/cmds" export CMDHISTMAX="100" export PROFILE="$HOME/.profile" export ENVDIR="$HOME/env" export SETENV="$ETCsetenv/sh" export LOGIN="$ETC/login/sh" export INDENT=" " # XDG. export XDG_UTILS_DEBUG_LEVEL='3' export XDG_CONFIG_HOME="$HOME/.config" export XDG_DATA_HOME="$HOME/dat" export PERSONAL_SHELL="sh" export VIMRC="$HOME/.vimrc" export XKB_DEFAULT_OPTIONS="caps:escape" export SSH_ASKPASS='' # Golang. export GOPATH="$APP/go" export GOBIN="$BIN" export PATH="$PATH:$GOBIN" # X/Wayland stuff. export XCOMPOSER='river' export XTERMINAL='wayst' export XRUNNER='fuzzel' export XDMENU='fuzzel -d' export XBAR='waybar' export XBLUETOOTH_MANAGER='blueman-manager' export XOUTPUT_DAEMON='kanshi' export XSOUND_CONTROL='pavucontrol' export XFILE_MANAGER='thunar' export XRESOURCE_MONITOR="$XTERMINAL -e htop" export XCALENDAR="$XTERMINAL -e calcurse" export XPUSH_NOTIFICATION_DAEMON='dunst' export XNOTIFY='dunstify' export XLOCKER='swaylock' export XSUSPEND='systemctl suspend' export XCLIPBOARD_MANAGER='clipman store' export XEDITOR="`bb which nvim-qt`" export XCLIPBOARD_TOOL="clipman pick --tool=CUSTOM --tool-args='$XDMENU'" export XDISPLAY_REGION="slurp" export XDISPLAY_SCREENSHOT="grim" export XDISPLAY_REGION_SCREENSHOT='slurp | grim -g - - | wl-copy' # Android. export ANDROID_HOME="$HOME/app/android/Sdk" #export ANDROID_SDK_HOME="$HOME/app/android-sdk" export ANDROID_USER_HOME=$XDG_CONFIG_HOME/android export PATH="$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools" #export PATH="$PATH:$ANDROID_SDK_HOME/cmdline-tools/*/bin" source-if-exist "$ETC/script/lf.sh" test -r $SETENV && . "$SETENV" && setenv profile # Visual editor. if no-output which bb ; then ve() { `bb which nvim vim vi` $@ } fi export GPG_TTY=$(tty) export SSH_TTY=$(tty)