mirror of
https://github.com/fergalmoran/settings-webstorm.git
synced 2025-12-22 09:47:41 +00:00
Added clipboard commands
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
#Django stuff
|
#Django stuff
|
||||||
alias djrun="python manage.py runserver 0.0.0.0:8001"
|
alias djrun="source /home/fergalm/Dropbox/development/deepsouthsounds.com/dss.docker/api_env && python manage.py runserver 0.0.0.0:8001"
|
||||||
alias djshell="python manage.py shell_plus --use-pythonrc --ipython"
|
alias djshell="python manage.py shell_plus --use-pythonrc --ipython"
|
||||||
alias dbshell="python manage.py dbshell"
|
alias dbshell="python manage.py dbshell"
|
||||||
alias djmigrate="python manage.py schemamigration spa --auto"
|
alias djmigrate="python manage.py schemamigration spa --auto"
|
||||||
@@ -20,7 +20,6 @@ alias iotop='sudo iotop'
|
|||||||
alias rmq=' sudo rabbitmqctl'
|
alias rmq=' sudo rabbitmqctl'
|
||||||
alias congo='node /srv/dev/working/congo/server.js'
|
alias congo='node /srv/dev/working/congo/server.js'
|
||||||
|
|
||||||
alias dc='docker-compose'
|
|
||||||
alias andconnect='adb connect 10.1.1.102:5555'
|
alias andconnect='adb connect 10.1.1.102:5555'
|
||||||
|
|
||||||
doAgFind(){
|
doAgFind(){
|
||||||
@@ -39,3 +38,5 @@ doPsKill(){
|
|||||||
alias pskill=doPsKill
|
alias pskill=doPsKill
|
||||||
|
|
||||||
alias docker-nuke="docker rm -f $(docker ps -a -q) && docker rmi $(docker images -q)"
|
alias docker-nuke="docker rm -f $(docker ps -a -q) && docker rmi $(docker images -q)"
|
||||||
|
alias dc='docker-compose'
|
||||||
|
alias docker-rm-untagged='docker rmi -f $(docker images | grep "^<none>" | awk "{print $3}")'}
|
||||||
|
|||||||
@@ -1,3 +1,34 @@
|
|||||||
function pips() {
|
function pips() {
|
||||||
echo $'\n'$1 >> requirements.txt; pip install $1
|
echo $'\n'$1 >> requirements.txt; pip install $1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cb() {
|
||||||
|
local _scs_col="\e[0;32m"; local _wrn_col='\e[1;31m'; local _trn_col='\e[0;33m'
|
||||||
|
# Check that xclip is installed.
|
||||||
|
if ! type xclip > /dev/null 2>&1; then
|
||||||
|
echo -e "$_wrn_col""You must have the 'xclip' program installed.\e[0m"
|
||||||
|
# Check user is not root (root doesn't have access to user xorg server)
|
||||||
|
elif [[ "$USER" == "root" ]]; then
|
||||||
|
echo -e "$_wrn_col""Must be regular user (not root) to copy a file to the clipboard.\e[0m"
|
||||||
|
else
|
||||||
|
# If no tty, data should be available on stdin
|
||||||
|
if ! [[ "$( tty )" == /dev/* ]]; then
|
||||||
|
input="$(< /dev/stdin)"
|
||||||
|
# Else, fetch input from params
|
||||||
|
else
|
||||||
|
input="$*"
|
||||||
|
fi
|
||||||
|
if [ -z "$input" ]; then # If no input, print usage message.
|
||||||
|
echo "Copies a string to the clipboard."
|
||||||
|
echo "Usage: cb <string>"
|
||||||
|
echo " echo <string> | cb"
|
||||||
|
else
|
||||||
|
# Copy input to clipboard
|
||||||
|
echo -n "$input" | xclip -selection c
|
||||||
|
# Truncate text for status
|
||||||
|
if [ ${#input} -gt 80 ]; then input="$(echo $input | cut -c1-80)$_trn_col...\e[0m"; fi
|
||||||
|
# Print status.
|
||||||
|
echo -e "$_scs_col""Copied to clipboard:\e[0m $input"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user