Compare commits
20 Commits
d74979269e
...
master
Author | SHA1 | Date | |
---|---|---|---|
df77f74df7 | |||
739089633d | |||
888ca75356 | |||
4d0de08caa | |||
0edea05e46 | |||
02b7168bf0 | |||
79d67f7429 | |||
eb229ac031 | |||
f02ecf1600 | |||
c72ca97937 | |||
3840e5be90 | |||
7058a00720 | |||
d8c16a134a | |||
8a253e1090 | |||
3a0b288a95 | |||
359af900d1 | |||
9dd4463d45 | |||
ef75d1cbbf | |||
15cd72d637 | |||
bbb9d98547 |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.disabled
|
12
README.md
12
README.md
@ -1,2 +1,10 @@
|
||||
# rcs-general
|
||||
Profile configuration files.
|
||||
# CLI tools setup/config files
|
||||
|
||||
This repository contains setup or config files for generic CLI applications, such as our Bash shell or ViM.
|
||||
|
||||
### Files
|
||||
* `bashrc` is Bash startup setup script and should be installed at `~/.bashrc`.
|
||||
* `vimrc` is ViM config script and should be installed at `~/.vimrc`.
|
||||
* `tmux.conf` is tmux config file and should be installed at `~/.tmux.conf`.
|
||||
#### Installation
|
||||
* `install.sh` script copies above files to their respective destinations.
|
||||
|
19
bashrc
19
bashrc
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
# ~/.bashrc
|
||||
# byMasterKTO
|
||||
|
||||
@ -58,9 +58,9 @@ fi
|
||||
if [[ $system == "Linux" ]]; then
|
||||
case $(lsb_release -si) in
|
||||
# Arch family: light blue
|
||||
Arch | ManjaroLinux) COLOR=$C_BOLD$C_ARCH;;
|
||||
Arch | ManjaroLinux | Manjaro-ARM) COLOR=$C_BOLD$C_ARCH;;
|
||||
# Debian family: orange
|
||||
Debian | Ubuntu | Linuxmint | Neon | Raspbian) COLOR=$C_BOLD$C_DEB;;
|
||||
Debian | Ubuntu | Linuxmint | Neon | Raspbian | PureOS) COLOR=$C_BOLD$C_DEB;;
|
||||
# RedHat family: blue
|
||||
Fedora) COLOR=$C_BOLD$C_RH;;
|
||||
# SUSE family: green
|
||||
@ -89,9 +89,9 @@ if [[ $system == "Linux" ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# hostname
|
||||
# if hostname has 4 parts then host=.secondpart
|
||||
if [[ $(hostname | grep -o "\." | wc -l) -eq 3 ]]; then
|
||||
# hostname TODO could we not get rid of hostname command (not always installed)?
|
||||
# if hostname has 5 parts then host=.secondpart
|
||||
if [[ $(hostname | grep -o "\." | wc -l) -eq 4 ]]; then
|
||||
host='.'$(hostname | cut -f 2 -d '.')
|
||||
fi
|
||||
hn="$COLOR\h$host$virt$C_RESET"
|
||||
@ -146,7 +146,7 @@ unset TMUX
|
||||
alias touchpad='xinput set-prop 12 "Device Enabled" 1'
|
||||
|
||||
# Set VNC aliases
|
||||
X_user=$(who | grep \(: | cut -d " " -f1)
|
||||
X_user=$(who | grep -m1 \(: | cut -d " " -f1)
|
||||
X_display=$(who | grep \(: | cut -d ":" -f2 | cut -b 1)
|
||||
if id -u gdm > /dev/null 2>&1; then
|
||||
X_gdm_id=$(id -u gdm)
|
||||
@ -161,7 +161,6 @@ alias vnc-gdm="sudo x11vnc -auth /run/user/$X_gdm_id/gdm/Xauthority -localhost -
|
||||
alias vnc-lightdm='sudo x11vnc -auth /var/run/lightdm/root/:0 -localhost -once -nopw -display :0'
|
||||
|
||||
# load any additional configuration
|
||||
for f in ~/.bashrc-*; do
|
||||
[ -e "$f" ] && . ~/.bashrc-*
|
||||
break
|
||||
for f in ~/.bashrc.d/bashrc-*; do
|
||||
[ -e "$f" ] && source $f
|
||||
done
|
||||
|
34
install.sh
Executable file
34
install.sh
Executable file
@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
run_directory=$(dirname $(readlink -f "$0"))
|
||||
user=$(whoami)
|
||||
|
||||
if [ -f $run_directory/.disabled ]; then
|
||||
echo "Installation is disabled. Exiting..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ $user != 'root' ]]; then
|
||||
echo "Copying rcs to home directory..."
|
||||
cp $run_directory/bashrc /home/$user/.bashrc
|
||||
cp $run_directory/vimrc /home/$user/.vimrc
|
||||
cp $run_directory/tmux.conf /home/$user/.tmux.conf
|
||||
|
||||
if ! command -v sudo &> /dev/null; then
|
||||
echo "Could not copy to root directory: sudo was not found."
|
||||
else
|
||||
echo "Copying rcs to root directory..."
|
||||
sudo cp $run_directory/bashrc /root/.bashrc
|
||||
sudo cp $run_directory/vimrc /root/.vimrc
|
||||
sudo cp $run_directory/tmux.conf /root/.tmux.conf
|
||||
fi
|
||||
|
||||
else
|
||||
echo "Copying rcs to root directory..."
|
||||
cp $run_directory/bashrc /root/.bashrc
|
||||
cp $run_directory/vimrc /root/.vimrc
|
||||
cp $run_directory/tmux.conf /root/.tmux.conf
|
||||
fi
|
||||
|
||||
echo "Finished install. Exiting..."
|
||||
exit 0
|
Reference in New Issue
Block a user