SYNOPSIS

list-desktop-profiles [OPTION]

DESCRIPTION

As the number of .listing files holding metadata grows, trying to find out which profiles are present/meet certain criteria becomes increasingly unpleasant. This script remedies that allowing you to just list your criteria, and outputting all profiles meeting those criteria.

By default it will just output the lines from the .listing files for each (matching) profile, but you can specifying a formatstring to fancy up the output.

OPTIONS

-n <regexp>, --name <regexp>

  • Limit shown profiles to those for which the name (1st) field of the profile description needs matches the given regular expression.

-k <regexp>, --kind <regexp>

  • Limit shown profiles to those for which the kind (2nd) field of the profile description needs matches the given regular expression.

-l <regexp>, --location <regexp>

  • Limit shown profiles to those for which the location (3th) field of the profile description needs matches the given regular expression.

-p <comparison>, --precedence <comparison>

  • Limit shown profiles to those for which the precedence (4th) field of the profile description succeeds the given comparison. In the comparison you can Use 'gt' for 'greater then', 'lt' for 'less then', 'ge' for 'greater then or equal to', 'le' for 'less then or equal to', 'eq' for 'equal to', and 'ne' for 'not equal to'. (NOTE: empty precedence-field, is lowest possible precedence)

-r <regexp>, --requirement <regexp>

  • Limit shown profiles to those for which the requirements (5th) field of the profile description needs matches the given regular expression.

-c <regexp>, --comment <regexp>, --description <regexp>

  • Limit shown profiles to those for which the comment (6th) field of the profile description needs matches the given regular expression.

-u <username>, --user <username>

  • Limit shown profiles to those for which the given user meets the requirements. (NOTE: doesn't always give correct results! Results might be wrong when using shell command requirements that depend on the users environment. Or when 'group $USER' gives a different result as 'group' executed as $USER, which can happen when adding groups through pam_group).

-d <dir>, --directory <dir>

  • Also use .listing files found in the given directory. This option can be used multiple times to add more then 1 additional directory

-e <formatstring>, --entry-format <formatstring>

  • Show profile information according to the specified format spring (instead of just echoing the profile-line). The format string may use the following variables: NAME, LOCATION, PRECEDENCE, REQUIREMENTS, KIND, DESCRIPTION, FILE; the first 6 of these refer to the corresponding field, the last refers to the .listing file the profile is in. (e.g. '$FILE_$NAME - $DESCRIPTION'). Any characters that are interpreted specially by the shell should be escaped.

-s <fieldname>|<fieldnumber>, --sort-key <fieldname>|fieldnumber

  • Sort output on the requested field (fieldname is one of name, kind, location, precedence, requirements, or description; fieldnumbers run from 1-6).

EXAMPLES

list-desktop-profiles -k KDE -s precedence -u user1

  • List all kde-profiles that will be activated for user1 in order of precedence.

list-desktop-profiles -k 'KDE\|GCONF'

  • List all kde and gnome profiles.

list-desktop-profiles -p 'gt 50'

  • List all profiles with a precedence value greater then 50.

ENVIRONMENT

NAME_FILTER, LOCATION_FILTER, PRECEDENCE_FILTER, REQUIREMENT_FILTER, KIND_FILTER, DESCRIPTION_FILTER

  • Can be used to specify the default regular expressions and comparisons. Default to empty.

OUR_USER

  • Set the user for which the requirements need to be met. Defaults to unset.

EXTRA_LISTINGS

  • Can be used to specify a (space separated) list of extra .listing files to include. Defaults to empty

FORMAT

  • Can be used to specify the default format string. By default it will output the profile-line from the .listing file.

SORT_KEY

  • Can be used to specify the default sort-key (= field number). Defaults to 1

FILES

/etc/desktop-profiles/*.listing - Files containing the metadata about installed profiles

/etc/default/desktop-profiles - File containing default settings for this script (by way of the environment variables above)

BUGS

The '-u <username>' is not guaranteed to work correctly for shell command requirements. Particulary this will give incorrect results if the shell command depends on some state of the user environment.

AUTHOR

This manual page was written by Bart Cornelis <[email protected]>.

RELATED TO list-desktop-profiles…