hoisting the alias definitions up into a function, so we can track them and eventuall...
[feisty_meow.git] / scripts / core / common.alias
1 #!/bin/bash
2 ##############
3 # Name   : common.alias
4 # Author : Chris Koeritz
5 # Rights : Copyright (C) 1988-$now by Author
6 ##############
7 # This script is free software; you can modify/redistribute it under the terms
8 # of the GNU General Public License. [ http://www.gnu.org/licenses/gpl.html ]
9 # Feel free to send updates to: [ fred@gruntose.com ]
10 ##############
11
12 # a list of core aliases for feisty meow codebase.
13
14 # repurposes certain commands that feisty meow does a little differently.
15 define_yeti_alias cls='clear_colormap; clear'
16 define_yeti_alias copy='\cp -i -v '
17 define_yeti_alias cp='\cp -i -v '
18 define_yeti_alias cvs='perl $FEISTY_MEOW_SCRIPTS/rev_control/cvs_fix.pl'
19 define_yeti_alias del='perl $FEISTY_MEOW_SCRIPTS/files/safedel.pl'
20 define_yeti_alias deltree='perl $FEISTY_MEOW_SCRIPTS/files/safedel.pl'
21 define_yeti_alias df='\df -mh'
22 define_yeti_alias dir='perl $FEISTY_MEOW_SCRIPTS/files/summing_dir.pl'
23 define_yeti_alias du='\du -h'
24 define_yeti_alias erase='perl $FEISTY_MEOW_SCRIPTS/files/safedel.pl'
25 # elaborate replacement for filesystem explorer command, which we have
26 # shortened to "exp".
27 if [ "$OS" != "Windows_NT" ]; then
28   if [ -n "$IS_DARWIN" ]; then
29     # case for mac os x.
30     define_yeti_alias exp='open'
31   elif [ ! -z "$(which nautilus 2>/dev/null)" ]; then
32     # we prefer nautilus if available.
33     define_yeti_alias exp='nautilus'
34   else
35     # last ditch is konqueror browser.
36     define_yeti_alias exp='konqueror'
37   fi
38 else
39   # windows gets routed to our helpful script instead.
40   define_yeti_alias exp="bash $FEISTY_MEOW_SCRIPTS/winders/exploder.sh"
41 fi
42 # re-use work we did on 'exp' macro for the longer windows command.
43 define_yeti_alias explorer=exp
44 define_yeti_alias i=inventory
45 define_yeti_alias l='perl $FEISTY_MEOW_SCRIPTS/files/summing_dir.pl'
46 define_yeti_alias ls='ls -HhFC $color_add'
47 define_yeti_alias lsd='ls -hl'
48 define_yeti_alias md='mkdir'
49 define_yeti_alias more='less'
50 define_yeti_alias move='mv -i -v '
51 define_yeti_alias mv='\mv -i -v '
52 define_yeti_alias notepad='gedit'
53 define_yeti_alias pwd="/bin/pwd|sed -e 's/^\/home\/$USER/~/'"
54 define_yeti_alias rd='perl $FEISTY_MEOW_SCRIPTS/files/zapdirs.pl'
55 define_yeti_alias ren='\mv -v -i '
56 define_yeti_alias rm='perl $FEISTY_MEOW_SCRIPTS/files/safedel.pl'
57 define_yeti_alias rmdir='perl $FEISTY_MEOW_SCRIPTS/files/zapdirs.pl'
58 define_yeti_alias s='echo "##############"'
59 define_yeti_alias path='echo $PATH'
60 define_yeti_alias whence=which
61
62 ##############
63
64 # some aliases that are just generally nice to have.
65 define_yeti_alias aliases=alias
66 define_yeti_alias calc='kcalc'
67 define_yeti_alias cd..='\cd ..'
68 define_yeti_alias cd...='\cd ../..'
69 define_yeti_alias cd....='\cd ../../..'
70 define_yeti_alias cd.....='\cd ../../../..'
71 define_yeti_alias mo='less'
72 define_yeti_alias np='gvim'
73 define_yeti_alias up='cd ..'
74
75 ##############
76
77 # extended aliases for meta-operations.
78 define_yeti_alias dvd_rip='vobcopy -m'
79 define_yeti_alias blu_rip='echo "what would this command be?"'
80 define_yeti_alias mplayer='\mplayer -ao arts'
81 define_yeti_alias play='bash $FEISTY_MEOW_SCRIPTS/multimedia/sound_play.sh'
82
83 ##############
84
85 # some really eccentric feisty meow aliases...
86
87 # says goodbye when leaving a shell.
88 define_yeti_alias bye='. $FEISTY_MEOW_SCRIPTS/users/goodbye.sh'
89 define_yeti_alias cputemp='acpi -t'
90 # makes root user's home directory's permissions right.
91 define_yeti_alias reroot='chown -R root:root /root'
92 # yes, these are really helpful...
93 define_yeti_alias whoareyou='echo -e "Hello, I am a computer named $(hostname)\nand I'\''m very pleased to meet you."'
94 define_yeti_alias whereami='echo whoa dude, try not to think about it...'
95 define_yeti_alias why='echo We all wonder what the point of the universe is at times.  If you figure it all out, please write us.'
96
97 # done with loading up regular aliases now...
98
99 ##############
100
101 # call the generated aliases file, if it exists.
102 if [ -f "$FEISTY_MEOW_GENERATED/fmc_aliases_for_scripts.sh" ]; then 
103   if [ ! -z "$SHELL_DEBUG" ]; then echo loading script aliases...; fi
104   source "$FEISTY_MEOW_GENERATED/fmc_aliases_for_scripts.sh"
105   if [ ! -z "$SHELL_DEBUG" ]; then echo done loading script aliases.; fi
106 fi
107
108 ##############
109
110 # remove the fredization macro if it was defined, helping to avoid running
111 # the shell scripts twice for users like root that don't always load this
112 # stuff.
113 unalias fredme &>/dev/null
114
115 ##############
116
117 # set the sentinel variable that says this file was handled.
118 export CORE_ALIASES_LOADED=true
119
120 ##############
121