Compare commits

...

20 Commits

Author SHA1 Message Date
df77f74df7 Add PureOS in Debian distros 2023-02-28 21:26:54 +01:00
739089633d Cut X_user to one line in bashrc 2022-11-30 19:06:38 +01:00
888ca75356 Set install script to new run_directory norm 2022-09-22 18:56:50 +02:00
4d0de08caa Add the ability to disable install 2022-03-17 15:08:12 +01:00
0edea05e46 Move extensions to new .bashrc.d structure 2022-03-14 19:07:55 +01:00
02b7168bf0 Add x bit to install.sh 2022-03-13 12:28:56 +01:00
79d67f7429 Update shebang in bashrc 2022-03-13 12:26:45 +01:00
eb229ac031 Update shebang in install script 2022-03-13 12:25:55 +01:00
f02ecf1600 Merge branch 'master' of ssh://git.kto.black:4102/adminconf/rcs-general 2022-03-12 19:50:54 +01:00
c72ca97937 install.sh: remove ponctual user definition 2022-03-12 19:49:47 +01:00
3840e5be90 Add shebang to bashrc 2022-03-12 15:42:07 +01:00
7058a00720 Revert "Update README"
This reverts commit 3a0b288a95.
2022-03-12 12:37:37 +01:00
d8c16a134a Revert "install.sh: adapt behviour when calling with argument"
This reverts commit 8a253e1090.
2022-03-12 12:37:24 +01:00
8a253e1090 install.sh: adapt behviour when calling with argument 2022-03-12 12:24:28 +01:00
3a0b288a95 Update README 2022-03-12 12:16:09 +01:00
359af900d1 install.sh: differentiate processing for root, check for sudo before calling it, and add support for ponctual user definition 2022-03-12 12:15:06 +01:00
9dd4463d45 Set real README 2022-03-12 11:45:36 +01:00
ef75d1cbbf Add install script 2022-03-12 11:38:34 +01:00
15cd72d637 bashrc: add support for Manjaro-ARM + change rule for keeping second part of hostname 2022-03-11 15:54:31 +01:00
bbb9d98547 vimrc test: add some rules to disable mouse interactions 2022-03-11 15:53:36 +01:00
5 changed files with 58 additions and 12 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.disabled

View File

@ -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
View File

@ -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
View 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

4
vimrc
View File

@ -43,6 +43,10 @@ else
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif
" TEST: disable all mouse interactions
set mouse=
set ttymouse=
" Specific configurations
augroup configgroup