9d4049e5d253fade8e7cd2a325a24c5b94004d18
[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 del='perl $FEISTY_MEOW_SCRIPTS/files/safedel.pl'
19 define_yeti_alias deltree='perl $FEISTY_MEOW_SCRIPTS/files/safedel.pl'
20 define_yeti_alias df='\df -mh'
21 define_yeti_alias dir='perl $FEISTY_MEOW_SCRIPTS/files/summing_dir.pl'
22 define_yeti_alias du='\du -h'
23 define_yeti_alias erase='perl $FEISTY_MEOW_SCRIPTS/files/safedel.pl'
24 # elaborate replacement for filesystem explorer command, which we have
25 # shortened to "exp".
26 if [ "$OS" != "Windows_NT" ]; then
27   if [ -n "$IS_DARWIN" ]; then
28     # case for mac os x.
29     define_yeti_alias exp='open'
30   elif [ ! -z "$(which nautilus 2>/dev/null)" ]; then
31     # we prefer nautilus if available.
32     define_yeti_alias exp='nautilus'
33   else
34     # last ditch is konqueror browser.
35     define_yeti_alias exp='konqueror'
36   fi
37 else
38   # windows gets routed to our helpful script instead.
39   define_yeti_alias exp="bash $FEISTY_MEOW_SCRIPTS/files/exploder.sh"
40 fi
41 # re-use work we did on 'exp' macro for the longer windows command.
42 define_yeti_alias explorer=exp
43 define_yeti_alias fix_ssh_perms='chmod 700 $HOME/.ssh ; chmod 600 $HOME/.ssh/*'
44 define_yeti_alias halt='sudo shutdown -h now'
45 define_yeti_alias i=inventory
46 define_yeti_alias l='perl $FEISTY_MEOW_SCRIPTS/files/summing_dir.pl'
47 define_yeti_alias ls='ls -HhFC $color_add'
48 define_yeti_alias lsd='ls -hl'
49 define_yeti_alias md='mkdir'
50 define_yeti_alias move='mv -i -v'
51 define_yeti_alias mv='\mv -i -v'
52 define_yeti_alias netcp='rsync -avz'
53 define_yeti_alias notepad='gedit'
54 define_yeti_alias pwd="/bin/pwd|sed -e 's/^\/home\/$USER/~/'"
55 define_yeti_alias rd='perl $FEISTY_MEOW_SCRIPTS/files/zapdirs.pl'
56 define_yeti_alias ren='\mv -v -i'
57 define_yeti_alias rm='perl $FEISTY_MEOW_SCRIPTS/files/safedel.pl'
58 define_yeti_alias rmdir='perl $FEISTY_MEOW_SCRIPTS/files/zapdirs.pl'
59 define_yeti_alias s='echo "##############"'
60 define_yeti_alias path='echo $PATH'
61 define_yeti_alias whence=which
62
63 define_yeti_alias less='lesser'
64 define_yeti_alias mo='lesser'
65 define_yeti_alias more='lesser'
66 define_yeti_alias lesser='bash $FEISTY_MEOW_SCRIPTS/files/lesser.sh'
67
68 ##############
69
70 # some aliases that are just generally nice to have.
71 define_yeti_alias aliases=alias
72 define_yeti_alias calc='kcalc'
73 define_yeti_alias cd..='\cd ..'
74 define_yeti_alias cd...='\cd ../..'
75 define_yeti_alias cd....='\cd ../../..'
76 define_yeti_alias cd.....='\cd ../../../..'
77 define_yeti_alias np='gvim'
78 define_yeti_alias up='cd ..'
79
80 ##############
81
82 # some information about the feisty meow codebase itself.
83
84 define_yeti_alias feisty_branch='pushd $FEISTY_MEOW_APEX ; git branch ; popd'
85
86 ##############
87
88 # some important retreads on aliases that provide a sudo-ized version of other scripts.
89
90 define_yeti_alias standup="bash \"$FEISTY_MEOW_SCRIPTS/site_avenger/standup.sh\""
91
92 #hmmm: some magma intrusions from the fred customizations...
93 define_yeti_alias revamp_web_permissions="bash \"$FEISTY_MEOW_SCRIPTS/customize/fred/scripts/cakelampvm/revamp_web_permissions.sh"
94
95 ##############
96
97 # extended aliases for meta-operations.
98 define_yeti_alias dvd_rip='vobcopy -m'
99 define_yeti_alias blu_rip='echo "what would this command be?"'
100 define_yeti_alias mplayer='\mplayer -ao arts'
101 define_yeti_alias play='bash $FEISTY_MEOW_SCRIPTS/multimedia/sound_play.sh'
102
103 ##############
104
105 # some really eccentric feisty meow aliases...
106
107 # says goodbye when leaving a shell.
108 define_yeti_alias bye='. $FEISTY_MEOW_SCRIPTS/processes/goodbye.sh'
109 define_yeti_alias cputemp='acpi -t'
110 # makes root user's home directory's permissions right.
111 define_yeti_alias reroot='chown -R root:root /root'
112 # yes, these are really helpful...
113 define_yeti_alias whoareyou='echo -e "Hello, I am a computer named $(hostname)\nand I'\''m very pleased to meet you."'
114 define_yeti_alias whereami='echo whoa dude, try not to think about it...'
115 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.'
116
117 # done with loading up regular aliases now...
118
119 ##############
120
121 # call the generated aliases file, if it exists.
122 if [ -f "$FEISTY_MEOW_LOADING_DOCK/fmc_aliases_for_scripts.sh" ]; then 
123   if [ ! -z "$DEBUG_FEISTY_MEOW" ]; then echo loading script aliases...; fi
124   source "$FEISTY_MEOW_LOADING_DOCK/fmc_aliases_for_scripts.sh"
125   if [ ! -z "$DEBUG_FEISTY_MEOW" ]; then echo done loading script aliases.; fi
126 fi
127
128 ##############
129
130 # remove the fredization macro if it was defined, helping to avoid running
131 # the shell scripts twice for users like root that don't always load this
132 # stuff.
133 unalias fredme &>/dev/null
134
135 ##############
136
137 # set the sentinel alias that says this file was handled.
138 alias CORE_ALIASES_LOADED=true
139
140 ##############
141