Alias and script

Just the gif on the github page got me laughing out loud

Haha yeah I could! I’ve seen it before but never bothered.

My alias is more polite though :smile:

Hi, I had thought of opening such a topic as well =)
I personally use fish and there is no fishrc, instead there is a config file hidden somewhere in the dot-directories, so I made a fishrc via a symbolic link which sources 2 files : 1 for aliases and 1 for functions, here they are :

.alias

##### alias commands for fish ##########

##### unixversal commands ###################

alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias c='clear'
alias cc='cd && clear'
alias cl='clear ; l'
alias ko='killall'
alias md='mkdir'
alias tatiana-silva='curl wttr.in'
alias e='exit'
alias r='rm -rf'
alias s='sudo'
alias hip='hostname -i'
alias sa='source ~/.fishrc'

##### installed programs ##############

alias p='bpython'
alias eog='eog >/dev/null 2>&1'
alias nf='echo \n ; neofetch'
alias tget='torsocks wget'    # wget via tor
alias tb='tensorboard --logdir logs'
#alias darknet='~/Documents/darknet/darknet'
alias yt='youtube-dl'
alias nn='netron'
alias dk="docker"
alias dkc="docker-compose"

######## personal programs ##########

alias sc='cat ~/.tg/raccourcis_clavier'  ### prints keyboard shortcuts
alias sz='~/.tg/szz'  ### prints files sizes
alias imsz='p ~/.tg/im.py' ### prints an image's size
alias rmdl='rm ~/.cache/torch/checkpoints/*' ### deletes downloaded pytorch models
alias onnx='p ~/.tg/ox.py'  #### deep learning model conversion to/from onnx

####### terminal color (for KONSOLE only) #########

alias aoi='qdbus $KONSOLE_DBUS_SERVICE $KONSOLE_DBUS_WINDOW newSession aoi $PWD >/dev/null'  		# bleu
alias kawaii='qdbus $KONSOLE_DBUS_SERVICE $KONSOLE_DBUS_WINDOW newSession kawaii $PWD >/dev/null' 	# rose
alias midori='qdbus $KONSOLE_DBUS_SERVICE $KONSOLE_DBUS_WINDOW newSession midori $PWD >/dev/null' 	# vert
alias akai='qdbus $KONSOLE_DBUS_SERVICE $KONSOLE_DBUS_WINDOW newSession akai $PWD >/dev/null' 		#rouge
alias orenji='qdbus $KONSOLE_DBUS_SERVICE $KONSOLE_DBUS_WINDOW newSession orenji $PWD >/dev/null'	#orange
alias kiiroi='qdbus $KONSOLE_DBUS_SERVICE $KONSOLE_DBUS_WINDOW newSession kiiroi $PWD >/dev/null'	#jaune
alias kuro='qdbus $KONSOLE_DBUS_SERVICE $KONSOLE_DBUS_WINDOW newSession kuro $PWD >/dev/null'		#noir

######## pacman ##########


alias pacmaj='sudo pacman -Syyu ; sudo paccache -rvk2'
alias paco='pacman -Qdtq | sudo pacman -Rs -'

.functions :

######### fish functions ##########

function g
	printf \n
	grep $argv
	printf \n
end


function ddrive
wget "https://drive.google.com/uc?export=download&id=$argv[1]" --output-document="$argv[2]"
end

function a
	atom $argv &
end


function v
	vlc $argv > /dev/null 2>&1 &
end

function m
	argparse "p/play" -- $argv
	
	if set -q _flag_play
		mpv --playlist=$argv > /dev/null 2>&1 &
	else
		mpv $argv > /dev/null 2>&1 &
	end
end


function liz
	elisa $argv >/dev/null 2>&1 &
	end

function psp
	PPSSPPQt $argv >/dev/null 2>&1 &
end

function ds
	desmume $argv >/dev/null 2>&1 &
end

function pdf
	okular $argv >/dev/null 2>&1 &
end

function jap
	printf \n
	grep $argv ~/Documents/japonais/adjectifs ; grep $argv ~/Documents/japonais/verbes ; grep $argv ~/Documents/japonais/voc
	printf \n
end

function sd
	sed "s/$argv[1]/$argv[2]/g" $argv[3]
end


function sdk
    if ps -e | grep -q dockerd
		echo shutting docker...
		sudo systemctl stop docker
		echo docker OFF !!!\n
	else
		echo starting docker...
		sudo systemctl start docker
		echo docker ON !!!\n
	end
end

function cmdk  #### prints docker commands
	set l (count $argv)
	if test $l -eq 0
		echo \n
		cat ~/.tg/dkcmd
	else
		g $argv ~/.tg/dkcmd
	end
end
1 Like

Can I translate your comments to english ? just so people can just copy and paste ?

I don’t use aliases. I prefer to remember the commands and parameters.
If the execution is complex I prefer to build a script in bash.

But in my git repository I have found a funny alias. Surely it is copied from another user

#Like matrix console display
alias matrix='echo -e "\e[32m"; while :; do for i in {1..16}; do r="$(($RANDOM % 2))"; if [[ $(($RANDOM % 5)) == 1 ]]; then if [[ $(($RANDOM % 4)) == 1 ]]; then v+="\e[1m $r   "; else v+="\e[2m $r   "; fi; else v+="     "; fi; done; echo -e "$v"; v=""; done'
2 Likes

I directly edited them :slight_smile:

Thanks you anyway for translating them

@Yochanan is it possible to test kmdr without creating an account? Or is this mandatory?

You can use the program without creating an account, but the browser extension requires it.

He asked me via terminal. I think it would be better to do it at this point.

Do what? :thinking:

Do an account for make the test with the terminal.

:slightly_smiling_face: Love the ‘tatiana-silva’ alias, i use the same command (‘curl wttr.in’) but my alias is ‘météo’ …