You've already forked personal-linux-config
Compare commits
21 Commits
Author | SHA1 | Date | |
---|---|---|---|
9c4db7fef6 | |||
fe4a896ada | |||
c33ae90b33 | |||
09cf9b8bbe | |||
2913920987 | |||
ee267c0c50 | |||
6179e8d809 | |||
e8f69fbbad | |||
53752a866e | |||
a4885fa060 | |||
627282b2cc | |||
a8eaab7e81 | |||
6b2dded19a | |||
c8758fe259 | |||
597354356b | |||
f5fb8e5dc3 | |||
82f2d7a989 | |||
7d8f7312f1 | |||
9851de3007 | |||
8866dc5bec | |||
eed4d5b142 |
12
README.md
12
README.md
@@ -1,4 +1,10 @@
|
||||
# personal-kde-config
|
||||
Personal KDE and other Linux-related configs to help me succeed in life (or at least simplify it).
|
||||
# Personal Linux config
|
||||
Personal Linux-related configs to help me succeed in life (or at least simplify it).
|
||||
|
||||
Feel free to try this out, or even add "cool stuff" to help each other out!
|
||||
Feel free to try or poke around in the source (it's all human-readable bash), or heck even add "cool stuff" to help each other out!
|
||||
|
||||
## Usage
|
||||
Explaining section for not-so-intuitive configurations
|
||||
|
||||
- alias `sambaserver`: please `cd` into the directoy is needed to be shared and execute `sambaserver` followed by `"shareuser;<SUBSTITUTE-YOUR-PASSWORD-HERE>"`, then just login with username `shareuser` and the provided password with the host computer as URL/IP, autodiscovery of both the host and the share was tested working on Windows and a Samsung Tablet.
|
||||
- alias `termbin`: use when piping a cat/echo/file/etc to upload to termbin.com (¡requires Netcat!)
|
||||
|
@@ -1,4 +1,12 @@
|
||||
for source in colored_commands convenience_aliases git_functions histcontrol ls_aliases safety_aliases terminal_colors terminal_fancyfying; do
|
||||
for source in colored_commands \
|
||||
convenience_aliases \
|
||||
git_functions \
|
||||
histcontrol \
|
||||
home_bin_folder \
|
||||
ls_aliases \
|
||||
safety_aliases \
|
||||
terminal_colors \
|
||||
terminal_fancyfying; do
|
||||
if [ -f ~/.bashrc_overrides/$source ]; then
|
||||
. ~/.bashrc_overrides/$source
|
||||
fi
|
||||
|
@@ -1,3 +1,8 @@
|
||||
alias pubkey='cat ~/.ssh/id_rsa.pub'
|
||||
alias hosts='sudo nano /etc/hosts'
|
||||
alias historygrep='history | grep'
|
||||
alias sshconfig='nano ~/.ssh/config'
|
||||
alias newrepo='bash <(curl -s https://get.bjphoster.com/new-git-repo.sh)'
|
||||
|
||||
alias sambaserver='docker run -it --rm --network host -p 137:137 -p 138:138 -p 139:139 -p 445:445 -v `pwd`:/share dperson/samba -n -p -s "sambashare;/share;yes;no;no;shareuser" -w "WORKGROUP"'
|
||||
alias termbin='nc termbin.com 9999'
|
||||
|
4
bashrc_overrides/home_bin_folder
Normal file
4
bashrc_overrides/home_bin_folder
Normal file
@@ -0,0 +1,4 @@
|
||||
# set PATH so it includes user's private bin if it exists
|
||||
if [ -d "$HOME/bin" ] ; then
|
||||
PATH="$HOME/bin:$PATH"
|
||||
fi
|
13
bashrc_overrides/terminal_fancyfying_server
Normal file
13
bashrc_overrides/terminal_fancyfying_server
Normal file
@@ -0,0 +1,13 @@
|
||||
GIT_FUNCTIONS=true
|
||||
|
||||
# Spaced
|
||||
#PS1="${LIGHTBLUE}[ ${LIGHTRED}\u ${LIGHTBLUE}@ ${LIGHTBROWN}$(hostname --fqdn) ${LIGHTBLUE}] ${LIGHTPURPLE}( ${GREEN}\w ${LIGHTPURPLE}) "
|
||||
# Not spaced
|
||||
PS1="${LIGHTBLUE}[${LIGHTRED}\u${LIGHTBLUE}@${LIGHTBROWN}$(hostname --fqdn)${LIGHTBLUE}]${LIGHTPURPLE}(${GREEN}\w${LIGHTPURPLE})"
|
||||
|
||||
if [ $GIT_FUNCTIONS ]; then
|
||||
#PS1="$PS1${LIGHTPURPLE}[${LIGHTCYAN}$(__git_prompt)${LIGHTPURPLE}]"
|
||||
PS1="$PS1${LIGHTBROWN}(${LIGHTCYAN}\$(__git_prompt)${LIGHTBROWN}) "
|
||||
fi
|
||||
|
||||
PS1="$PS1${RED}#${FORMAT_RESET}"
|
60
deploy.sh
60
deploy.sh
@@ -1,12 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
THIS="$(dirname "$(readlink -fm "$0")")"
|
||||
CLEANUP=true
|
||||
SERVER=false
|
||||
DELETE=false
|
||||
MOVE=false
|
||||
|
||||
_arguments() {
|
||||
for PARM in "$@"; do
|
||||
if [ "${PARM}" = "--no-cleanup" ]; then
|
||||
CLEANUP=false
|
||||
if [ "${PARM}" = "--server" ]; then
|
||||
SERVER=true
|
||||
elif [ "${PARM}" = "--delete" ]; then
|
||||
DELETE=true
|
||||
elif [ "${PARM}" = "--move" ]; then
|
||||
MOVE=true
|
||||
elif [ "${PARM}" = "-h" ] || [ "${PARM}" = "--help" ]; then
|
||||
_help
|
||||
exit 0
|
||||
@@ -15,43 +21,57 @@ _arguments() {
|
||||
}
|
||||
|
||||
_help() {
|
||||
echo "Usage: $(readlink -fm "$0") [-h | --help] [--no-cleanup]"
|
||||
echo "Usage: $(readlink -fm "$0") [-h | --help] [--cleanup]"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " -h | --help : Prints this help message and quits"
|
||||
echo " --no-cleanup: Does not clean the source folder after adding the bash overrides"
|
||||
echo " -h | --help"
|
||||
echo " Prints this help message and quits"
|
||||
echo " --force"
|
||||
echo " Force the reinstallation of the files"
|
||||
echo " --delete"
|
||||
echo " Delete the reference in ~/.bashrc"
|
||||
echo " --move"
|
||||
echo " Create a new reference if the location of this folder has been changed"
|
||||
echo " --server"
|
||||
echo " Customizes the terminal feel for a server installation"
|
||||
echo
|
||||
}
|
||||
|
||||
_bash_overrides() {
|
||||
cp -r bashrc_overrides ~/.bashrc_overrides
|
||||
echo "#REF:bashrc_overrides:REF" >> ~/.bashrc
|
||||
echo "if [ -f ~/.bashrc_overrides/_all ]; then" >> ~/.bashrc
|
||||
echo " . ~/.bashrc_overrides/_all" >> ~/.bashrc
|
||||
echo "fi" >> ~/.bashrc
|
||||
_delete() {
|
||||
sed -i '/REF:bashrc_overrides:REF/{N;d}' ~/.bashrc
|
||||
}
|
||||
|
||||
_cleanup() {
|
||||
rm -rf ${THIS}
|
||||
>>>>>>> master
|
||||
_bashrc_ref() {
|
||||
echo "#REF:bashrc_overrides:REF" >> ~/.bashrc
|
||||
echo ". ${THIS}/bashrc_overrides/_all" >> ~/.bashrc
|
||||
}
|
||||
|
||||
_move() {
|
||||
_delete
|
||||
_bashrc_ref
|
||||
}
|
||||
|
||||
_main() {
|
||||
_arguments "$@"
|
||||
|
||||
if [ ! -z "$(grep "#REF:bashrc_overrides:REF" ~/.bashrc)" ]; then
|
||||
if [ "${DELETE}" = true ]; then
|
||||
_delete
|
||||
elif [ "${MOVE}" = true ]; then
|
||||
_move
|
||||
elif [ ! -z "$(grep "#REF:bashrc_overrides:REF" ~/.bashrc)" ]; then
|
||||
echo "bash overrides already in place"
|
||||
echo "skipping..."
|
||||
echo
|
||||
else
|
||||
_bash_overrides
|
||||
_bashrc_ref
|
||||
echo "bash overrides added"
|
||||
echo
|
||||
fi
|
||||
|
||||
if [ "${CLEANUP}" = true ]; then
|
||||
echo "cleaning up..."
|
||||
_cleanup
|
||||
if [ "${SERVER}" = true ]; then
|
||||
sed -i 's/terminal_fancyfying/terminal_fancyfying_server/' ~/.bashrc_overrides/_all
|
||||
else
|
||||
sed -i 's/terminal_fancyfying_server/terminal_fancyfying/' ~/.bashrc_overrides/_all
|
||||
fi
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user