df upgrades
[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 # this file provides a list of core aliases for feisty meow codebase.
13
14 ##############
15
16 # make our functions available to the aliases.
17 source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
18
19 ##############
20
21 # call the generated aliases file, if it exists.
22 # we do this first so that our core aliases get a chance to override the aliases
23 # based on scripts.
24
25 if [ -f "$FEISTY_MEOW_LOADING_DOCK/fmc_aliases_for_scripts.sh" ]; then 
26   if [ ! -z "$DEBUG_FEISTY_MEOW" ]; then echo loading script aliases...; fi
27   source "$FEISTY_MEOW_LOADING_DOCK/fmc_aliases_for_scripts.sh"
28   if [ ! -z "$DEBUG_FEISTY_MEOW" ]; then echo done loading script aliases.; fi
29 fi
30
31 ##############
32
33 # repurposes certain commands that feisty meow does a little differently.
34 define_yeti_alias cls='clear_colormap; clear'
35 define_yeti_alias copy='\cp -i -v'
36 define_yeti_alias cp='\cp -i -v'
37 define_yeti_alias del='perl $FEISTY_MEOW_SCRIPTS/files/safedel.pl'
38 define_yeti_alias deltree='perl $FEISTY_MEOW_SCRIPTS/files/safedel.pl'
39 define_yeti_alias df='\df -h'
40 define_yeti_alias dir='perl $FEISTY_MEOW_SCRIPTS/files/summing_dir.pl'
41 define_yeti_alias du='\du -h'
42 define_yeti_alias erase='perl $FEISTY_MEOW_SCRIPTS/files/safedel.pl'
43 # elaborate replacement for filesystem explorer command, which we have
44 # shortened to "exp".
45 if [ "$OS" != "Windows_NT" ]; then
46   if [ -n "$IS_DARWIN" ]; then
47     # case for mac os x.
48     define_yeti_alias exp='open'
49   elif [ ! -z "$(whichable dolphin)" ]; then
50     # we prefer dolphin if available.
51     define_yeti_alias exp='screen -L -S dolphin-$RANDOM -d -m dolphin '
52 #--select 
53   elif [ ! -z "$(whichable nautilus)" ]; then
54     # launch nautilus if available.
55     define_yeti_alias exp='nautilus'
56   else
57     # last ditch is konqueror browser.
58     define_yeti_alias exp='konqueror'
59   fi
60 else
61   # windows gets routed to our helpful script instead.
62   define_yeti_alias exp="bash $FEISTY_MEOW_SCRIPTS/files/exploder.sh"
63 fi
64 # re-use work we did on 'exp' macro for the longer windows command.
65 define_yeti_alias explorer=exp
66 define_yeti_alias fix_ssh_perms='chmod 700 $HOME/.ssh ; chmod 600 $HOME/.ssh/*'
67 define_yeti_alias get_feisty='rpuffer $FEISTY_MEOW_APEX; regenerate'
68 define_yeti_alias halt='sudo shutdown -h now'
69 define_yeti_alias i=inventory
70 define_yeti_alias l='perl $FEISTY_MEOW_SCRIPTS/files/summing_dir.pl'
71 define_yeti_alias ll='ls_dot_add=-a perl $FEISTY_MEOW_SCRIPTS/files/summing_dir.pl'
72 define_yeti_alias ls='ls -HhFC $color_add'
73 define_yeti_alias lsd='ls -hl'
74 define_yeti_alias md='mkdir'
75 define_yeti_alias move='mv -i -v'
76 define_yeti_alias mv='\mv -i -v'
77 define_yeti_alias netcp='rsync -avz'
78 define_yeti_alias notepad='gedit'
79 define_yeti_alias pwd="/bin/pwd|sed -e 's/^\/home\/$USER/~/'"
80 define_yeti_alias rd='perl $FEISTY_MEOW_SCRIPTS/files/zapdirs.pl'
81 define_yeti_alias ren='\mv -v -i'
82 define_yeti_alias rm='perl $FEISTY_MEOW_SCRIPTS/files/safedel.pl'
83 define_yeti_alias rmdir='perl $FEISTY_MEOW_SCRIPTS/files/zapdirs.pl'
84 define_yeti_alias s='echo "##############"'
85 define_yeti_alias path='echo $PATH'
86 define_yeti_alias whence=which
87
88 define_yeti_alias less='lesser'
89 define_yeti_alias mo='lesser'
90 define_yeti_alias more='lesser'
91 define_yeti_alias lesser='bash $FEISTY_MEOW_SCRIPTS/files/lesser.sh'
92
93 ##############
94
95 # some aliases that are just generally nice to have.
96 define_yeti_alias aliases=alias
97 define_yeti_alias calc='galculator'
98 define_yeti_alias cd..='\cd ..'
99 define_yeti_alias cd...='\cd ../..'
100 define_yeti_alias cd....='\cd ../../..'
101 define_yeti_alias cd.....='\cd ../../../..'
102 define_yeti_alias np='gvim'
103 define_yeti_alias up='cd ..'
104
105 ##############
106
107 # some information about the feisty meow codebase itself.
108
109 define_yeti_alias feisty_branch='pushd $FEISTY_MEOW_APEX ; git branch ; popd'
110
111 ##############
112
113 # some important retreads on aliases that provide a sudo-ized version of other scripts.
114
115 define_yeti_alias snarf_linux_config="sudo -E PERLLIB=\$PERLLIB perl \$FEISTY_MEOW_SCRIPTS/archival/snarf_linux_config.pl"
116 define_yeti_alias add_domain="sudo bash \$FEISTY_MEOW_SCRIPTS/system/add_domain.sh"
117 define_yeti_alias remove_domain="sudo bash \$FEISTY_MEOW_SCRIPTS/system/remove_domain.sh"
118 define_yeti_alias add_apache_site="sudo bash \$FEISTY_MEOW_SCRIPTS/system/add_apache_site.sh"
119 define_yeti_alias remove_apache_site="sudo bash \$FEISTY_MEOW_SCRIPTS/system/remove_apache_site.sh"
120 define_yeti_alias add_swap_mount="sudo bash \$FEISTY_MEOW_SCRIPTS/system/add_swap_mount.sh"
121
122 ##############
123
124 # extended aliases for meta-operations.
125 define_yeti_alias dvd_rip='vobcopy -m'
126 define_yeti_alias blu_rip='echo "what would this command be?"'
127 define_yeti_alias mplayer='\mplayer -ao arts'
128 define_yeti_alias play='bash $FEISTY_MEOW_SCRIPTS/multimedia/sound_play.sh'
129
130 ##############
131
132 # some really eccentric feisty meow aliases...
133
134 # launches a bash session in the background using the screen command.
135 define_yeti_alias bashido='screen -L -S bashido -d -m bash'
136
137 # says goodbye when leaving a shell.
138 define_yeti_alias bye='. $FEISTY_MEOW_SCRIPTS/processes/goodbye.sh'
139
140 define_yeti_alias cputemp='acpi -t'
141
142 # makes root user's home directory's permissions right.
143 define_yeti_alias reroot='chown -R root:root /root'
144
145 # yes, these what/who/why functions are really helpful...
146 define_yeti_alias whoareyou='echo -e "Hello, I am a computer named $(hostname)\nand I am very pleased to meet you."'
147 define_yeti_alias whereami='echo whoa dude, try not to think about it...'
148 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.'
149
150 # done with loading up regular aliases now...
151
152 ##############
153
154 # remove the "fredization" or "feistymeowization" macros if they're defined,
155 # which reduces the chance of loading the shell environment twice for users
156 # like root that don't load feisty meow automatically.
157 unalias fredme feistyme &>/dev/null
158
159 ##############
160