1#! /usr/bin/env tclsh 2 3# This is a support program for filerunner. It produces a list of 4# scripts that, when executed by SaveConfig, builds the config file 5 6# We are using a complex way to generate the configure file so that we can set the 7# order of generation independently of the order below. The "data" command just collects 8# the input in a somewhat organized way. We then break the command (info body data) 9# into a list of statements (buildCmds above). we then pick and choose the statements 10# in the order dictated by glob(edit_configuration_configlist). If we don't have an 11# entry there, the command in "data" will not be executed. The rules for selection: 12# 1. a nil selection gets entries from the head of the list 13# 2. entries are selected until a "Header" is found or a config body with a comment. 14# A header is " putsTrim $fid {#**************** HOTLISTS `{fill *}`} (we trigger on 15# at least 10 stars. 16 17# config bodies are commands with "AddConf $fid config(??) ?? {comment}" 18 19# Information on putsTrim and AddConf (including embedded scriplets) 20# may be found with their sources. 21 22# The config file generation, and thus the produced list, is controlled 23# by a list "glob(edit_configuration_configlist)" which is a loosly 24# encoded copy of the left hand panel of the "edit configuration" window. 25# glob(edit_configuration_configlist) is defined here as are the various 26# scripts that are used by SaveConfig. In short the content of the 27# "edit configuration" window is defined here. 28# 29# The glob(edit_configuration_configlist) rules: 30# 1) glob(edit_configuration_configlist) contains two types of entries: 31# a) header entries which contain a title and a search string 32# ( the search string is what the "edit configuration" browser uses 33# when the user selects a header in the left hand window.) 34# 2) subscripts for the configuration element to be displayed with 35# its comments. These entries will be of length 1. 36# 3) entries may contain expressions that result in one of the above. 37# At this time the only variable this expression may use is ::MSW 38# which is true if we are building for Microsoft Windows. 39# 40# Import options from the command line... they should look like: 41# var=val which will define the global var to have value val. 42# the output file name may be define with out=filename 43set out stdout 44foreach ent $argv { 45 lassign [split $ent =] var value 46 set $var $value 47} 48 49proc buildList {} { 50 buildCmds data 51 set lenConfigCmds [llength $::configcmds] 52 set ::used {} 53 set ::result {} 54 set noCmds 0 55 set ent -1 56 foreach cmd [list {} {*}$::glob(edit_configuration_configlist)] { 57 if {$cmd == {}} { 58 set ind 0 59 } else { 60 lassign $cmd lab head flag 61 if {$head != {}} { 62 # a header. 63 set search *\*\*\*\*\*\**$head* 64 set ind [lsearch -glob -nocase $::configcmds ${search}] 65 } else { 66 set search "config($lab)" 67 set ind -1 68 set found 0 69 foreach ent $::configcmds { 70 incr ind 71 if {[string range $ent 0 7] != "AddConf "} {continue} 72 set matchPart [lindex $ent 2] 73 lassign $matchPart con pat 74 set npat {} 75 append npat $con "(" $pat ")" 76 if {$matchPart == $search ||\ 77 [string match $npat $search]} { 78 incr found 79 break 80 } 81 } 82 if {!$found} { 83 puts "Oops! could not find \"$search\" in configcommands" 84 puts "working with $cmd" 85 continue 86 } 87 } 88 } 89 set line [lindex $::configcmds $ind] 90 set limit 0 91 while {[incr limit] < 100} { 92 if {$limit > 98} { 93 puts "can not find end of $cmd, configcmds entry $ind" 94 return 95 } 96 lappend ::result $line 97 if {$ind in $::used} { 98 puts "configcmds entry $ind used at $noCmds for $cmd used before $limit" 99 } 100 lappend ::used $ind 101 incr noCmds 102 incr ind 103 set line [lindex $::configcmds $ind] 104 #if {$ind < 10} {puts "$ind $cmd"} 105 if {[string match {*\*\*\*\*\*\**} $line] ||\ 106 [string match "AddConf *config*" $line] ||\ 107 $ind > $lenConfigCmds} { 108 # puts "stop on $ind of $lenConfigCmds $line" 109 break 110 } 111 } 112 } 113 puts "$noCmds executed of [llength $::configcmds]" 114 set unused {} 115 set ind -1 116 while {[incr ind] < [llength $::configcmds]} { 117 if {$ind in $::used} {continue} 118 lappend unused $ind 119 } 120 puts "unused commands $unused" 121 122 # unset -nocomplain ::configcmds 123} 124# Here we build a list of commands in data using "info body" as 125# source. 126 127proc buildCmds {fun} { 128 set cmds [info body $fun] 129 set start 0 130 set end 1 131 set ::configcmds {} 132 while {$end < [string length $cmds] && [incr lim] < 10000} { 133 set end [string first \n $cmds $end] 134 if {$end == -1} { 135 set end [string length $cmds] 136 } 137 if {[info complete [set nc [string range $cmds $start $end-1]]] &&\ 138 [set rs [string trim $nc]] != {}} { 139 lappend ::configcmds $rs 140 set start $end 141 } 142 incr end 143 } 144 puts "found [llength $::configcmds] commands" 145} 146 147# Here are the key data elements (glob(edit_configuration_configlist) 148# and proc data) 149 # {{ bind} {Each entry binds}} 150 # {{ menu} {Mail To}} 151 # {{ exception} no_selection} 152 153set glob(edit_configuration_configlist) { 154 {Hotlists {HOTLISTS}} 155 hotlist 156 runlist 157 {{Mouse Bindings & menus} {MOUSE & KEY BINDINGS & MENUS}} 158 bind, 159 global-bind, 160 menu, 161 no_selection 162 [expr {$::MSW ? "X-behave" : ""}] 163 paste 164 [expr {$::MSW ? "CB-paste" : ""}] 165 {Commands {COMMAND CONFIGURATION}} 166 editor 167 cmd,diff 168 cmd,open 169 cmd,print 170 cmd,term 171 open,extensions 172 view,extensions 173 {Archiver/Packer {ARCHIVER/PACKER}} 174 cmd,archive 175 cmd,pack 176 cmd,unarc,extensions 177 cmd,unpack,extensions 178 {{passwordlocker} {PASSWORD LOCKER}} 179 passwordLocker 180 {VFS {Type I VFS CONFIGURATION}} 181 vfs,cache,maxentries 182 vfs,helptable 183 ftp,cd_pwd 184 ftp,fastlink 185 ftp,timeout 186 ftp,password 187 ftp,proxy 188 ftp,useproxy 189 ftp,login 190 {{VFS TYPE II} {Type II VFS CONFIGURATION}} 191 vfsII,config 192 {RSYNC/SFTP {RSYNC/SFTP CONFIGURATION}} 193 rsync,table 194 {{USER BUTTONS} {USER BUTTON CONFIGURATION}} 195 userButton, 196 {HTTP {HTTP CONFIGURATION}} 197 http,proxy 198 {{APPEARANCE/colors } {APPEARANCE - COLORS}} 199 gray 200 middle_button_colors 201 gui,color_bg 202 gui,color_fg 203 gui,color_cmd 204 gui,color_select_bg 205 gui,color_select_fg 206 gui,color_highlight_bg 207 gui,color_highlight_fg 208 gui,color_handle 209 gui,color_scheme 210 gui,color_cursor 211 gui,color_flash 212 gui,color_balloonHelp_fg 213 gui,color_balloonHelp_bg 214 {{APPEARANCE/fonts} {APPEARANCE - FONTS}} 215 gui,ListBoxFont 216 gui,GuiFont 217 gui,BalloonHelpFont 218 {{APPEARANCE/directory/more} {APPEARANCE - DIRECTORY - OTHER}} 219 ListBoxColumns,right 220 ListBoxColumns,left 221 ListBoxScripts 222 {{APPEARANCE/SIZE/LOCATION} {APPEARANCE - SIZE - LOCATION}} 223 geometry,main 224 geometry,mainops 225 geometry,textviewer 226 geometry,qedit 227 geometry,max 228 geometry,min 229 geometry,location 230 {{APPEARANCE/windows} {APPEARANCE - WINDOWS}} 231 columnScroll 232 columnScrollSize 233 middle_button_list 234 {Shell {SHELL CONFIGURATION}} 235 shell,aliases 236 shell,buffer 237 shell,height,left 238 shell,height,right 239 ask,dir_delete 240 ask,file_delete 241 ask,save_modified_file 242 autoupdate 243 balloonhelp 244 positiondirs 245 cd_pwd 246 check_ownership 247 create_relative_links 248 dateformat 249 DisplayName 250 DisplayNameShare 251 fast_checkboxes 252 fileshow,all 253 fileshow,dirs 254 fileshow,sort 255 sortoption 256 focusFollowsMouse 257 inotify_flags 258 inotify_rate_limit 259 inotify_nlflags 260 keyb_support 261 logsize 262 mwheel,delta 263 mwheel,neg 264 mwheel,pos 265 save_conf_at_exit 266 spellingFilter 267 spellcheck,expect 268 {miscellaneous {MISC CONFIGURATION}} 269 startpwd,left 270 startpwd,right 271 search,limit 272 search,CmdConfStrings 273 search,ViewEditStrings 274 [expr {$::MSW ? "" : "monitors"}] 275 [expr {$::MSW ? "" : "manualMonitors"}] 276 {{Dangerous stuff} {DANGEROUS}} 277 [expr {$::MSW ? "" : "cmd,chmod"}] 278 [expr {$::MSW ? "" : "cmd,chown"}] 279 cmd,cp 280 cmd,dircp 281 cmd,du 282 cmd,find 283 cmd,hardlink 284 cmd,rm 285 cmd,sh 286 cmd,tail 287 cmd,touch 288 cmd,ucmd 289 [expr {$::MSW ? "useDIR" : ""}] 290} 291proc translate {} { 292 global glob 293 # now do the substutions for windows vs unix 294 puts "translate left using MSW=$::MSW" 295 set glob(edit_configuration_configlist) \ 296 [subst $glob(edit_configuration_configlist)] 297 #puts "translate done" 298 # At some point we might want to translate the right side as well 299 # That would involve finding the references to ::MSW and resolving them 300} 301 302proc data {} { 303 putsTrim $fid { 304 # Generated by FileRunner `{subst "$::glob(displayVersion) on 305 # [clock format [clock seconds]]"}` 306 307 # This is the configuration file for FileRunner. It is read every time 308 # FileRunner starts up. It is saved in a sub `{ifThis {$::MSW} {folder of 309 # your HOME foulder, usually in "%%APPDATA%%/.fr". 310 # %%APPDATA%% is the MS windows environment variable APPDATA. (You may 311 # see the contents of this variable in a filerunner command window by typing 312 # "%set env(APPDATA)" or "echo %%APPDATA%%".) FileRunner will also recognize 313 # these possible locations for the configuration file: "%%LOCALAPPDATA%%/.fr", 314 # "%%USERPROFILE%%/.fr"} {directory of your HOME directory, usually 315 # "~/.config/.fr" or "~/.fr "(~ is short for the path to your home directory).}}` 316 # The configuration file is named "config<date>" where <date> is the release 317 # date of the FileRunner. New versions of FileRunner will use old config 318 # files to build a new one with the new date. This allows old FileRunner 319 # versions to continue to use their config files with out conflict with newer 320 # versions. 321 # 322 # Make 323 # sure to only edit values for variables that are listed. Do not add or 324 # delete comments or other variables, since this file will be automatically 325 # regenerated 326 # when you do a "Edit Configuration->Save Configuration" in the menu and those 327 # changes will be lost. 328 # 329 # This config file is saved to disk and reread into FileRunner when you 330 # press the OK button in the config browser. 331 332 # You can also edit this file 333 # with a regular text editor and re-read it into FileRunner with 334 # "Configuration->Reread Configuration" or just restart FileRunner. 335 # (If you have the save on exit option set you should exit FileRunner by 336 # typing "%exit" in a command window to avoid the auto save messing with 337 # your newly edited file.) 338 339 # From time to time, as FileRunner is enhanced, the 'as shipped' version 340 # of a configuration entry may change. If you have an existing configuration 341 # file, it will replace the 'as shipped' entry with what you have entered 342 # or what was last shipped. To reset an entry to the current 'as shipped' 343 # version all you need to do is to eliminate that entry from the configuration, 344 # either with the configuration editor or another editor. That is all 345 # that needs to be done. FileRunner will replace the missing entry with the 346 # current 'as shipped' version. 347 348 #`{ifThis {$::MSW} {# FileRunner handles file path names as 349 # "/" separated components and not "\\" separated as windows uses. In passed 350 # versions of FileRunner it was recommended that you use [file native] to 351 # pass native MS windows file names. This version ALWAYS passes native 352 # file names so that option is no longer needed and in fact will be 353 # automaticly removed from the config file.} {}}` 354 355 # Syntax note: Filerunner uses a special Exec Call Formatter (frECF) to 356 # set up calls to external 357 # (and some internal) programs and functions. To get details on how the 358 # lines in this file are handled please read the "Configure 359 # options for commands I" and II in the Tips file (see Help menu). 360 361 # Patterns: The rule based commands use rules set up in this configuration 362 # code. Most of these rules use a 'tcl string match' pattern to match the 363 # rule or option to some string (file name, message, etc.). Here is a 364 # summary of the match rules. For more details google the tcl string 365 # command, match subcommand. 366 # 367 # * Matches any sequence of characters in string, 368 # including a null string.`{in 1 9}``{next;in 0}` 369 370 # ? Matches any single character in string.`{next}` 371 372 # [chars] Matches any character in the set given by chars. If a 373 # sequence of `{in 1 9}`the form x-y appears in chars, then any 374 # character`{next}` between x and y, inclusive, will match.`{next;in 0}` 375 376 # \x Matches the single character x.`{next}` 377 378 # 379 #`{ifThis {$::MSW} {# Some useful things you may need here: 380 381 # [namespace exists freewrap] is true only in the fr*.exe version of fr.`{next}` 382 # If you are having trouble with spaces in file names try:`{next;in 1}` 383 # [file attr 'filename' -sh]`{next}` 384 # this replaces filename with the short name which will have 385 # no spaces.`{next;in 0}`} {}}` 386 # 387 } 388 puts $fid "ClearTheDecksHereComeANewConfig" 389 putsTrim $fid { 390 #**************** HOTLISTS `{fill *}` 391 } 392 393 AddConf $fid config(hotlist) 2 { 394 # This list is what will show up in your HotList menu. (Like "bookmarks" 395 # in a browser). Feel free to edit this list. 396 # You can label your selections thusly: {label /home/usr/foobar} 397 # and you can build as many levels of cascade menus as you like 398 # with each cascade starting with an entry preceeded by "-" 399 # thusly:`{next;in 1}` 400 # one level {-clabel { a b c }}`{next}` 401 # two level {first {a b {-second {c d e}}}} 402 403 # or, more readably:`{next;in 0}` 404 405 # set config(hotlist) {`{next;in 1}` 406 # {-first {`{next;in 1;in 1}` 407 # a`{next}` 408 # b`{next}` 409 # {-second {`{next;in 1;in 1}` 410 # c`{next}` 411 # d`{next}` 412 # e`{next}` 413 # }`{next;in 0}` 414 # }`{next;in 0}` 415 # }`{next;in 0}` 416 # }`{next;in 0}` 417 # }`{next;in 0}` 418 # where each 'a' 'b' 'c' 'd' 'e' is an entry which also may have a label as above. 419 # For example here is an entry for the Windows volumes:`{next}` 420 # {-volumes {{floppy a:/} {{system volume} c:/} { d:/ }}}`{next}` 421 # The '{}' around an entry allow spaces which otherwise seperate the entries. 422 # White space is preserved so what ever indention format you use is kept. 423 # Try it... 424 } 425 426 AddConf $fid config(runlist) 2 { 427 # This list is used by the Run ... commands (Utilities menu). It contains 428 # a list of programs that you can select and instructions on how to run them. 429 # You may find it easier to add to this list by invoking the Run command 430 # and selecting '<Add a new program>' where you can use command completion and 431 # or browsing to find the program name. 432 # 433 # Each entry in the list contains 2 to 5 entries as follows: 434 # 435 # The first entry is the display name (or 'nice' name) and the run string. 436 # You may choose any thing you want for the display name. The run string 437 # should contain the program name (possibly a full path name) followed by any 438 # flags you want to code. The file(s) you are passing will replace the '%s' 439 # in this string. If the program name contains spaces you should can either 440 # enclose the full program name in curly braces ({}) or precede each space 441 # with a back slash (\). `{ifThis {$::MSW} {Use '/' instead of '\' 442 # in file names.}}` 443 # 444 # The second entry is the string you want to separate the files with 445 # (should you ever pass more than one file). Usually this is a space, coded as 446 # { }. 447 # 448 # The remaining two entries are 'async' 'fullname' and 'last+current' 449 # coded in any order. 450 # These are optional entries. 451 452 # If 'async' is present the program is run 453 # asynchronously.`{next}` If 'fullname' is coded only full filenames are passed. 454 # `{next}` If 'last+current' is coded both the last & the currently selected 455 # file names are passed. 456 457 # Here is an example entry to run the 'thunderbird' mailer to compose a 458 # mail message with the selected files as attachments. It will display as 459 # 'mail-to' when the 'Run' command is invoked. 460 # 461 # {{mail-to {thunderbird -compose attachment='%r'}} , fullname async} 462 # 463 # Here is how to call emacs to diff two files: 464 # 465 # {{Emacs-diff {emacsclient -e {(edif-files %s %s )} &}}} 466 467 # If you need to use the quotes '"' use '%' to protect them e.g.'%"'. 468 # (Note that in the mail-to case the parameter is 'attac....'. Any spaces (except 469 # in file names, which are autmatically escaped) will make more than one parameter 470 # and (likely) fail. 471 # 472 # The display of the run list (when the run command is given) may be setup 473 # as a cascade (or hierarchical) menu. To do this the contents of each 474 # sub menu must be contained in '{-title sub-menu-entries}' (note the "-"). 475 # For example 476 # this would be the entry for two versions of running fr as root, one with 477 # the home dir change to root's dir and one with the current home dir: `{next}` 478 479 # {{-root-fr-options} { `{next;in 1;in 1}` 480 # {{{using root's home} {sudo -H fr}} { }}`{next}` 481 # {{{using my home} {sudo fr}} { }}`{next;in 0}` 482 # }`{next;in 0}` 483 # } 484 # White space is preserved so what ever indention format you use is kept. 485 } 486 487 488 putsTrim $fid { 489 #****** MOUSE & KEY BINDINGS & MENUS `{fill *}` 490 491 # This is the binding list. There are two types of bindings, global and 492 # local to a directory. Global bindings may be triggered anywhere in 493 # filerunner's main window, except that local bindings will suppress global 494 # bindings in the directory windows. So, for example mouse 3 can be locally 495 # bound to ViewOne and globally bound to a menu. In a directory window mouse-3 496 # will do ViewOne, while outside of the directory it will bring up the menu. 497 # Global bindings look like: 498 499 # config(global-bind,event) action 500 501 # local bindings look like: 502 503 # config(bind,event) action 504 505 # Each entry binds a key or mouse event to an action. 506 # Legal actions are all the possible (not just those you configured 507 # to be present) commands in the center button list, including 508 # user defined buttons, plus the following commands from other filerunner 509 # menus (listed below). Of these commands 'CmdRunCmd' 'Back' and 510 # 'UpDirTree' take parameters. For 'CmdRunCmd' the parameter is 511 # the 'nice' name of a program that must appear 512 # in the runlist (see above). This parameter is 513 # optional. For example, using the 'mail-to' example in the runlist, this: 514 # 515 # set config(bind,Button-2) {CmdRunCmd mail-to} 516 # 517 # will cause a mouse button 2 press to run thunderbird to bring up a mail 518 # compose window with the selected files 'attached' to the message. 519 # The commands 'Back' and 'UpDirTree' must be coded exactly as shown. 520 # 'Back' pops a dir from the dir stack and makes it the current dir 521 # (the same as the <- button). 'UpDirTree' is the same as the ^ button. 522 # One of these commands might be bound to the Left key (left arrow). You 523 # then might want to bind the Right key (right arrow) to 'ViewOne'. 524 # The 'Toggle' command takes as a parameter a config item and toggles it. 525 # For example 'Toggle config(fileshow,all)' All the binary items in the 526 # Configuration menu may be toggled this way. Binary config options not 527 # in this menu will, most likely not work, especially if their changes require 528 # rebuilding the window (e.g. the keyboard support binary). 529 # Legal values for the 'bind' command may be found in the man page (do a 530 # google search for 'tk bind'). In general, mouse buttons 1, 2 & 3 with 531 # modifiers 'Double, Triple, Meta, Alt, Control etc. may be used. (Do 532 # understand that 'Double' & 'Triple' will also invoke the actions leading 533 # to the given action, that is a Triple will also invoke the single and double. 534 # Also, the button 1 selection will happen even if button one is also 535 # bound to a command (this is not recommended). Also note that all printing 536 # chars are used by the position command. If you do bind a printing character 537 # that binding as well as the position command will be executed. 538 # 539 # In the list below, the first element in each entry is the 'nice' 540 # label, the second is the actual command name. You may use either one in 541 # bind and menu configuration. This is a list of the bindings filerunner 542 # ships with. These may be changed or but not eliminated at your discretion 543 # (since these are predefined they will not go away if you just eliminate them 544 # but you may set them to null "{}" to make them do nothing): 545 546 # set config(bind,Button-3) ViewOne`{next}` 547 # set config(bind,Double-1) {DoMenu,three}`{next}` 548 # set config(bind,Control-3) ViewDirOpposite`{next}` 549 # set config(bind,Control-1) {DoMenu,sample}`{next}` 550 # set config(bind,Button-2) {DoMenu,two}`{next}` 551 # set config(global-bind,Button-3) {DoMenu,two} 552 553 # Here is the current list: 554 } 555 556 foreach k $glob(buttoncmds) { 557 putsTrim $fid "# [list $k]" 558 } 559 putsTrim $fid "\n" 560 561 AddConf $fid {config bind,*} "" { } 562 563 AddConf $fid {config global-bind,*} "" {} 564 565 AddConf $fid {config menu,*} "1" { 566 # These are the menus. Each menu is a list of commands & menu references. 567 # a menu reference looks like 'DoMenu,name' where 'name' is the menu's 568 # name and should appear here in a config(menu,name) description. 569 # You may define as many menus as you like, however, only menus that 570 # are referred to by one of the bindings listed above (and cascade menus 571 # of those) will be built. An empty entry (i.e. {}) will generate a 572 # separator in the menu. All of these menus may be 'torn off' by clicking 573 # on the top entry (the '-----'). This promotes the menu to a window which 574 # may be moved around on the screen. Torn off menus no longer have access 575 # to the list box entry that you were on when the menu was first popped up 576 # but they do have access to the current selection(s). To continue our 577 # example of using the run command, here is a menu line that will give a 578 # menu entry called 'Mail To' which will run 'thunderbird' (see the runlist 579 # above) to bring up a compose window with the selected files attached. 580 # 581 # {{Mail To} {CmdRunCmd 0 mail-to}} 582 } 583 AddConf $fid config(no_selection) 1 { 584 # Commands in this list will not update the selection when they are 585 # selected via a bind command. All other commands will up date the selection 586 # if, when they are called via a 'bind'ing, there is no current selection. 587 # You should only add to this list if you really know what you are doing. 588 # These commands need to know how to work without a selection. 589 # Removing commands from this list will make the removed commands update the 590 # selection the same as others do. 591 } 592 AddConf $fid config(X-behave) "" { 593 # The X-behave option attempts to make filerunner behave more closely to 594 # how the X11 system works on *nix systems with respect to cut and paste. 595 # In MS Windows, there is a local "selection" and a "clipboard". In general 596 # one makes a selection with mouse 1 (often by dragging) and then copies that 597 # to the "clipboard" (usually with Control-C). One can then "paste" that 598 # information into the same or another application. In filerunner and other 599 # apps the "selection" can be "pasted" locally with out copying it to the 600 # "clipboard". In filerunner the current selection is highlighted in color. 601 # If a new selection is made the old highlighted selection is replaced by 602 # the new one (including the change of highlighting). By default 603 # <Button2-ButtonRelease> does a "paste" of the selection and 604 # <Shift-Button2-ButtonRelease> and Control-v does a "paste" from the 605 # "clibboard". 606 # On *nix systems (Unix, Linux) a selection is always put in the "clipboard". 607 # The Xbehave option, if 1, puts selections in the "clipboard" as soon as 608 # they are made. 609 # 610 } 611 AddConf $fid config(paste) 1 { 612 # The "paste" configuration item allow you to define additional mouse or 613 # key selections that do a "paste". `{ifThis {$::MSW} {This paste will be 614 # from the current selection (i.e. the local filerunner highlighted text) 615 # <ButtonRelease-2> is defined to do this in the "as shipped" 616 # filerunner.} {The standard paste characters 617 # <Control-v> and <Control-y> are already defined. 618 # In addition some systems 619 # define <ButtonRelease-2> and <Control-Shift-Insert>.}}` This info is 620 # required for paste operations in the directory line where the paste is 621 # intercepted to make magic happen. At the same time, any sequence named 622 # here will result in a 'paste' being preformed (without the magic) in all 623 # filerunner 'view' windows. If your system has other sequences for 'paste' 624 # but you don't used them to paste in the directory line you don't need to 625 # enter them here. Filerunner is shipped with <ButtonRelease-2> set 626 # as this is common in the Unix world. Syntax is the same as the Tc/Tk 627 # bind command (see bind(n)). 628 } 629 AddConf $fid config(CB-paste) 1 { 630 # This option allows you to define an optional mouse or key-board character 631 # to "paste" from the "clipboard". The "as shipped" entry here is 632 # <Shift-ButtonRelease-2>, Control-Key-v <Shift-Key-Insert> 633 # and <Control-Lock-Key-V> 634 635 } 636 putsTrim $fid { 637 #********** COMMAND CONFIGURATION *`{fill *}` 638 } 639 AddConf $fid config(editor) "" { 640 # This variable should be set to the name of your favorite text 641 # editor. This editor will be invoked when you select files and press 642 # the "Edit" button. It is also invoked when you double click on any 643 # file name in a list box. The text editor you choose should be an 644 # window application, not a text-terminal application. You can start 645 # text-terminal editors for example by launching them from inside an 646 # xterm. E.g: "xterm -e vi %s". The editor you choose should be able to 647 # load multiple files specified as arguments to the editor (e.g: 648 # "emacs /tmp/foo /home/joe/bar"). The editor will be launched in the 649 # background. 650 651 # Note: If you use a path name and any elements of it contain blanks 652 # you will need to do something like:`{next}` 653 # set config(editor) {`{next;in 1 5}` 654 # {c:/Program Files/Windows NT/Accessories/wordpad.exe} %s}`{next;in 0}` 655 # You could also just put the path in you PATH env var, either in your system 656 # environment set up or in the config file in filerunner's home directory:`{next}` 657 # `{ifThis {$::MSW} { 658 # global env; set env(PATH) "$env(PATH);<path to wordpad program>".} { 659 # global env; set env(PATH) "$env(PATH):<path to emacs program>"}}` 660 } 661 AddConf $fid config(cmd,diff) "" { 662 # Your favorite diff command. Should be able to diff directories also. 663 # Used in the "Diff" button command. Filerunner will wait 664 # until the program finishes unless you put a trailing '&' here. 665 # You should do this if your diff program opens its own window e.g. meld or 666 # emacs. Since you asked, this is what you need here to get emacs to 667 # diff two files:`{next}` 668 # 669 # set config(cmd,diff) {emacsclient -e {(ediff-files %s %s% )} &} 670 # 671 # If you use a non-gui program leave off the '&' and filerunner will 672 # pop up 673 # a window with the results.`{ifThis {$::MSW} { For windows 674 # you might want to use "fc".} }` 675 } 676 AddConf $fid config(cmd,open) "" { 677 # This rule is command for the 'Open' command (above). `{ifThis {$::MSW} { 678 # This should be: `{next}`'{twapi::shell_start -path {%s}}'} 679 # {I am aware of 'gnome-open' 'kde-open' and 'xdg-open' 680 # (one file limit) and 'gvfs-open' 681 # (runs program for each file rather than send all files to the same program.)} }` 682 # `{next}`Mac systems use 'open'. 683 } 684 685 AddConf $fid config(cmd,print) "" { 686 # The print command you want to use to print files. 687 } 688 689 AddConf $fid config(cmd,term) "" { 690 # The name of your favorite terminal program. 691 # This is the program that will be launched when you press the button 692 # with the image of the terminal window (upper right of the file list 693 # panels). It will be launched in the background. If you include a %s 694 # in this command it will be replaced with the current working dir 695 # e.g.: 696 697 {konsole --workdir %s} 698 699 # The command is also invoked in the current working dir. 700 } 701 702 AddConf $fid config(open,extensions) "1" { 703 # This rule contains a list of commands and the file patterns that 704 # are used when finding the right 'open' routine for various files. The 705 # commands will receive a list of selected files. The first file in the 706 # selected list are used when deciding which opener should be used. (Don't 707 # try and open a couple of text files and images simultaneously by selecting 708 # and pressing the open button). If you add the option "-viewtext" 709 # last in the rule that means the command outputs a listing/view and it 710 # should be viewed in the internal text viewer. The opening commands 711 # will be executed in the background. Open is used to launch applications 712 # based on the file extension, however, for some files it makes more 713 # sense to launch the application in a 'peek' mode. For this see the 714 # view command. 715 } 716 717 AddConf $fid config(view,extensions) "1" { 718 # This rule contains a list of commands and the file patterns that 719 # are used when finding the right viewer for various files. The commands 720 # will receive a list of selected files. The first file in the selected 721 # list is used when deciding which viewer should be used. (Don't try 722 # and view a couple of text files and images simultaneously by selecting 723 # and pressing the view button). If you add the option "-viewtext" 724 # last in the rule that means the command outputs a listing/view and it 725 # should be viewed in the internal text viewer. The viewing commands 726 # will be executed in the background. View may be used to launch applications 727 # based on the file extension, however, for some files what makes more 728 # sense to launch the application in a 'peek' mode. For example you 729 # may want to 'peek' inside a .zip file to see what it contains with: 730 731 # { {unzip -lv %s} {*.zip} -viewtext } 732 733 # where the '-lv' tells unzip to list the files in the package. 734 # This is particularly true of files that are addressed by the UnArc and 735 # the UnPack buttons where, for example we might want: 736 737 # { {unzip -oqq %s} {*.zip} } 738 739 # to actually unzip the file. 740 741 # If the rules program name is {try open} the 742 # indicated files will be sent to the "open" rule. This is very useful in 743 # cases where the system may have any of several programs to 'view' files of 744 # a given type. Here is an example that sends '*.pdf' files to the open rule: 745 746 # {{try open} {*.pdf}} 747 } 748 749 putsTrim $fid { 750 #****** ARCHIVER/PACKER CONFIGURATION `{fill *}` 751 } 752 AddConf $fid config(cmd,archive) "" { 753 # This is the name of your archiver program. The archiver program is 754 # passed the name of the directory selected and is executed in the 755 # current directory. The archive created is supposed to contain the 756 # contents of the directory. The default built in "tar+gz %s" creates 757 # an archive named <directory>.tar.gz packed with tar and gzip. This 758 # command is used in the "Arc" button command to pack/archive 759 # directories. It can be run synchronously or in the background. 760 # This command takes up to three parameters (%s)'s. The first is the 761 # selected file (or directory) the second is the other panels working 762 # directory and the third is again the selected file. Thus: 763 764 # "tar -cz %s -f %s/%s.tar.gz" 765 766 # is the same as "tar+gz %s" except 767 # that the result will be put in the 'other' directory. 768 } 769 770 AddConf $fid config(cmd,pack) "" { 771 # The name of your favorite packer command. 772 # Used in the "Arc" button command to pack files. Run synchronously 773 # or in the background. 774 } 775 AddConf $fid config(cmd,unarc,extensions) "1" { 776 # Extensions and bindings for unarchive rules. This is a list of 777 # commands and file name extensions. Filerunner will use this variable 778 # when deciding which command should be used to unarchive the file when 779 # you press the UnArc button. See above comments on the 'view' command. 780 # Its OK to put identical rules here and in the following 'unpack' 781 # command to, for example, unzip a file even if you push the wrong 782 # button. 783 } 784 785 AddConf $fid config(cmd,unpack,extensions) "1" { 786 # Extensions and bindings for unpacking rules. This is a list of 787 # commands and file name extensions. Filerunner will use this variable 788 # when deciding which command should be used to unpack the file when you 789 # press the UnPack button. 790 } 791 792 793 794 putsTrim $fid { 795 #****** PASSWORD LOCKER `{fill *}` 796 } 797 798 AddConf $fid config(passwordLocker) 1 { 799 # All passwords that are kept by filerunner are kept here. 800 # Each entry contains an ID and the encripted password and, 801 # optionally a `{ifThis {$::MSW} {drive letter} {mount point}}` 802 # followed by an optiional "flag". 803 # 804 # If a `{ifThis {$::MSW} {drive letter} {mount point}}` is present, 805 # the flag controls if a "Display Name" is generated for the entry. 806 # If a "Display Name" is generated it will be in the "HotList" and 807 # optionally in the "volume" list 808 # (i.e. the listing for directory "") depending on the "flag". 809 # Recognized flag values are:`{next}` 810 811 # No "Display Name" will not be generated`{next}` 812 # Hot-only Only put it in the "HotList"`{next}` 813 # Both or nil Put in both the "volume" and "HotList"`{next}` 814 # 815 # The flag may be abbreviate (to one char) and may have either case. 816 # If a "Display Name" is generated the config(DisplayNameShare) entry 817 # governs its formatting. 818 819 # Usually the ID is a URL for the site that the password is for, 820 # however, there is nothing that requires the ID to be a URL except 821 # that most VFS logins use URLs to find the password. Still the password 822 # locker access code supplies and requires a URL for the password id. 823 824 # URLs have the following parts:`{next}` 825 # "protocol" the protocol e.g. ftp, rsync, sftp, cifs`{next}` 826 # "user" is the user name and`{next}` 827 # "port" the port" is optional if not the standard port) 828 # however it is part of the ID and if changed here the`{in 1 11}` 829 # VFS handler may not find the password.`{next;in 0}` 830 # Also, the ID most often will require the "user"`{next}` 831 # "address" The address to be accesed with this password. 832 833 # The full URL format is: "protocol://user@address:port"`{next}` 834 # For "cifs" this looks like "cifs://user@server/share" 835 836 # The password code does not require a "protocol" or a "port". So for 837 # user password on the current machine the Id would look like: 838 839 # ://user@localhost 840 841 # If the password code is given an Id of "foo" it will search this 842 # table for "://foo@localhost" 843 844 # The best and easiest way to handle the password Locker is to 845 # allow filerunner to prompt for what it needs and to indicate 846 # at that time if the password is to be saved. If an entered password 847 # fails you will get another chance to try. 848 849 # The 'password info' has the following three parts: 850 851 # A password (may be {} for sftp connections using ssh keys)`{next}` 852 # The disk address of the ssh private key (may be a full address or 853 # the file name if the key is in env(HOME)/.ssh)`{in 1 5;next;in 0}` 854 # The pass phrase.`{next}` 855 # 856 # If any of these entries contain blanks, enclose the whole 857 # entry in braces e.g.:`{next}` {Hello world}`{next}` 858 # Note that filerunner will encrypt the 'password info'. 859 # If you need to change 860 # it you should delete the string:`{next}` 861 #'>> list of numbers <<'`{next}` 862 # and enter the new 863 # info in plain text. File runner will encrypt it automatically. 864 } 865 866 putsTrim $fid { 867 #*********** Type I VFS CONFIGURATION `{fill *}` 868 869 The "Virtual File System" (VFS) grew out of the origional FTP work 870 so some of these entries are still named for FTP while, in fact, are 871 used in the VFS code. 872 } 873 AddConf $fid config(vfs,cache,maxentries) "" { 874 # Maximum number of directory listings the cache should hold. 875 } 876 AddConf $fid config(ftp,cd_pwd) "" { 877 # If true (non-zero): When doing a cd to a new directory, Filerunner 878 # will run pwd to check where it ended up (which makes a difference 879 # if you cd to a link which points to a directory). 880 } 881 AddConf $fid config(ftp,fastlink) "" { 882 # Set this to 1 if you feel your FTP connections are fast, to 0 883 # otherwise. If you set it to 1, soft-links in FTP listings are 884 # correctly identified either as links to directories or to files, 885 # otherwise it will always think links are links to directories. 886 } 887 888 AddConf $fid config(ftp,timeout) "" { 889 # Set timeout in seconds for VFS communication. 890 } 891 892 AddConf $fid config(ftp,password) "" { 893 # Set password for anonymous FTP sessions. This should be your 894 # email address. 895 } 896 897 898 AddConf $fid config(ftp,proxy) "" { 899 # ******** WARNNING ***************`{next}` 900 # With no way to test ftp proxy I fear this feature will not work.`{next}` 901 902 # If you have to go through a firewall via an FTP proxy, set this 903 # variable to the hostname of your FTP proxy. Set it to "" if you don't 904 # have an FTP proxy. 905 } 906 907 AddConf $fid config(ftp,useproxy) "" { 908 # 1 -> Use defined ftp proxy`{next}` 909 # 0 -> Don't use proxy (to access hosts inside the proxy/firewall) 910 } 911 AddConf $fid config(ftp,login) 1 { 912 # Place holder till we get it all moved to vfs. 913 # If config(ftp,login) is not empty a message will be generated 914 # each time filerunner is started suggesting that it be 915 # either eliminated or converted to a VFS login and entered 916 # in config(vfs,login) below. 917 } 918 919 putsTrim $fid { 920 #****** Type II VFS CONFIGURATION `{fill *}` 921 } 922 AddConf $fid config(vfsII,config) "2" { 923 # A TYPE II VFS (as defined by filerunner) is a Virtual File System (VFS) 924 # that is constructed by setting up a set of files on the system such that 925 # they are actually on the system drive (i.e. they are NOT really virtual). 926 # This means you can do anything you want to with them, including passing 927 # them to external programs. What is provided here is a rule based method 928 # to make them appear and disappear on the system. For example, consider 929 # a compressed "tar" archive. The filerunner 'mount' command will look in 930 # this config variable for a set of rules (based on the file extension 931 # in this case) to uncompressed and unpack the archive to a location 932 # (specified in the rules) and, if desired, provide an alias named path 933 # to the unpacked files (see 'DisplayName' under 'Miscellaneous' below). 934 # If the rule specifies that the files are 935 # read only, the 'unmount' command will just delete the files. If 936 # the files are not readonly, the 'unmount' script should rebuild the 937 # archive and replace the original file prior to deleting the files. 938 # 939 # The set of rules consist of the following parts: 940 # 941 # 1) Each rule is entered as a set of pairs with the name of the option 942 # `{in 1 3}`followed by its value (e.g. -mount <mount command>) 943 # "*" indicates optional. Option names may be abbreviated. 944 945 # The options are:`{next}` 946 # option value comments`{next}` 947 948 # -mount <mount command> * if the command has spaces, 949 # enclose in braces `{in 1 32}` 950 # if external program lead with exec `{next;in 0}` 951 # -use unarc or unpack * Find the command in the given rule`{next}` 952 # -location <a directory> * The path to the VFS directory`{next}` 953 # -display <name> * A name to display for the directory`{next}` 954 # -readonly 1 or 0 * 1 if a read only VFS`{next}` 955 # -umount <rebuild script> * A command/script to 956 # rebuild the archive`{in 1 32}``{next;in 0}` 957 # -dirsonly 1 or 0 * If 1 only directory names 958 # will match the rule. `{in 1 32}`If 0 or absent 959 # directories and files match`{next;in 0}` 960 # -okerror {pattern} * If the mount command generates an error that 961 # matches 'pattern' `{in 1 32}` 962 # (tcl string match pattern) the error 963 # is forgiven.`{next}` 964 965 #`{in 0}` 966 # The '-mount' may be omitted if '-use' is present. I.e. one or the other is required. 967 # If the '-mount' or '-umount' command is an external program it must be proceeded by 968 # 'exec'. This is done so internal filerunner commands may be used here. 969 # The 'exec' is provided in the '-use' case. 970 971 # Location options (each of these will be followed by a 972 # dirname choosen by fr):`{next;in 1 3}` 973 # a) A fixed dir (such as /tmp or ~/tmp)`{next}` 974 # b) Filerunners tmp dir (enter as: "$frTmp")`{next}` 975 # c) A location relative dir (., .. etc.)`{next}` 976 # d) The opposite panels directory (enter as: "$opwd")`{next;in 0}` 977 # 978 979 # The dir name may be a pattern built from the above. 980 981 # The 'DisplayName' will include this dir (and the path to it) i.e. the 982 # 'DisplayName' will replace the path/dir in the filerunner panel. 983 # To avoid collision, the displayed name should end with the dir name. 984 985 # The following, hopefully usful variables are available for use:`{next}` 986 # 987 # $frTmp Filerunner's per user temp area (for -location above)`{next}` 988 # $pwd The current panes working directory`{next}` 989 # $opwd The other panes working directory`{next}` 990 # $tail The selected file name with no path`{next}` 991 # $file The selected file name with full path (same as $pwd/$tail)`{in 1 7}` 992 # This will always show a local path to the file as 993 # it is the location VFS files are moved to.`{next;in 0}` 994 # $ext The selected files extension`{next}` 995 # $nil An empty string (use with -location to prevent creation attempt)`{next}` 996 997 # 2) A (glob) pattern to identify which files or directories use this rule. 998 # `{in 1 3}`This should look just like the view command pattern(s). More 999 # than one pattern may be used with a rule. If more than one they they 1000 # should be separated spaces with the whole group enclosed with 1001 # curly braces.`{next;in 0}` 1002 # 1003 # The as shipped version the the config file contains two example rules. 1004 # One to "mount" a tar archive. This rule will recreate the tar file on 1005 # "unmount". The other rule is to 1006 # read-only mount some of the many compressions that '7z' can unpack. (Make 1007 # sure '7z' is present and findable via the 'PATH' environment variable.) 1008 1009 # `{ifThis {!$::MSW} { 1010 # Here is a normal mount request, to be executed with 1011 # the directory selected.`{next}` 1012 #`{next}` 1013 # {{-mount {exec echo [pwLocker::getPw root] | sudo -HS mount} `{next;in 6;in 6}` 1014 # -location $nil`{next}` 1015 # -dirsonly 1`{next}` 1016 # -umount {exec echo [pwLocker::getPw root] | sudo -HS umount -l} `{next;in 0}` 1017 # } `{next}` 1018 # {*} `{next;in 0}` 1019 # } `{next}` 1020 #`{next}` 1021 # As this will match any selection, it should be last. It depends on the 1022 # target being in /etc/fstab and will throw an error if it isn't. 1023 # }}` 1024 1025 1026 } 1027 putsTrim $fid { 1028 #****** RSYNC/SFTP CONFIGURATION `{fill *}` 1029 } 1030 1031 AddConf $fid config(rsync,table) "2" { 1032 # Rsync is a program that does a very good job of copying files, especially 1033 # from one system to another. Filerunner is set up to dispatch "rsync" 1034 # in such a way that it does the copy directly with the target system 1035 # using one of the two ways it has of communication with the 1036 # remote (aka host) system (please see the rsync man page for details).`{next}` 1037 1038 # The first way assumes that you have the remote system mounted in the 1039 # local systems file space and the copy command is the "Rsync" button.`{next}` 1040 1041 # The second way is via VFS access to the remote system using VFSrsync. 1042 # For more on this, see below.`{next}` 1043 1044 # In the fitst way the remote file system is mounted to the 1045 # current system such that filerunner can display it in one of the panes. 1046 # In order to do the rsync transfer filerunner needs to translate 1047 # directory names as 1048 # they appear in filerunner to the names as they appear to rsync. 1049 # Filerunner handles the following connections (with needs given): 1050 # 1051 # nfs password (translation of diretory name automatic)`{next}` 1052 # cifs password share address on the remote`{next}` 1053 # ftp share address on the remote`{next}` 1054 # sftp share address on the remote`{next}` 1055 # 1056 # The rsync table should contain an entry for each remote machine 1057 # "share". Each entry contains 5 parts {share path mode ops pwd}. 1058 # 1059 # share is the cifs "share", nfs "host" or (s)ftp host 1060 # (for nfs and cifs this is the same as the fstab entry. 1061 # `{in 1 9}`For (s)ftp 1062 # this is the same as in the dir line when first opening a 1063 # connection. 1064 # It might look like "ftp://sunsite.unc.edu" for example.`{next;in 0}` 1065 # path is the host's path to the "share" 1066 # (for nfs fr finds this in the mount info)`{in 1}` 1067 # The path should not end in "/". I.e. if the file system root 1068 # is the path, enter {}. Windows paths should be entered with 1069 # "/", not "\".`{next;in 0}` 1070 # mode the mode the rsync connection should use, 1071 # one of (shell daemon{=module} use=altnateCmd)`{in 1}` 1072 # rsync daemon mode supports implies what rsync calls modules. 1073 # The module name should appear as the last part of the share 1074 # name (i.e. share/module). The key word "daemon" need not have 1075 # the "=module" part. The use= option allows you to use a program 1076 # other than rsync. scp is a possible alternative.`{next;in 0}` 1077 # ops the option string to pass to rsync for this connection 1078 # If spaces appear in this string the whole string should be`{in 1}` 1079 # quoted with {} e.g. {-a -v}`{next;in 0}` 1080 1081 1082 # Passwords are kept in the "password locker" and are no longer in the 1083 # rsync table. 1084 # 1085 # Where to put the port number? Usually the remote shell is ssh. The port 1086 # should be in the "ops" like this (see man page): 1087 # 1088 # --rsh="ssh -p <port>" where <port> is the port number. (Note quotes) 1089 # 1090 # If 'use=scp' the port would be '-P <port>' (Note upper case P) 1091 # 1092 # The first entry should have a null share and path and sets the default 1093 # mode, ops and pwd. These will be used when other entries don't supply 1094 # this info. It is not actually required to have other than the default 1095 # entry for nfs connections. If the shell or use=scp mode is used, the 1096 # password may not be required (see man pages on setting up password 1097 # free ssh/scp connections). 1098 1099 # THE SECOND WAY TO SET UP AN RSYNC CONNECTION: 1100 # 1101 # The VFSrsync package in filerunner allows you to type an "rsync" URL in 1102 # the directory window at the head of one of the file panes. In this case 1103 # the remote system (which the URL addresses) must support the access either 1104 # with an rsync daemon or one of the rsync shell access modes. The rsync VFS 1105 # package uses the entry in the rsync table to determine the "mode" of the 1106 # access and if "use=<op>" appears, <op> is used to access the remote. 1107 # 1108 # Example: 1109 # 1110 # set config(rsync,table) {`{next;in 1 3}` 1111 # { {} {} shell {-az} mypwd}`{next}` 1112 # {//roadracer/c c:/users/me } (uses default mode, ops)`{next}` 1113 # {ftp://ftp.yonder.com /home/me/ shell {-az}}`{next}` 1114 # {ftp://ftp.wild.com /home/me/ shell {-az --rsh="ssh -p 1022"}}`{next}` 1115 # {sftp://tame.com:1022 /home/you use=scp {-BC -P 1022}}`{next}` 1116 # }`{next;in 0}` 1117 # Note on the last entry the ':1022' port is not used but must be here 1118 # to match the sftp dir line. The actual port used is supplied by '-P 1022' 1119 # 1120 # 1121 } 1122 AddConf $fid config(vfs,helptable) "2" { 1123 # From time to time additional help is needed by some of the VFS packages 1124 # to configure themselves. This may be global (i.e. all connections 1125 # for the given package) or local to specific connections. In this table 1126 # such options may be provided. In order for these to work the target 1127 # VFS package needs to access this table. 1128 1129 # The VFS Helptable is a list of connection option entries. The connection 1130 # which is a URL which may be more or less specific (say "sftp://") 1131 # or more specific say ("sftp://host"). 1132 # The code will find the best match 1133 # i.e. the one where all the parts of the connection (i.e. protocol, 1134 # address, user and port) either match or are absent and the most parts 1135 # match. Usually entries should be in the order of increasing specificity, 1136 # so, for example, and entry for "sftp://" would proceed one for 1137 # "sftp://some.com" 1138 # The URL parts are: "sftp" "host" "user" and "port" entered as: 1139 # "sftp://user@host::port". 1140 1141 # At this time the VFSsftp package looks here for run time options and 1142 # also permission to use recursive access on reading or writing of 1143 # directories. The following options are supported:`{next}` 1144 # run=<runoptions> (default is {-oPort=$port -p})`{next}` 1145 # rcopyok=<?> (default is {rcopyok=3} `{in 1 17;next}` 1146 # (1 means read recursive is supported, 1147 # 2 write recursive, 3 both))`{next;in 0}` 1148 # rmdirempty=<bool> (default {rmdirempty=0}`{in 1 17;next}` 1149 # (0/1 can't/can delete a non-empty dir))`{next;in 0}` 1150 # 1151 # Each option should be surrounded by braces and may contain 1152 # "$port" to reference the port. The "-p" indicates that sftp should 1153 # preserve modification times, access times, and modes.`{next}` 1154 # A example is: 1155 # 1156 # set config(vfs,helptable) {`{next}` 1157 # {sftp://foo {run=-oPort=$port -p} rcopyok=0}`{in 1 17;next}` 1158 # }`{next;in 0}` 1159 } 1160 putsTrim $fid { 1161 #****** USER BUTTON CONFIGURATION `{fill *}` 1162 1163 1164 # You may configure one or more generic buttons for the center button list. 1165 # Each button has a label (what you see on it) and a couple of options. 1166 # Here is the syntax: 1167 # 1168 # set config(userButton,name) {`{next}` 1169 # command <command>`{in 1 32;next}` 1170 # label <label> (default name)`{next}` 1171 # dirs bool (default 0)`{next}` 1172 # numparms string (default *)`{next}` 1173 # nomultiple bool (default 0)`{next}` 1174 # prior bool (default 0)`{next}` 1175 # viewout bool (default 0)`{;next}` 1176 # }`{in 0;in 1 29;next;in 0}` 1177 # 1178 # The name is what ever string of numbers and letters, excluding spaces 1179 # you would like.`{in 1 8}` It is recommended that it be close to the string 1180 # used for the label.`{next;in 0}` 1181 # The <label> should be no more than 10 alphnumeric characters. 1182 # It should not include`{in 1 8}` 1183 # $[{"} ]. It must be enclosed in curly braces ({}) if 1184 # it includes spaces.`{next;in 0}` 1185 # The dirs bool indicates the command can handle directories`{in 1 8}` 1186 # (1) or not (0).`{next;in 0}` 1187 # The numparms entry should be one of {* n ==n <n >n} where:`{next;in 1 8}` 1188 # "*" means any number of parameters`{next}` 1189 # n or ==n means exactly "n" parameters`{next}` 1190 # <n means less than "n" parameters`{next}` 1191 # >n means greater than "n" parameters`{next;in 0}` 1192 # The no multiple flag (deprecated) should be set to 1 if the command should be 1193 # called with only one file.`{in 1 8;next;in 0}` 1194 # The prior flag, if true, includes files from the prior selection. 1195 # This means you can select files from both panes.`{in 1 8;next;in 0}` 1196 1197 # Note: The total number of selected files is checked against "numparms". If the 1198 # "prior" flag is true, the prior selection (same pane or opposite) is included 1199 # in the count, if false, they are not. In general you should set the "prior" flag 1200 # to 0 (false) unless you really need to include files from both panes. 1201 1202 # The viewout flag indicates that the output of the command 1203 # should be put in a "View" window.`{in 1 8;next;in 0}` 1204 # 1205 # These dublets may appear in any order and the key words 1206 # (command label dirs nomultiple and viewout may be abbreviated. 1207 # Only command is required. You may also refer to the following $vars in 1208 # the 'command' entry:`{next;in 1 8}` 1209 # $pwd is the directory of the selected file(s)`{next}` 1210 # $opwd is the directory of opposite pane`{next;in 0}` 1211 1212 # Here is an example for an editor that can handle 1213 # directories and multiple files: 1214 # 1215 # set config(userButton,emacs) {`{next}` 1216 # com {emacsclient --no-wait %s}`{in 1 32;next}` dir 1`{next;in 0}`}`{in 1 30}` 1217 # 1218 # `{in 0}`And here is one to stream a file (or a directory full of files audio or video) 1219 # via "VLC" to a chromecast device (such as the google mini) (note that the "command" 1220 # line wraps, i.e.: 1221 # 1222 # set config(userButton,cast) {`{next}` 1223 # com {vlc %s --sout "#chromecast" --sout-chromecast-ip=10.235.7.80 1224 #--demux-filter=demux_chromecast &}`{in 1 32;next}` 1225 # dir 1 1226 # label google1 1227 # } 1228 1229 } 1230 AddConf $fid {config userButton,*} "" { 1231 # Currently defined user Buttons: 1232 1233 } 1234 putsTrim $fid { 1235 #****** HTTP CONFIGURATION `{fill *}` 1236 } 1237 1238 AddConf $fid config(http,proxy) "" { 1239 # HTTP proxy. Format: host:port (for example: proxy.foo.com:80). 1240 # Leave empty if you have a direct connection to the net. 1241 } 1242 1243 putsTrim $fid { 1244 #****** APPEARANCE - COLORS `{fill *}` 1245 1246 # Except for the first two items (gray and middle button color) the colors 1247 # are more easily edited from the Configuration->Color Edit Menu. 1248 } 1249 1250 AddConf $fid config(gray) "" { 1251 # The color gray is spelled grey in some places. If you put your favorite 1252 # spelling here, we promise to use that spelling when offering up color 1253 # names that contain gray/grey. Note that all named color values that have 1254 # gray in their names are duplicates of those with grey in their names (and 1255 # vice versa) so we need contend with only one spelling. 1256 } 1257 AddConf $fid config(middle_button_colors) "" { 1258 # This contains a list of background colors for the middle row command 1259 # buttons. The syntax is: 1260 # set config(middle_button_colors) { 1261 # { ButtonName [-]Color } 1262 # ... 1263 # } 1264 # An example: 1265 # set config(middle_button_colors) { 1266 # { Copy #0000ff } 1267 # { Delete yellow } 1268 # { Delete -red } 1269 # { Move -red } 1270 # } 1271 # The Copy button inactive color will be blue and the Delete button 1272 # will be yellow. The Move and Delete buttons will turn red only when they 1273 # are active i.e. when the mouse moves over them. Buttons not mentioned 1274 # will get the default scheme color. 1275 # 1276 # Note: Since choosing an inactive color will automatic choose a lighter 1277 # 'active' color, if you want to choose both an inactive and an active 1278 # color for the same button, you should arrange this list to put the 1279 # 'active' color for the same button after the inactive color for it. 1280 } 1281 1282 AddConf $fid {config gui*,color_bg} "" { 1283 # `{ifThis {$::MSW} {For each entry starting with "config(gui" there are two 1284 # entries, the "config(gui,*)" entry and the "config(guiE,*)" entry. The values 1285 # for the "guiE" entries are used when filerunner is run in "elevated" mode and 1286 # the "gui" values are used in "normal" mode. This is to allow a distinctive 1287 # appearance in elevated mode.}}` 1288 1289 # Background color of listboxes etc. 1290 # You can edit this easier from the configuration menu. 1291 } 1292 1293 AddConf $fid {config gui*,color_fg} "" { 1294 # Foreground color of listboxes etc. 1295 # You can edit this easier from the configuration menu. 1296 } 1297 1298 AddConf $fid {config gui*,color_cmd} "" { 1299 # Color for commands in the command window. 1300 # You can edit this easier from the configuration menu. 1301 } 1302 1303 AddConf $fid {config gui*,color_select_bg} "" { 1304 # Selection background color. 1305 # You can edit this easier from the configuration menu. 1306 } 1307 1308 AddConf $fid {config gui*,color_select_fg} "" { 1309 # Selection foreground color. 1310 # You can edit this easier from the configuration menu. 1311 } 1312 AddConf $fid {config gui*,color_highlight_bg} "" { 1313 # Highlight background color. This is the color of the last 1314 # selection and is the second argument for the diff command. 1315 # You can edit this easier from the configuration menu. 1316 } 1317 1318 AddConf $fid {config gui*,color_highlight_fg} "" { 1319 # Highlight foreground color.This is the color of the last 1320 # selection and is the second argument for the diff command. 1321 # You can edit this easier from the configuration menu. 1322 } 1323 1324 AddConf $fid {config gui*,color_handle} "" { 1325 # The 'handle' color is the color of the 'handles' that allow 1326 # you to change the size of the listbox columns. 1327 # You can edit this easier from the configuration menu. 1328 } 1329 1330 AddConf $fid {config gui*,color_scheme} "" { 1331 # Scheme color. 1332 # Default Tk seems to be "grey85". 1333 # You can edit this easier from the configuration menu. 1334 } 1335 1336 AddConf $fid {config gui*,color_cursor} "" { 1337 # Cursor color. 1338 # You can edit this easier from the configuration menu. 1339 } 1340 1341 AddConf $fid {config gui*,color_flash} "" { 1342 # Flash color is used in command completion messages as 1343 # well as in search messages in view windows and the 1344 # command windows. 1345 1346 # You can edit this easier from the configuration menu. 1347 } 1348 1349 AddConf $fid {config gui*,color_balloonHelp_fg} "" { 1350 # Balloon Help foreground color. 1351 # You can edit this easier from the configuration menu. 1352 } 1353 AddConf $fid {config gui*,color_balloonHelp_bg} "" { 1354 # Balloon Help background color. 1355 # You can edit this easier from the configuration menu. 1356 } 1357 putsTrim $fid { 1358 #****** APPEARANCE - FONTS `{fill *}` 1359 } 1360 AddConf $fid {config gui*,ListBoxFont} "" { 1361 # Font for listboxes etc. Must be fixed-width. 1362 # A good choice is "TkFixedFont" 1363 # You can edit this easier from the configuration menu. 1364 } 1365 1366 AddConf $fid {config gui*,GuiFont} "" { 1367 # Font for default Tcl/Tk stuff (menus, buttons etc.) 1368 # Set this to "TkDefaultFont" in order to not change from what it already is. 1369 # You can edit this easier from the configuration menu. 1370 } 1371 1372 AddConf $fid {config gui*,BalloonHelpFont} "" { 1373 # Font for Balloon Help text 1374 # Set this to "TkTooltipFont" in order to not change from what it already is. 1375 # You can edit this easier from the configuration menu. 1376 } 1377 1378 putsTrim $fid { 1379 #****** APPEARANCE - DIRECTORY - OTHER `{fill *}` 1380 } 1381 AddConf $fid config(ListBoxColumns,right) "2" { 1382 # This structure defines the listbox layout. The three parts are: 1383 # The window name (never never NEVER change this), 1384 # the window width, 1385 # and the window label. 1386 # You may change the label and the width, but the width is easier to 1387 # change by dragging the label separator in the window. 1388 # 1389 # Also, the order is the order the sub windows appear. This you may change, 1390 # but, again, it is easier to drag the label in the window to do the same thing. 1391 # 1392 # Note: the '[_ text ]' below tells the localize routine to replace the 1393 # 'text' with a local version. While this should be this way for the disto, 1394 # feel free to eliminate the [_' and the ']'. 1395 # 1396 # You can add and delete entries form the list, however, the first part 1397 # (the window name) must come from the 'config(ListBoxScripts)' (see below 1398 # two entries down), so if you add and new script, you can then refer to 1399 # it in this list. Also, a given 'window name' may only be used once in 1400 # each of the list boxes. 1401 } 1402 AddConf $fid config(ListBoxColumns,left) "2" { 1403 # This is the same as above but for the left listbox. Usually they will be 1404 # the same, but that is not required. 1405 } 1406 AddConf $fid config(ListBoxScripts) "2" { 1407 # This is list of scripts that filerunner will use to format column entries 1408 # in the directory list boxes. This is here to allow you to add new columns. 1409 # Each column window is filled with the info provided by the script. The 1410 # following variables are available for this script: 1411 # $file file name (without the directory part)`{next}` 1412 # $ffile file name with the '@' and '/' tags attached`{next}` 1413 # $dir directory name`{next}` 1414 # $type file type (n normal, d directory, l normal link, ld directory link) 1415 # FTP file types are the same as above with a leading 'f'`{in 1 8;next;in 0}` 1416 # $size file size`{next}` 1417 # $mtime, $ctime, $atime The modify, create and access times for the file`{next}` 1418 # $mode file mode in wrx format`{next}` 1419 # $usergroup files owner ship`{next}` 1420 # $link link name or blank`{next}` 1421 # `{ifThis {$::MSW} {# $nlink The 1422 # short file name if 'DIR' option on (see useDir below)`{next}`} { 1423 # $nlink The number of links in the files dir entry`{next}`}}` 1424 # $inst either 'left' or 'right', indicates the file list pane`{next}` 1425 1426 # Please note that these entries are live. If you mess them up it is possible 1427 # or even likely that filerunner will not run. Do keep a back up config file 1428 # if you plan to tread here. `{ifThis {$::MSW} {As shipped, 1429 # there are two entries that will do the 8X3 name, 'short' and 'shortDIR'. 1430 # For filerunner versions after 17.09.xx.xx 'shortDir' has been removed as the 1431 # '/x' feature of 'DIR' loses link information as a side effect. 1432 # The 'short' entry will always work. (See the note at the head of this 1433 # listing for information on how to restore an entry to the 'as shipped' 1434 # version.)}}` 1435 } 1436 1437 putsTrim $fid { 1438 #****** APPEARANCE - SIZE - LOCATION `{fill *}` 1439 # These options control the size and location of "view" windows, including the "error" 1440 # window, and windows created for some commands (Diff, Find, etc.). (Some terminology: 1441 # "Screen" refers to the total display area which may be on more than one physical device. 1442 # "Monitor" refers to a physical device. "Monitor workarea" refers to the Monitor less 1443 # any docked windows (such as task bars or panels).) 1444 # 1445 # New windows will always be displayed on the monitor containing the mouse (or the one 1446 # the mouse is nearest to). 1447 # 1448 } 1449 1450 AddConf $fid config(geometry,main) "" { 1451 # The X11 geometry string deciding where and how big the Filerunner 1452 # main window should be at start up. This size will always be used, 1453 # however the location depends on the following (geometry,mainops). 1454 } 1455 1456 AddConf $fid config(geometry,mainops) "" { 1457 # This option specifies how the "geometry,main" above is to be interpreted. 1458 # This is primarily for those who have more than one monitor. 1459 # (MCM means "Monitor Containing the Mouse").`{next}` 1460 1461 # Value What it means `{next}` 1462 # absolute Use "geometry,main" exactly as it is.`{next}` 1463 # relative Use "geometry,main" as the relative location in the MCM`{next}` 1464 # center Center in the MCM`{next}` 1465 # random The window will be put where ever Tk puts it. 1466 # 1467 # Filerunner "as shipped" value is "absolute". Only the first letter is 1468 # checked on these options and "absolute" is the fall back. 1469 } 1470 1471 AddConf $fid config(geometry,textviewer) "" { 1472 # The X11 geometry string deciding where and how big the Filerunner 1473 # text viewer window should be. 1474 } 1475 1476 AddConf $fid config(geometry,qedit) "" { 1477 # The X11 geometry string deciding where and how big the Filerunner 1478 # quick-editor window should be. 1479 } 1480 AddConf $fid config(geometry,max) "" { 1481 # This sets the maximum width and height of the "view" windows. 1482 # Syntax is "width option" x "height option". The width and height option part 1483 # consist of a key <string><number> except "fixed" which may or may not have 1484 # a number. If "fixed" has no number the width/height is taken from 1485 # "config(geometry,textviewer)" Spaces are optional. If the height part 1486 # is missing or null, the width option is used by default. Only the first character 1487 # is checked in the key. 1488 # The three options are:`{next}` 1489 # 1490 # option key number`{next}` 1491 # percent of "available workarea" : availablewa number`{next}` 1492 # percent of "main window" : mainw number`{next}` 1493 # fixed : fixed number`{next}` 1494 # 1495 # Where "numbers" indicate the percentage except for fixed where it is 1496 # the number of pixels. Percentages and may range from 10 to 150, but all 1497 # windows will be constrained (at least on 1498 # creation) to fit in the "monitor workarea". For example:`{next}` 1499 1500 # set config(geometry,max) a50`{next}` 1501 # set config(geometry,max) a50xmainw75`{next}` 1502 # set config(geometry,max) fixed`{next}` 1503 # set config(geometry,max) {mainw 50 x avail 50}`{next}` 1504 # 1505 # The braces are only needed if spaces are used. 1506 1507 1508 } 1509 AddConf $fid config(geometry,min) "" { 1510 # This sets the minimum width of the "view" windows. The syntax is the same as 1511 # the max option above, however, the option key words differ:`{next}` 1512 # 1513 # option key number`{next}` 1514 1515 # percent of actual maximum line length: percent number`{next}` 1516 # percent of actual number of lines : percent number`{next}` 1517 # actual maximun line length plus "n" : addspace number`{next}` 1518 # actual number of lines plus "n" : addlines number`{next}` 1519 # fixed : fixed number`{next}` 1520 # 1521 # Again only the first letter of the option is checked. The difference 1522 # between adding spaces or lines depends on the option being before the "x" 1523 # (spaces) or after the "x" (lines). 1524 # If the minimum line length gives a window wider than the "max" width, the "max" 1525 # width is used. 1526 1527 # For example:`{next}` 1528 1529 # set config(geometry,min) a5 adds 5 spaces to width and 5 lines`{next}` 1530 # set config(geometry,min) a5xa2 adds 5 spaces to width and 2 lines`{next}` 1531 # set config(geometry,min) fixed use widthxheight from geomerty,textvew`{next}` 1532 # set config(geometry,min) {percent 105 x addlines 2}`{next}` 1533 # 1534 # The braces are only needed if spaces are used. 1535 1536 } 1537 AddConf $fid config(geometry,location) "" { 1538 # This sets the location of the new window. All windows are 1539 # constrained to be completely in the "available monitor area" containing the 1540 # mouse. There are five options on the Y location and 1541 # four options on the X location of a new window: 1542 1543 # Y options`{next}` 1544 # centered on the main window : cmw`{next}` 1545 # centered in the "monitor workarea" : cama`{next}` 1546 # on left/above "monitor workarea" : left`{next}` 1547 # on right/below "monitor workarea" : right`{next}` 1548 # tiled (starts at fixed Y) : tiled`{next}` 1549 # random{fixed} : random`{next}` 1550 # fixed(by config(geometry,textviewer)) : fixed`{next}` 1551 # 1552 # X options`{next}` 1553 # same as Y options 1554 # 1555 # These options are to be combined as X Y, for example: 1556 # set config(geometry,location) {right fixed} 1557 1558 } 1559 putsTrim $fid { 1560 #****** APPEARANCE - WINDOWS `{fill *}` 1561 } 1562 AddConf $fid config(columnScroll) "" { 1563 # This controls the position of the column scroll bar. Possible values are: 1564 # 0 No column scroll bar. 1565 # 1 Top of the column 1566 # 3 Bottom of the column 1567 # You can also pull the windows left & right with the mouse. 1568 } 1569 AddConf $fid config(columnScrollSize) "" { 1570 # This sets the thickness of the column scroll bar. Recommended size is 8. 1571 # The other scroll bars are sized at 11. This size affects the minimum 1572 # column width (must be wide enough to contain the two end arrows). 1573 } 1574 1575 1576 AddConf $fid config(middle_button_list) "2" { 1577 # This is a list of the middle buttons in the order they will be 1578 # presented. User defined buttons will be added automatically at the 1579 # end if they are not already in the list. A button may be disabled by 1580 # appending "d". (A side note, chmod can be used in some ftp connections 1581 # even in MS windows systems.) 1582 # Feel free to reorder this list. Syntax is:`{next}` 1583 # {ButtonName} or ButtonName if on a separate line and no spaces`{next}` 1584 # or {ButtonName d} for a disabled button`{next}` 1585 # or {{Button Name} d} if there are spaces in the name. 1586 } 1587 1588 putsTrim $fid { 1589 #******* SHELL CONFIGURATION *`{fill *}` 1590 } 1591 1592 AddConf $fid config(shell,height,left) "" { 1593 # Height in lines of text of the left shell text window. 1594 } 1595 1596 AddConf $fid config(shell,height,right) "" { 1597 # Height in lines of text of the right shell text window. 1598 } 1599 1600 AddConf $fid config(shell,buffer) "" { 1601 # Size of shell buffer, in lines of text. 1602 } 1603 1604 AddConf $fid config(shell,aliases) "2" { 1605 # Shell aliases, in the form of a list of doublets:`{next}` " { alias, command } .. " 1606 # If there are arguments to the command line they are just tagged onto the 1607 # alias. (I.e, aliases can take arguments) 1608 } 1609 1610 putsTrim $fid { 1611 #****** MISC CONFIGURATION `{fill *}` 1612 } 1613 1614 AddConf $fid config(startpwd,left) "" { 1615 # At start up, show this directory in the left panel. 1616 # If you set it to "", Filerunner will show the working directory when 1617 # it was invoked. If you put "~/" it will show the home directory. 1618 # If this is a file Filerunner will show its directory and 1619 # highlight that file. 1620 } 1621 1622 AddConf $fid config(startpwd,right) "" { 1623 # At start up, show this directory in the right panel 1624 # If you set it to "", Filerunner will show the working directory when 1625 # it was invoked. If you put "~/" it will show the home directory. 1626 } 1627 1628 AddConf $fid config(fileshow,all) "" { 1629 # 1 -> Will show hidden files.`{next}` 1630 # 0 -> Won't. 1631 } 1632 1633 AddConf $fid config(fast_checkboxes) "3" { 1634 # You can configure check boxes to appear on the top menu bar. The following 1635 # are available. You may sort these to get them to appear in your desired 1636 # order. Change the "d" to "Y" to get the box to appear. The second item 1637 # in each entry is the value to use as a label for the check box. Feel 1638 # free to edit the label or even eliminate it (by using {}). (Balloon help 1639 # will still tell you what the box does.) The Help messages appears here to 1640 # help you understand what each one does. If you move an entry, be sure to 1641 # move the whole entry, including the Help message. Deleted entries will 1642 # automatically be added to the end of the list. You may delete all of them 1643 # to get a fresh list in the "shipped" order. 1644 } 1645 set width 0 1646 foreach ent $config(fast_checkboxes) { 1647 lassign $ent first second 1648 set width [expr max($width,[string length "$first $second"]) ] 1649 } 1650 foreach ent $config(fast_checkboxes) { 1651 set mes [lassign $ent first second flag] 1652 set sp [string repeat " " \ 1653 [expr {$width - [string length "$first $second"]} ]] 1654 puts $fid " \{{$first} {$second} $sp $flag" 1655 set mes [regsub -all {\n} $mes { }] 1656 set mesr [regsub -all { +} $mes { }] 1657 set f 0 1658 set l "end" 1659 while {[string length [string range $mesr $f $l]] > $width} { 1660 set pt [string last " " [string range $mesr $f $l] $width] 1661 set mesr [string replace $mesr $pt+$f $pt+$f "\n "] 1662 #puts "$f $mesr" 1663 set f [expr {$f + $pt +7}] 1664 } 1665 puts $fid " $mesr\}" 1666 } 1667 puts $fid " \}\n" 1668 1669 1670 AddConf $fid config(balloonhelp) "" { 1671 # 1 -> Will enable balloon help`{next}` 1672 # 0 -> disables balloon help. 1673 } 1674 1675 AddConf $fid config(positiondirs) "" { 1676 # 1 -> Will 'show' directories when typing a character in to a selected 1677 # directory panel.`{in 1 5;next;in 0}` 1678 # 0 -> Will 'show' files when typing a character in to a selected 1679 # directory panel.`{in 1 5;next;in 0}` 1680 # By 'show' is meant that the panel is scrolled so that files (or directories) 1681 # that start with the typed character will visible. 1682 } 1683 1684 AddConf $fid config(focusFollowsMouse) "" { 1685 # 1 -> Will enable focus following mouse`{next}` 1686 # 0 -> disables focus following mouse (requires restart of filerunner). 1687 } 1688 1689 AddConf $fid config(fileshow,dirs) "" { 1690 # This variable determines how file listings are sorted. Possible values 1691 # are "dirsfirst", "dirslast", "mixed" This is most easily changed with the 1692 # configuration menu. 1693 1694 } 1695 1696 AddConf $fid config(fileshow,sort) "" { 1697 # This variable determines what file listings are sorted on. Possible values 1698 # are:`{next;in 1 8}` "nameonly", "atime", "ratime", ctime", "rctime", mtime", 1699 # "rmtime", "size" and "extension"`{next;in 0}` 1700 # atime is access time, ctime is creation time, mtime is modify time 1701 # the r suffex means reverse. 1702 # This is most easily changed with the configuration menu. 1703 1704 } 1705 1706 AddConf $fid config(sortoption) "" { 1707 # This variable determines how file listings are sorted. Possible values 1708 # are "-ascii", "-nocase" and "-dictionary". This is most easily changed 1709 # with the configuration menu. Ascii and nocase should be clear. Dictionary 1710 # extends "nocase" such that if two names contain embedded numbers the numbers 1711 # compare as integers, not characters. For example, in dictionary mode, 1712 # bigBoy sorts between bigbang and bigboy, and x10y sorts between x9y and x11y. 1713 1714 } 1715 1716 AddConf $fid config(dateformat) "" { 1717 # Sets date format. Possible values:`{next}` 1718 # "yymmdd" and "ddmmyy". (yy=year mm=month dd=day) 1719 # You can also roll your own with:`{next}` 1720 %d 2 digit day %T (same as %H:%M:%S)`{next}` 1721 %m 2 digit month %D (same as %m/%d/%Y)`{next}` 1722 %y 2 digit year %y 4 digit year`{next}` 1723 %H 2 digit hour`{next}` 1724 %M 2 digit minute`{next}` 1725 %S 2 digit second`{next}` 1726 # For example "%y%m%d %H:%M:%S" which is the same as "yymmdd" above. 1727 # The % values come from the tcl "clock" manpage. 1728 } 1729 1730 AddConf $fid config(autoupdate) "" { 1731 # Sets how often Filerunner checks to see if it needs to update its 1732 # windows. 1733 # Set this to 0 to disable. Value is in seconds. 1734 } 1735 1736 AddConf $fid config(inotify_rate_limit) "" { 1737 # Sets minimum amount of time between window updates when using inotify 1738 # (see below). This allows a trade off of prompt updates vs system load. 1739 # Value is in seconds. 1740 } 1741 AddConf $fid config(inotify_flags) $inotFm { 1742 # These flags control what 1743 # events will cause filerunner to update its directory listing(s). This 1744 # update is nearly immediate, however, this requires 'some' overhead. You 1745 # can remove some or all of these flags to reduce the overhead. 1746 # There are 1747 # two sets of flags, the local ones (inotify_flags) and the non-local ones 1748 # (inotify_nlflags). Due to network overhead it is recommended that you 1749 # use a more restricted (even to nill, i.e. {}) for non-local file systems. 1750 # `{ifThis {!$::MSW} { 1751 # This is particularly true for the 'r', 'w', 'a' and 'o' flags. 1752 # The flags have the following meanings:`{next;in 1 5}` 1753 # n File was created.`{next}` 1754 # r File was read from.`{next}` 1755 # w File was written to.`{next}` 1756 # a File's meta-data (inode or xattr) was changed.`{next}` 1757 # C File was closed (and was open for writing).`{next}` 1758 # c File was closed (and was not open for writing).`{next}` 1759 # o File was opened.`{next}` 1760 # m File was moved away from watch.`{next}` 1761 # M File was moved to watch.`{next}` 1762 # d File was deleted.`{next;in 0}` 1763 # 'r','w','a','C','c' and 'o' cause just the files line in the window 1764 # to be updated while the others require a full reread and display of 1765 # the directory.} {The flags consist of a list of doublets where the 1766 # second entry is boolean (0 or 1) The first entries and their meanings are: 1767 # `{next;in 1 5}` 1768 # -access Changes to the last access time are watched`{next}` 1769 # -attr Attribute changes are monitored`{next}` 1770 # -create Changes to create time are monitored`{next}` 1771 # -dirname Directory name changes (including creation and deletion)`{next}` 1772 # -filename File name changes (including creation and deletion)`{next}` 1773 # -size Size changes are monitored`{next}` 1774 # -write Changes to write time are monitored`{next}` 1775 1776 # You should only change the boolean values. 1777 # Changes that affect only the file size and times will cause only the 1778 # files line in the window to be updated while other changes require 1779 # a full reread and display of the directory.}}` 1780 } 1781 AddConf $fid config(inotify_nlflags) $inotFm { 1782 # The inotify_nlflags are the same as above but are used on directories 1783 # that are not local (nfs or cifs). Due to network overhead you will 1784 # usually not want to be as aggressive with the Non Local flags. 1785 } 1786 1787 AddConf $fid config(logsize) "" { 1788 # Size of log in bytes. Don't set this too high, or Filerunner might 1789 # slow down a little. When the log exceeds this size, it will be 1790 # truncated. 1791 } 1792 1793 AddConf $fid config(check_ownership) "" { 1794 # If this is "1", Filerunner will check as best as it can if you are 1795 # about to overwrite or delete a file you do not own and warn you about 1796 # it. This can be handy when working in groups with other people and you 1797 # want an extra check that you don't accidentally erase someone else's 1798 # files. This will slow some operations down slightly. 1799 } 1800 1801 AddConf $fid config(keyb_support) "" { 1802 # If this is 1, it enables short-cut 1803 # characters for most of the middle buttons which will have their short-cut 1804 # character underlined. 1805 1806 # In addition (once a directory pane has focus) you can use the keyboard 1807 # arrow keys and PgUp/PgDown to traversing the list. 1808 1809 # Turning 1810 # this on eliminates the "jump to files that start with this char" 1811 # ability when focus is in a directory pane. 1812 } 1813 1814 AddConf $fid config(ask,dir_delete) "" { 1815 # If 1, Filerunner will ask you if you are sure when you delete 1816 # directories. If 0, it will go ahead and delete without asking. 1817 # This flag is used by the 'Move', 'Copy' and 'Rename' commands. 1818 } 1819 1820 AddConf $fid config(ask,file_delete) "" { 1821 # If 1, Filerunner will ask you if you are sure when you delete 1822 # files. If 0, it will go ahead and delete without asking. 1823 # This flag is used by the 'Move', 'Copy' and 'Rename' commands. 1824 } 1825 AddConf $fid config(ask,save_modified_file) "" { 1826 # If exiting a view window with no file association (for example after 1827 # viewing a programs output) that you have modified, this option, 1828 # if set to 1, will cause filerunner to ask if you wish to save the 1829 # modified data. Filerunner will always ask if a modified view window 1830 # has an associated file. 1831 } 1832 AddConf $fid config(mwheel,delta) "" { 1833 # For "wheel"-mice (MS Intellimouse or Logitech MouseMan+), set 1834 # number of lines to scroll when turning mouse wheel. 1835 } 1836 1837 AddConf $fid config(mwheel,neg) "" { 1838 # For "wheel"-mice (MS Intellimouse or Logitech MouseMan+), set 1839 # mouse button to use for negative scroll movement. 1840 } 1841 1842 AddConf $fid config(mwheel,pos) "" { 1843 # For "wheel"-mice (MS Intellimouse or Logitech MouseMan+), set 1844 # mouse button to use for positive scroll movement. 1845 } 1846 1847 AddConf $fid config(save_conf_at_exit) "" { 1848 # If true (non-zero): Filerunner will automatically save configuration and 1849 # hotlist at exit. 1850 } 1851 1852 AddConf $fid config(create_relative_links) "" { 1853 # If true (non-zero): Filerunner will create relative links 1854 # instead of absolute links. (e.g ../../foo instead of 1855 # /a/b/c/foo)`{ifThis {$::MSW} { 1856 # Windows (NTFS) only allows 1857 # absolute links, thus absolute is forced.}}` 1858 } 1859 1860 AddConf $fid config(cd_pwd) "" { 1861 # If true (non-zero): When doing a cd to a new directory, Filerunner 1862 # will run pwd to check where it ended up (which makes a difference 1863 # if you cd to a link which points to a directory). 1864 } 1865 1866 AddConf $fid config(spellingFilter) "2" { 1867 # The spelling filter chooses what part of a line is spell checked when 1868 # you spell check in "View" and "Q-Edit" windows. In the entries below the 1869 # filter name is first and is followed by the filter script. You may add 1870 # your own filter to this list (see the "Users Guide" for help on this). 1871 # Several filters are provided and may be configured here. 1872 1873 # Provided filters: 1874 # 1875 # {} This is the default filter and causes the whole line to be checked. 1876 # This is the {None {}} entry below.`{in 1 10;next;in 0}` 1877 # 1878 # qstrings This filter can be configured to look for two types of strings: 1879 # `{in 1}`Single lines (such as "# line" or "// line") as some 1880 # languages use. 1881 # And strings that have start and end quote marks which may be 1882 # 1 to N lines long. E.g. "string" and "/* string */" 1883 # 1884 # qstrings takes two parameters (as well as the string and line 1885 # number that the spell check code supplies):`{next}` 1886 # First, the beginning and ending quote strings, e.g.`{next}` 1887 # {\" \"} or {/* */}`{in 1 5;next;in 0}` 1888 # Second, the single line start quote string, e.g.`{next}` 1889 # {#} or {//}`{in 1;next;in 0;in 0}` 1890 # 1891 # thisstr This filter takes, as a parameter, another filter and selects 1892 # one of the the strings as the string to check.`{in 1}` 1893 # This might be used 1894 # if you want to spell check a translation list where the 1895 # original and the translation are two stings on the same line 1896 # and you want to only check the first or second string. 1897 # For example {thisstr 1 {qstrings {\" \"} {}}} would check the 1898 # second string (use 0 for the first string). 1899 } 1900 1901 AddConf $fid config(spellcheck,expect) "" { 1902 # This Boolean, if 1 forces spell check to use "expect" to interact with 1903 # the spelling program. Normally "expect" is required only on Windows 1904 # platforms. 1905 } 1906 1907 AddConf $fid config(search,limit) "" { 1908 # This value limits the number of search strings saved for use in the 1909 # search dropdown list. This is used in the search option in 'view', 1910 # 'Q-Edit', 'Configuration Browser' (this window) and the 'Command' windows. 1911 # The search code manages this list to keep it in order of recent use 1912 # and deletes duplicates. 1913 } 1914 AddConf $fid config(search,ViewEditStrings) 2 { 1915 # This is the list of saved search lines for 'View' and 'Q-Edit' windows. 1916 # This is here to save it from one run of filerunner to the next. You may 1917 # delete one or more (or all) entries. The first characters may encode 1918 # the "casefold" and "regular expression" options. Filerunner recognizes the 1919 # following: ~CF~ ~RE~ and ~CFRE~ to turn on one or both options. Anything 1920 # else is treated as a normal string with neither "casefold" nor 1921 # "regular expression" active. 1922 } 1923 AddConf $fid config(search,CmdConfStrings) 2 { 1924 # These are the saved search strings for the 'Command' and 'Configuration 1925 # Browser' windows. See above for more info on managing these. 1926 } 1927 AddConf $fid config(manualMonitors) "" { 1928 # If this is true (i.e. 1) the "monitors" prob will only be done by command from the 1929 # "Utilities" menu. This will prevent the flashing the prob causes on systems 1930 # that don't support transparent windows. This need only be called when a 1931 # monitor is added or removed from the system or when a "panel" is added, removed 1932 # or changed in size or location." 1933 } 1934 AddConf $fid config(monitors) 2 { 1935 # The "monitors" list is a list, by display, of the "workarea" of each 1936 # monitor. This is compiled each time filerunner starts and is placed here 1937 # so that it is available at start time (to position the main window). FYI each 1938 # display has a sub list for each monitor containing {minx maxx miny maxy}. 1939 1940 } 1941 AddConf $fid config(DisplayName) "doubles" { 1942 # The "Display Name" is a list of directories and the name to display 1943 # (mostly in the directory line at the top of each panel). Each entry is a 1944 # pair of values where the first is the directory and the second is the 1945 # name to display. This is mainly used to handle VFS directories, but 1946 # you may want to add your own. It is here so that it is saved and 1947 # restored when filerunner exits and is restarted. Display names must 1948 # be unique and the directories must be "absolute". The syntax is just 1949 # 'config(DisplayName) {dir1 name1 dir2 name2... }' As usual, any spaces 1950 # require you to put braces around the dir or name, as needed. The 1951 # "as shipped" entry here is for <volume> which is the nil ("") directory. 1952 # Display Names are automatically put in the HotList as well as displayed 1953 # in the dir list for the nil directory. 1954 } 1955 AddConf $fid config(DisplayNameShare) "" { 1956 # This config entry describes a "format" statement that is used to build 1957 # "Display Names" for mapped shares. A share looks like: `{next}` 1958 # 1959 # \\server\share 1960 # 1961 # Which is what is displayed for unmapped shares. Mapped shares are 1962 # shares that have 1963 # `{ifThis {$::MSW} {been mapped to a "drive letter:" such as "Z:".} { 1964 # a mount point (found in fstab, mtab, or autofs files).}}` 1965 # As shipped this is set to map such shares as follows:`{next}` 1966 # 1967 # share(\\server)(`{ifThis {$::MSW} {drive} {mount-point}}`) `{next}` 1968 # using: format {%s(\\%s)(%s)} $share $server `{ifThis {$::MSW} {$drive} {$mp}}` 1969 # 1970 # `{ifThis {$::MSW} {where "drive" is the drive letter followed by a ":".} 1971 # {where "mp" is the mount point.}}` 1972 # You may set this configuration to "{}" (nil) which will cause filerunner 1973 # to use the as shipped format, 1974 # or you may define a format command. 1975 # The following variables are available:`{next}` 1976 # 1977 # $share the shares name`{next}` 1978 # $server the servers name`{next}` 1979 # `{ifThis {$::MSW} {$drive the "drive letter:"} {$mp the mount point}}``{next}` 1980 # 1981 # You should not use a single "/" in the name (but "//" is ok) (filerunner uses 1982 # the single "/" to find the end of Display Names). A format statement contains 1983 # the word "format" followed by a format string followed by the variables to 1984 # replace the "%s"s in the format string. Within the format string you may 1985 # use most any character (except the single "/") however "\" needs to be 1986 # escaped (i.e. "\\"). 1987 } 1988 1989 putsTrim $fid { 1990 #****** DANGEROUS CONFIGURATION `{fill *}` 1991 # Below this point you can change some of the stuff that is used 1992 # internally by Filerunner. This should almost never be necessary if the 1993 # platform is standard Unix or close to standard Unix. If you change any 1994 # of this below, make very very sure you get it right. You might want to 1995 # make a backup just to be safe. 1996 } 1997 putsTrim $fid "(This file is \"$::glob(configFile)\".)" 1998 putsTrim $fid { 1999 # A note on having the full path to the commands below, like using 2000 # "/bin/cp" and not just "cp": Lets say you have a dot "." in your path 2001 # and someone really mean has created a command called "cp" in his home 2002 # directory that does a "rm" instead. Then you cd to his home directory 2003 # and type cp <something>, you will invoke his evil manipulated version 2004 # of cp that removes whatever you intended to copy. The morale of this is 2005 # to always use full path to critical commands and hope your sysop is 2006 # not so mean he will rename "/bin/rm" to "/bin/mkdir"... 2007 # A few commands below do not have specified full path, that's because 2008 # they aren't very critical and seem to move around between different 2009 # versions of Unix. 2010 } 2011 AddConf $fid config(cmd,sh) "" { 2012 # `{ifThis {$::MSW} { 2013 # With out CYGWIN you can use 'cmd /C' (which is the default). You can 2014 # also set this to null (i.e. {}) to use the 2015 # filerunner command line handler. This command line handler will run most anything 2016 # that 'cmd /C' can plus it handles *nix files that start with '#! <file>' 2017 # as the first line. This depends on <file>s directory being in the %PATH% 2018 # (but it may be in any directory on the path, not just the one in <file>). 2019 # This command line handler will also expand wild card characters in the 2020 # command. The syntax for these is the tcl 'glob' syntax (ask google for 2021 # the "tcl glob man page"). 2022 # } { 2023 # The bourne-shell command. This should almost always be /bin/sh. 2024 # If an option (such as '-c') is needed to execute a command in the 2025 # command line, it should be here (for example '/bin/sh -c').}}` 2026 } 2027 2028 AddConf $fid config(cmd,cp) "" { 2029 # The cp (copy-files) command. You use the internal Tcl file copy routine 2030 # by making this empty ({}). `{ifThis {! $::MSW} { 2031 # Otherwise this should almost always be /bin/cp 2032 # on Unix/Linux systems. 2033 # The 'pfr' switches should be here (i.e. 'cp -pfr')`{next;in 1 5}` 2034 # (p->preserve times/owner)`{next}` 2035 # (f-> force overwrite)`{next}` 2036 # (r-> if dir, copy recursively)`{next;in 0}` 2037 # DON'T put the -i switch to cp here to get Filerunner to display 2038 # a warning for overwriting a file when copying a file. It won't 2039 # work and will only make it behave unpredictably.} { 2040 # Otherwise 'xcopy' works fine. 2041 # Default is with switches:`{next}` 2042 # /I /Q /H /C /K /Y`{next;in 1}` 2043 2044 # (/Q -> Don't display file names)`{next}` 2045 # (/H -> Copies hidden files)`{next}` 2046 # (/C -> Continue copying if errors)`{next}` 2047 # (/K -> Copy attributes)`{next}` 2048 # (/Y -> Suppresses prompting to confirm...)} }` 2049 # 2050 } 2051 2052 AddConf $fid config(cmd,dircp) "" { 2053 # This command is used by the 'copy' button when the source is a directory. 2054 # Again '{}' will use the Tcl file copy code and disallows back-grounding. 2055 # `{ifThis {! $::MSW} { 2056 # This can be the same as the 'cp' command above.} { 2057 # The 'xcopy' command will not copy a single file to 2058 # a point deeper in the tree if the /S or /E switches are on and we do 2059 # want one of those on in this command. If you use the '{}' option, when 2060 # you copy a directory to a new location you will get a new directory at 2061 # that location with the same name as the source unlike what 2062 # xcopy does(see below)).`{next}` 2063 # (/S -> copies directories and sub-directories except empty dirs)`{next}` 2064 # (/E -> copies directories and sub-directories INCLUDING empty dirs)`{next}` 2065 # (/I -> Assume destination is a directory)`{next}` 2066 # 2067 # Most of (all ?) MS windows copy routines treat the 2068 # source directory as if the user had added "\*" to it. This means 2069 # that the directory pointed at is not copied, but its contents are. 2070 # Usually (at least from a *nix point of view) one wants the directory 2071 # replicated in the destination followed by its contents. If this 2072 # is what you want, you can tell filerunner to negate the implied 2073 # "*" by adding "-*" to this configuration parameter as a second 2074 # entry in the list. It would then look like:`{next;in 1}` 2075 # 2076 # set config(cmd,dircp) {{xcopy /E /I /Q /H /C /K /Y} -*}} }` 2077 # 2078 } 2079 2080 AddConf $fid config(cmd,hardlink) "" { 2081 # This command is used by the 'HardLnk' button. For information on why you 2082 # might need this and need it to be recursive please read "File links 101" 2083 # in the Tips file.`{ifThis {! $::MSW} { 2084 # The best option is:`{next}` 2085 # '{{cp -pfrl}}'`{next}` 2086 # (for meaning of 'pfr' see comments on the 'cp' command above.)`{next}`} { 2087 # The best option is "{}". This will then use the internal Filerunner 2088 # hard link code which recursively call the tcl "file link" command. It is 2089 # also possible that the GNU version of cp will do the hard link recursively, 2090 # but this is untested. 'fsutil hardlink create' and 'mklink' will not 2091 # re-curse over directories. 2092 # Also, this command wants the parameters in the reverse order which is 2093 # indicated thusly: {fsutil hardlink create %2@s %1@s}}}` 2094 } 2095 AddConf $fid config(cmd,chmod) "" { 2096 # The change mode (chmod) command. This should almost always be /bin/chmod. 2097 } 2098 AddConf $fid config(cmd,chown) "" { 2099 # The change mode (chmod) command. This should almost always be /bin/chown. 2100 } 2101 AddConf $fid config(cmd,touch) "" { 2102 # The touch command. If you have the tcl package "fileutil" you can set this to 2103 # nill i.e. {}. If you do set it to nill and you don't have the package, fr will 2104 # tell you about it when you first try to use it. 2105 } 2106 2107 AddConf $fid config(cmd,du) "" { 2108 # The "du" command. Should return size in kilobytes. On many 2109 # systems other than BSD (?) you need to add a -k argument 2110 # to this command to get it in kilobytes. 2111 } 2112 2113 AddConf $fid config(cmd,find) "" { 2114 # The find command. If this is {} an internal find routine is used. 2115 # The internal version is a bit slower (especially for large file sets) 2116 # and has a bit fewer options but, especially where there is no find 2117 # command, it does the job. 2118 } 2119 AddConf $fid config(cmd,ucmd) "" { 2120 # This configure builds the 3ed entry in the "Utilities" menu. The first 2121 # of the two values is the label used in the menu, the second is the command 2122 # that is evaluated when that entry is selected. 2123 # `{ifThis {!$::MSW} {As shipped this command 2124 # runs fr as root, on the current directories i.e.: `{next}` 2125 # {{Run fr as root} `{next}` 2126 # {exec echo [pwLocker::getPw root] |sudo -HS fr $glob(left,pwd) $glob(right,pwd) &}} `{next}` 2127 2128 # Note that if you don't included the "&" filerunner will wait for the 2129 # program to exit. You can put what 2130 # ever you like here if you think some other command is more useful. 2131 # Or you can enhance what is here by adding full paths and/or additional 2132 # parameters. (The -H in the default command causes sudo to NOT pass the 2133 # current HOME environment, but rather to use root's HOME. The -S tells 2134 # sudo to read STDIN for the password. If you have set up your sudo to 2135 # not need a password you may eliminate the "S" as well as the: `{next}` 2136 # "echo [pwLocker::getPw root] |". The command "pwLocker::getPw root" gets root's 2137 # password from the filerunner password locker. If the password is 2138 # not found, "pwLocker::getPw" will prompt 2139 # you for it. You will also be given an opportunity to save the password at 2140 # that time. The word "root" is just an "ID" for the password and may be any 2141 # string (enclose in {} if it contains spaces).)} 2142 # {The 2143 # original reason for this command was to provide a way to launch an 2144 # "elevated" version of filerunner (and this is the "as shipped" value 2145 # for this entry). On the other hand, you may want to put something here 2146 # that is more useful to you.} }` 2147 2148 # Be careful! 2149 } 2150 2151 AddConf $fid config(cmd,rm) "" { 2152 # File remove (or delete) command. If this is {} (i.e. nil) filerunner will 2153 # use the native 2154 # Tcl "file delete" command. `{ifThis {$::MSW} {"As shipped" 2155 # (twapi::recycle_file) this moves the file or directory to the "Recycle Bin".} 2156 # {Various *nix systems have their own ways of managing the "Trash". Check 2157 # if your system has one of these:`{next}` 2158 # trash-put`{next}` 2159 # gvfs-trash`{next}` 2160 # gio`{next}` 2161 # }}` 2162 # Several filerunner commands may delete files (Copy, Delete and Move). 2163 # All these deletes will use this command, thus, if a recycle command 2164 # is used here, all of these commands may add files to the 2165 # `{ifThis {$::MSW} {Recycle Bin.} {Trash.}}` 2166 } 2167 2168 AddConf $fid config(cmd,tail) "" { 2169 # The tail command. This command should take two parameters, the line 2170 # number of the first line to pass to stdout and the file name. 2171 # The command should senses writes to the file and passes those lines to 2172 # stdout. This is used by the 'follow' option in 'view' windows. 2173 } 2174 AddConf $fid config(useDIR) "" { 2175 # This tells filerunner to try different way of gathering dir info, 2176 # namely by calling the "cmd dir". If 0, the native tcl way is used. 2177 } 2178} 2179# We produce two sources, usually put in the platform part of fr 2180puts "start" 2181set db 0 2182if {$db} { 2183 puts "In debug mode" 2184} 2185if {!$db} { 2186 translate 2187 buildList 2188 if {$out == "stdout"} { 2189 puts "Don't really want this on stdout." 2190 exit 1 2191 } 2192 if {[set ext [file ext $out]] == {}} { 2193 set out1 "${out}l.tcl" 2194 set out2 "${out}c.tcl" 2195 } else { 2196 set out1 [file root $out]l.$ext 2197 set out2 [file root $out]c.$ext 2198 } 2199 2200 set fi [open $out1 w] 2201 puts $fi "# Left side info for Configuration Browser" 2202 puts $fi "# Generated by $argv0 on [clock format [clock seconds]]" 2203 puts $fi "" 2204 puts $fi "namespace eval ::fr_config {" 2205 puts $fi " variable leftSideConfig {" 2206 foreach ent $glob(edit_configuration_configlist) { 2207 puts $fi " [list $ent]" 2208 } 2209 puts $fi " }" 2210 puts $fi "" 2211 puts $fi " proc getLeftSide {} {return \$::fr_config::leftSideConfig}" 2212 puts $fi "}" 2213 close $fi 2214 2215 set fi [open $out2 w] 2216 puts $fi "# Right side info for Configuration Browser" 2217 puts $fi "# Generated by $argv0 on [clock format [clock seconds]]" 2218 puts $fi "" 2219 puts $fi "namespace eval ::fr_config {" 2220 puts $fi " variable RightSideConfig {" 2221 foreach ent $result { 2222 puts $fi " [list $ent]" 2223 } 2224 puts $fi " }" 2225 puts $fi "" 2226 puts $fi " proc getRightSide {} {return \$::fr_config::RightSideConfig}" 2227 puts $fi "}" 2228 close $fi 2229 2230 exit 0 2231} 2232