geek rescue kit Code
Brought to you by:
ctaf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | =========================================================== =========================================================== ########################GUIDELINE########################## =========================================================== =========================================================== =========================================================== FILES AND FOLDERS: =========================================================== - all files in .ctafconf/etc must be static (user should not edit them, program should not add file into) - all binary files should be in .ctafconf/bin - all files in .ctafconf/perso must not be overwritten and are user specific .ctafconf root directory .ctafconf/etc contain all configuration files .ctafconf/bin ct-profile, ct-installconf, ctssh, ctrepo, ... .ctafconf/perso user specific configuration files .ctafconf/perso/bin user binary .ctafconf/perso/semantic semantic cache file (for emacs, when cedet is installed) .ctafconf/perso/previous all file replaced by the ctafconf .ctafconf/perso/wallpaper user wallpaper (ct-add-wallpaper to add one) =========================================================== SHELL POSIX: =========================================================== ###################### Global advise: - always quote string and variable to avoid problem with string containing space - use shell lib - $(( 1 + 2 )) dont work on sun (jsh), use expr - $(( 077 )) = 63 ###################### --shell lib ssft.sh : interface for zenity, kdialog, dialog or read shelltools.sh : portable function between bash,ksh,tcsh, and zsh set_env, set_var, null_which (which without output), ... xsession.sh : delay application launching grktools.sh : file operation tools, copyfile, linkfile, restorefile make file operation with backup, usefull for installation ###################### --sh---- (ksh, zsh, bash) #syntax if cmp -s $SRCFILE $FILE; then fi export al=val alias al=val var=val source #catch a signal _trap_kill () { exit 0 } trap _trap_kill INT #KILL EXIT QUIT INT TERM #exit from sourced or standalone script #sourced or standalone return 2>/dev/null exit ###################### --tcsh-- #syntax if ( -x file ) echo cool setenv al val alias al val set var val =========================================================== MINE: =========================================================== all .mine should be in etc/mine they should contains configuration user can tweak =========================================================== PACKAGE: =========================================================== all .grk should be in etc/ they contains installation instruction for a package current variable/functions to define are (replace pkgname with the name of the file): pkgname_name='name of the package' (usefull??) #description of the package pkgname_description #is this package installed? #0 = installed #1 = not installed pkgname_is_installed #install this package is pkgname_is_installed return "not installed" #0 = installed #1 = not installed pkgname_install #uninstall file installed with pkgname_install pkgname_uninstall #this function is always called when you call ct-installconf #dont affected by pkgname_uninstall #put all .mine there, and stuff for upgrade pkgname_alwaysinstall =========================================================== CUSTOM VAR: =========================================================== ctafconf (user-profile): - wm - wallpaper - config - interface - sudo (ct-sudo) defaultapp (for menus): - webnavigator - mailclient shell (shell-profile): - zshprompt - email - name - proxy - pager - editor - screen at startup - host to ban (restricted host) fluxbox: - style (init file) e16: - style emacs (emacs-profile): - size - ilisp - cedet - ecb - doxy - ... ct-ssh/ct-repo: ssh_gate --- - ct-profile edit *.ctprofile , each .ctprofile describe : - variable - the output file - the output method (sh, emacs, csh, ..) - ct-profile arg: - askall - test if var are def var_type (yesno, singlechoice, multichoice, text) var_separator #defined by the type var_value (value separate by separator) var_description var_file (needed?) var_type (emacs,csh,sh) =========================================================== KEYBOARD: =========================================================== ctrl+alt+m : toggle maximize ctrl+alt+t : toggle decoration ctrl+alt+c : close ctrl+alt+k : kill ctrl+alt+f : toggle fullscreen alt+f1 : switch to desktop 1 alt+f2 : switch to desktop 2 alt+f3 : switch to desktop 3 alt+f4 : switch to desktop 4 alt+click gauche : move alt+click droit : resize =========================================================== EMACS: =========================================================== emacs : global configuration file bindings.emacs : global keybindings misc.emacs : not very usefull think settings.emacs : emacs settings color.emacs : emacs color theme functions.emacs : emacs functions mode.emacs : autoload mode menu.emacs : emacs menu prog.emacs : specific think for programmation startup.emacs : startup message and help |