man giFTcurs.conf (Formats) - giFTcurs configuration file

NAME

giFTcurs.conf - giFTcurs configuration file

DESCRIPTION

The giFTcurs.conf file contains configuration data for giFTcurs. Comments begin with #, whitespace is trimmed and empty lines are ignored. Each line should contain a section, a keyword and a value. giFTcurs will try to preserve most of the formatting when it saves changes. The available options are listed below.

color item value
This sets the color item item to the colors in value. All possible items can be found and changed in the settings screen in giFTcurs.
set max-hits value
This sets the maximum number of hits. A zero value means that there is no limit. The default is not to limit the number of hits.
set upload-height value
This sets the height of the upload box. This value is automatically saved if it's changed in giFTcurs.
set scrolloff value
This sets the scroll offset for lists. The default is 0.
set invert-selection value
If this value is non-zero then the old behaviour of inverting selections instead of using a specific color will be used.
set filter-hits value
Setting this to non-zero will make giFTcurs ignore all search hits where the availability is set to zero.
set buttonbar value
If this value is zero, the button bar will be hidden.
set autoclear value
If this value is non-zero, finished transfers will be cleared from the screen automatically.
set confirm-cancel value
If this value is non-zero, giFTcurs will require you to hold down shift when cancelling downloads. When set greater than 1, it indicates the minimum number of downloaded bytes that will require shift. For example, a value of 5242880 will prevent accidental cancellations of downloads > 5MB.
set max-console value
This specifies how many lines should be saved in the console backlog.
set wrap-console value
If this value is non-zero, lines are wrapped in the console.
set fancy-utf8
If this value is non-zero, giFTcurs will use rounded corners if the locale uses UTF-8.
sort hits
Specify the sorting methods to be used for displaying hits. ; separates the methods and , separates fields within methods. A minus sign sorts in reversed order. All fields specified in section ATTRIBUTES are supported.
sort transfers
sort uploads
sort downloads
Specify sorting for transfers. Use the latter to use a different sorting for the two types of transfers.
ignore filename regex-string
Specifies that filenames containing the specified string should not be displayed among search results. Case is ignored, and the string can contain regular expression wildcards, see regex(7). This setting can be repeated for every filename you want filtered.
ignore user string
Hits from this user will be ignored. The exact username is required, no wildcards are recognised. You can also press shift-i in giFTcurs add that user to the ignore list. This setting can be repeated for every user you want filtered.
format hit format-string
Sets the default presentation format of search hits. See section FORMATS STRINGS for description of formats.
format audio format-string
format video format-string
format image format-string
format text format-string
format application format-string
If defined, these formats are selected instead of format hit when hits have the corresponding mime-type. A hit with mime-type audio/x-vorbis will for example use the audio format.
format browse format-string
Define the format to be used when searching for the files of a user.
format subhit format-string
This format is shown on each user, when you expand a hit.
format transfer format-string
Describes the format used for transfers.
format source format-string
Each item in the expanded transfer is formatted according to this.
format $macroname format-string
Defines a macro which can be referred to in any format string, and is expanded there. Recursive macros are not allowed.

FORMAT STRINGS

A format string is a regular string with commands inserted. A command is defined between { and }. If you want these characters literally, you must escape them with backslash as \{ or \}. Also, you can prevent extra spaces to be stripped by preceding them with \. If a format is malformed, it is silently ignored. However, giFTcurs --verbose will (hopefully) show you an explanation of the error.

Here follows a list of commands understood. Examples of names are used, but they can be replaced by other names as well. The notation [abc] means you can put either an a, b or c in this place.

{%hit-good}
The color theme hit-good should be used after this point. You can reset color with {%standard}
{%hit-good:B}
See above but bold colors should be used.
{space}
For centering values. When the formatting is nearly complete, the remaining space is evenly divided among all the {space}s.
{progress filesize transferred}
{progress filesize start transferred}
{endprogress}
for transfers, these indicate where the progress bar should begin and end. The first argument refers to how large the amount is. The middle argument, is specified, tells where the bar should start. The last argument tells where the bar should stop. Numeric arguments can be used. You can not specify colors inside {progress} {endprogress}.
{fixed:35} {endfixed}
Formats encapsulated within these tags will be forced to have the specified width. These tags can not be nested.
{author}
This command is substituted by the contents of the value referenced by this keyword on the actual item. Keywords available depends on which type of item we are formatting, see section KEYWORDS. If the line becomes too long, items without flags are truncated. To prevent that, specify an empty format tag, like {author:}
{bitrate:[bkMGT]}
The keyword is converted to an integer and is printed out with a 1000-power prefix appended. Always four chars wide, four spaces are written if the actual keyword is not available.
{filesize:[bkMGT]i}
The keyword is converted to an integer and is printed out with a 1024-power prefix appended. Always 4 chars wide.
{duration:t}
The keyword is taken as seconds and is printed out on the form 04h06s, always 6 chars wide.
{net:3}
{filename:60%}
The keyword is printed out, truncated or padded to the specified number of characters. A percent-sign after the number specifies a width relative to the whole format width.
{availability:3}
{availability:-3}
The integer keyword is printed out, padded up to the specified number of chars. Negative means left adjust. Same as printf format %3u and %-3u.
{if keyword}
{elif keyword}
{else} {endif}
{endif}
Allows conditional rendering, a keyword is said to fail if is unavailable, the empty string or the number 0. Comparisons support one single operation: less than, <. This, however can be used to specify an interval, for example {if 4<sources<6} will succeed if sources equals 5. If statements can not be nested, but nesting can be simulated using macros.
{$stats}
This "calls" the macro named $stats which must be defined. You define macros just as other formats, but they must begin with a dollar sign.

ATTRIBUTES

There is four types of items, each with a different set of recognized keywords.

Hits
Strings: hash, filename, net, path. Integers: filesize, expanded, sources, availability, downloading. All meta data can also be accessed.
Subhits
Strings: user, url, net, filename, suffix. Integers: availability.
Transfers
Strings: filename, expanded, net, status Integers: filesize, bandwidth, ratio, transferred, searching, active, eta, download, upload, disk_free, expanded, sources.
Sources
Strings: user, url, net, status, expanded, filename. Integers: start, transferred, total, filesize, active, paused, queued, download, upload, eta.

EXAMPLE

This shows a commented example file ~/.giFT/ui/giFTcurs.conf.

# giFTcurs configuration file. # Available colors: black red green yellow blue magenta cyan white default # 'default' means no color, i.e. transparent on some terminals. color standard cyan default color header magenta black color search-box red black color result-box green black color stat-box blue black color stat-data white black color stat-bad red black color info-box magenta black color download-box green black color upload-box cyan black color help-box blue black color hit-good green black color hit-bad red black color progress blue green color tot-progress blue green color diamond green black set upload-height 17 # height of upload box set scrolloff 3 # same as :set scrolloff=3 in vim set confirm-cancel 5242880 # require shift when deleting > 5MB d/l

# first define some useful macros format $expanded {if expanded}-{else}+{endif} format $availability {if 2<availability}{%hit-good:B}{elif availability<1}{%hit-bad:B}{else}{%header:B}{endif} format $hit_pfx {if downloading}!{else}{$expanded}{endif}{$availability}{availability:2}{%standard}/{if downloading<1}{%header:B}{endif}{filesize:bi}{%standard}

# define the default hit format format hit {$hit_pfx} {filename}{space} # define the individual source hit format format subhit \ - {if 128<availability}Inf{else}{availability:3}{endif} \ \ {space}{user}{%header:B}@{%standard}{fixed:20%}{net}{space}{endfixed}

# special formats for common search types format browse {if downloading<1}{%header:B}{endif}{filesize:bi}{%standard} {path:}/{filename}{space}{if bitrate} {bitrate:b}bps{endif}{if duration} {duration:t}{endif} format image {$hit_pfx} {filename} {space}{if width}{width} x {height}{endif} format transfer {$expanded} {filename}{space} | [{progress filesize transferred}{fixed:26}{space}{if active}{transferred:bi}/{filesize:bi} {ratio:3}% @ {bandwidth:bi}B/s{else}{status}{endif}{space}{endfixed}{endprogress}] format source \ \ - {space}{user}@{net} | [{progress filesize start transferred}{fixed:26}{space}{if active}{bandwidth:bi}B/s{else}{status}{endif}{space}{endfixed}{endprogress}]

# Let the user have many ways to sort. left/right key cycles through this list sort hits availability,filesize;filename;path,filename;filesize;sources,filesize sort transfers filesize,transferred,bandwidth,filename

AUTHORS

G[:o]ran Weinholt <weinholt@dtek.chalmers.se>, Christian H[:a]ggstr[:o]m <chm@c00.info>.

SEE ALSO