Skip to content
Snippets Groups Projects
Commit bcb6b196 authored by Sven Mäder's avatar Sven Mäder :speech_balloon:
Browse files

Remove xdg, update readme

parent 949029ce
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
# ~/.envrcd/.envrcd: this file should be symllinked to ~/.bashrc
# ~/.envrcd/.envrcd: this file should be symlinked to ~/.bashrc
# if not running interactively, don't do anything
case $- in
......@@ -38,7 +38,7 @@ function source_if_exists {
done
}
# source common files from a directory (${ENVRCD_NAME}, ${ENVRCD_NAME}.d, .bashrc)
# source common files from a profile (${ENVRCD_NAME}, ${ENVRCD_NAME}.d, .bashrc)
function source_profile_if_exists {
source_if_exists "${ENVRCD_PATH}/profile/${1}/${ENVRCD_NAME}"
source_if_exists "${ENVRCD_PATH}/profile/${1}/${ENVRCD_NAME}.d/*"
......
......@@ -3,13 +3,13 @@ envrcd
An environment switcher for shared system accounts.
motivation
Motivation
----------
A sysadmin is more efficient with his custom tweaked environment, that includes aliases, colors, environment variables, program settings etc. Of course this does not apply for real hacker gurus in front of a green shimmering CRT screen. But some noob admins, like me, would be completely lost if vim is in compatibility mode: "Why are the arrow keys not working?". With only `/root/.bashrc` all admins need to agree on a common environment. Nobody will be completely happy with the consensus. This project tries to solve that problem.
An admin is probably more efficient and certainly much happier in his customized environment. That includes settings like aliases, colors, environment variables, program configurations etc. Of course this does not apply for real hacker gurus in front of a green shimmering CRT screen, they just need one color, that is green, and the defaults. But some noob admins, like me, don't even know how to move the cursor if vim is in compatibility mode. With only `/root/.bashrc` all admins need to agree on a common environment. Nobody will be completely happy. This project tries to solve that problem.
reserved files in main `envrcd.d`
--------------------------------
Reserved files in `envrcd.d`
----------------------------
These files should only exist locally and are ignored by git
......@@ -40,7 +40,7 @@ export ENVRCD_INVENTORY="testing" # set inventory group
Create this file to set host specific settings that should override possible user settings. Useful to define host specific aliases.
basic operation
Basic operation
---------------
The script works by sending environment variables prefixed with `ENVRCD_SET_*` via SSH to the remote host. The following variables are supported:
......@@ -64,7 +64,7 @@ All following files are sourced inside the profile directory in this order:
To load host specific settings place `20-host` and/or `90-host-late` in `~/.envrcd/envrcd.d/`. For example, we can set `ENVRCD_INVENTORY` to `production` or `testing` in `20-host`, which will show a different colored prompt. The default is to assume we are on a `production` system if this variable is not set.
configuration for the user (on your workstation)
Configuration for the user (on your workstation)
------------------------------------------------
Send the `ENVRCD_SET_*` environment vars in either `/etc/ssh/ssh_config` or `~/.ssh/config`:
......@@ -73,7 +73,7 @@ Send the `ENVRCD_SET_*` environment vars in either `/etc/ssh/ssh_config` or `~/.
SendEnv [...] ENVRCD_SET_*
```
### minimal variant
### Minimalist variant
Export the following variables in your `~/.bashrc` for your normal account:
......@@ -81,7 +81,7 @@ Export the following variables in your `~/.bashrc` for your normal account:
export ENVRCD_SET_USER="<username>"
```
### or migrate your `~/.bashrc` to `envrcd`
### Or migrate your `~/.bashrc` to `envrcd`
Setup the files:
......@@ -109,7 +109,7 @@ git commit -m 'Add user <username>'
git push
```
installation for root (server)
Installation for root (server)
------------------------------
Setup the files:
......@@ -127,7 +127,7 @@ Accept the `ENVRCD_SET_*` environment vars in `/etc/ssh/sshd_config`:
AcceptEnv [...] ENVRCD_SET_*
```
Restart sshd:
Restart `sshd`:
```
systemctl restart sshd
......
......@@ -91,4 +91,5 @@ export GREP_COLORS='ms=01;31:mc=01;31:sl=:cx=:fn=33:ln=32:bn=32:se=36'
export BAT_THEME='DarkNeon'
# --- xdg ---
export XDG_CONFIG_HOME="${ENVRCD_PROFILE_PATH}/.config:${HOME}/.config:${XDG_CONFIG_HOME}"
# is not set at all by default, possibly breaks things?
#export XDG_CONFIG_HOME="${ENVRCD_PROFILE_PATH}/.config"
djaf klsfkl;jsf sadf;lks fs
f sdadfg sadf s
sdf sdl sdlkfjslkdj fdf
sd fsadfsd sdfsdfs
s sd fsdfsd fsdfsd fsd
dfsd fsdfsd sdfg sdfs d
sdffsdf sd fsd fsdf sdf sd
sdfsdfsd fsdf sf
djaf klsfkl;jsf sadf;lks fs
sdf sdl sdlsdf sd sf kfjslkdj fdf
sd fsadfsd sdfsdfs
s sd fsdfsd fsdfsd fsd sd fsd f
dfsd d sdfg sdfs d
sdffsdf sd fsd fsdf sdf sd
sdfsdfsdf
sdfsdfsd fsdf sf
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment