FmConfig

FmConfig — Configuration file support for applications that use libfm.

Synopsis

#define             FM_CONFIG_DEFAULT_AUTO_SELECTION_DELAY
#define             FM_CONFIG_DEFAULT_BACKUP_HIDDEN
#define             FM_CONFIG_DEFAULT_BIG_ICON_SIZE
#define             FM_CONFIG_DEFAULT_CONFIRM_DEL
#define             FM_CONFIG_DEFAULT_CONFIRM_TRASH
#define             FM_CONFIG_DEFAULT_DEFER_CONTENT_TEST
#define             FM_CONFIG_DEFAULT_FORCE_S_NOTIFY
#define             FM_CONFIG_DEFAULT_NO_EXPAND_EMPTY
#define             FM_CONFIG_DEFAULT_NO_USB_TRASH
#define             FM_CONFIG_DEFAULT_ONLY_USER_TEMPLATES
#define             FM_CONFIG_DEFAULT_PANE_ICON_SIZE
#define             FM_CONFIG_DEFAULT_PLACES_APPLICATIONS
#define             FM_CONFIG_DEFAULT_PLACES_COMPUTER
#define             FM_CONFIG_DEFAULT_PLACES_DESKTOP
#define             FM_CONFIG_DEFAULT_PLACES_HOME
#define             FM_CONFIG_DEFAULT_PLACES_NETWORK
#define             FM_CONFIG_DEFAULT_PLACES_ROOT
#define             FM_CONFIG_DEFAULT_PLACES_TRASH
#define             FM_CONFIG_DEFAULT_PLACES_UNMOUNTED
#define             FM_CONFIG_DEFAULT_QUICK_EXEC
#define             FM_CONFIG_DEFAULT_SHADOW_HIDDEN
#define             FM_CONFIG_DEFAULT_SHOW_FULL_NAMES
#define             FM_CONFIG_DEFAULT_SHOW_THUMBNAIL
#define             FM_CONFIG_DEFAULT_SINGLE_CLICK
#define             FM_CONFIG_DEFAULT_SMALL_ICON_SIZE
#define             FM_CONFIG_DEFAULT_SMART_DESKTOP_AUTODROP
#define             FM_CONFIG_DEFAULT_TEMPL_TYPE_ONCE
#define             FM_CONFIG_DEFAULT_TEMPLATE_RUN_APP
#define             FM_CONFIG_DEFAULT_THUMBNAIL_LOCAL
#define             FM_CONFIG_DEFAULT_THUMBNAIL_MAX
#define             FM_CONFIG_DEFAULT_THUMBNAIL_SIZE
#define             FM_CONFIG_DEFAULT_USE_TRASH
#define             FM_CONFIG_TYPE
struct              FmConfig;
struct              FmConfigClass;
enum                FmDndDestDropAction;
extern FmConfig*    fm_config;
void                fm_config_emit_changed              (FmConfig *cfg,
                                                         const char *changed_key);
void                fm_config_load_from_file            (FmConfig *cfg,
                                                         const char *name);
void                fm_config_load_from_key_file        (FmConfig *cfg,
                                                         GKeyFile *kf);
FmConfig *          fm_config_new                       (void);
void                fm_config_save                      (FmConfig *cfg,
                                                         const char *name);

Object Hierarchy

  GObject
   +----FmConfig

Signals

  "changed"                                        : Has Details

Description

include: libfm/fm.h

The FmConfig represents basic configuration options that are used by libfm classes and methods. Methods of class FmConfig allow use either default file (~/.config/libfm/libfm.conf) or another one to load the configuration and to save it.

Details

FM_CONFIG_DEFAULT_AUTO_SELECTION_DELAY

#define     FM_CONFIG_DEFAULT_AUTO_SELECTION_DELAY 600

FM_CONFIG_DEFAULT_BACKUP_HIDDEN

#define     FM_CONFIG_DEFAULT_BACKUP_HIDDEN     TRUE

FM_CONFIG_DEFAULT_BIG_ICON_SIZE

#define     FM_CONFIG_DEFAULT_BIG_ICON_SIZE     48

FM_CONFIG_DEFAULT_CONFIRM_DEL

#define     FM_CONFIG_DEFAULT_CONFIRM_DEL       TRUE

FM_CONFIG_DEFAULT_CONFIRM_TRASH

#define     FM_CONFIG_DEFAULT_CONFIRM_TRASH     TRUE

FM_CONFIG_DEFAULT_DEFER_CONTENT_TEST

#define     FM_CONFIG_DEFAULT_DEFER_CONTENT_TEST FALSE

FM_CONFIG_DEFAULT_FORCE_S_NOTIFY

#define     FM_CONFIG_DEFAULT_FORCE_S_NOTIFY    TRUE

FM_CONFIG_DEFAULT_NO_EXPAND_EMPTY

#define     FM_CONFIG_DEFAULT_NO_EXPAND_EMPTY   FALSE

FM_CONFIG_DEFAULT_NO_USB_TRASH

#define     FM_CONFIG_DEFAULT_NO_USB_TRASH      TRUE

FM_CONFIG_DEFAULT_ONLY_USER_TEMPLATES

#define     FM_CONFIG_DEFAULT_ONLY_USER_TEMPLATES FALSE

FM_CONFIG_DEFAULT_PANE_ICON_SIZE

#define     FM_CONFIG_DEFAULT_PANE_ICON_SIZE    16

FM_CONFIG_DEFAULT_PLACES_APPLICATIONS

#define     FM_CONFIG_DEFAULT_PLACES_APPLICATIONS TRUE

FM_CONFIG_DEFAULT_PLACES_COMPUTER

#define     FM_CONFIG_DEFAULT_PLACES_COMPUTER   FALSE

FM_CONFIG_DEFAULT_PLACES_DESKTOP

#define     FM_CONFIG_DEFAULT_PLACES_DESKTOP    TRUE

FM_CONFIG_DEFAULT_PLACES_HOME

#define     FM_CONFIG_DEFAULT_PLACES_HOME       TRUE

FM_CONFIG_DEFAULT_PLACES_NETWORK

#define     FM_CONFIG_DEFAULT_PLACES_NETWORK    FALSE

FM_CONFIG_DEFAULT_PLACES_ROOT

#define     FM_CONFIG_DEFAULT_PLACES_ROOT       FALSE

FM_CONFIG_DEFAULT_PLACES_TRASH

#define     FM_CONFIG_DEFAULT_PLACES_TRASH      TRUE

FM_CONFIG_DEFAULT_PLACES_UNMOUNTED

#define     FM_CONFIG_DEFAULT_PLACES_UNMOUNTED  TRUE

FM_CONFIG_DEFAULT_QUICK_EXEC

#define     FM_CONFIG_DEFAULT_QUICK_EXEC        FALSE

FM_CONFIG_DEFAULT_SHADOW_HIDDEN

#define     FM_CONFIG_DEFAULT_SHADOW_HIDDEN     FALSE

FM_CONFIG_DEFAULT_SHOW_FULL_NAMES

#define     FM_CONFIG_DEFAULT_SHOW_FULL_NAMES   FALSE

FM_CONFIG_DEFAULT_SHOW_THUMBNAIL

#define     FM_CONFIG_DEFAULT_SHOW_THUMBNAIL    TRUE

FM_CONFIG_DEFAULT_SINGLE_CLICK

#define     FM_CONFIG_DEFAULT_SINGLE_CLICK      FALSE

FM_CONFIG_DEFAULT_SMALL_ICON_SIZE

#define     FM_CONFIG_DEFAULT_SMALL_ICON_SIZE   16

FM_CONFIG_DEFAULT_SMART_DESKTOP_AUTODROP

#define     FM_CONFIG_DEFAULT_SMART_DESKTOP_AUTODROP TRUE

FM_CONFIG_DEFAULT_TEMPL_TYPE_ONCE

#define     FM_CONFIG_DEFAULT_TEMPL_TYPE_ONCE   FALSE

FM_CONFIG_DEFAULT_TEMPLATE_RUN_APP

#define     FM_CONFIG_DEFAULT_TEMPLATE_RUN_APP  FALSE

FM_CONFIG_DEFAULT_THUMBNAIL_LOCAL

#define     FM_CONFIG_DEFAULT_THUMBNAIL_LOCAL   TRUE

FM_CONFIG_DEFAULT_THUMBNAIL_MAX

#define     FM_CONFIG_DEFAULT_THUMBNAIL_MAX     2048

FM_CONFIG_DEFAULT_THUMBNAIL_SIZE

#define     FM_CONFIG_DEFAULT_THUMBNAIL_SIZE    128

FM_CONFIG_DEFAULT_USE_TRASH

#define     FM_CONFIG_DEFAULT_USE_TRASH         TRUE

FM_CONFIG_TYPE

#define FM_CONFIG_TYPE              (fm_config_get_type())

struct FmConfig

struct FmConfig {
    char* terminal;
    char* archiver;

    gint big_icon_size;
    gint small_icon_size;
    gint pane_icon_size;
    gint thumbnail_size;
    gint thumbnail_max;
    gint auto_selection_delay;
    gint drop_default_action;

    gboolean single_click;
    gboolean use_trash;
    gboolean confirm_del;
    gboolean confirm_trash;
    gboolean show_thumbnail;
    gboolean thumbnail_local;
    gboolean show_internal_volumes;
    gboolean si_unit;
    gboolean advanced_mode;
    gboolean force_startup_notify;
    gboolean backup_as_hidden;
    gboolean no_usb_trash;
    gboolean no_child_non_expandable;
    gboolean show_full_names;
    gboolean shadow_hidden;

    gboolean places_home;
    gboolean places_desktop;
    gboolean places_applications;
    gboolean places_trash;
    gboolean places_root;
    gboolean places_computer;
    gboolean places_network;
    gboolean places_unmounted;

    gboolean only_user_templates;
    gboolean template_run_app;
    gboolean template_type_once;
    gboolean defer_content_test;
    gboolean quick_exec;

    gchar **modules_blacklist;
    gchar **modules_whitelist;

    gchar *list_view_size_units;
    gchar *format_cmd;

    gboolean smart_desktop_autodrop;
    gchar *saved_search;
};

char *terminal;

command line to launch terminal emulator

char *archiver;

desktop_id of the archiver used

gint big_icon_size;

size of big icons

gint small_icon_size;

size of small icons

gint pane_icon_size;

size of side pane icons

gint thumbnail_size;

size of thumbnail icons

gint thumbnail_max;

show thumbnails only for files not bigger than this, in KB or Kpix

gint auto_selection_delay;

(since 1.2.0) delay for autoselection in single-click mode, in ms

gint drop_default_action;

(since 1.2.0) default action on drop (see FmDndDestDropAction)

gboolean single_click;

single click to open file

gboolean use_trash;

delete file to trash can

gboolean confirm_del;

ask before deleting files

gboolean confirm_trash;

(since 1.2.0) ask before moving files to trash can

gboolean show_thumbnail;

show thumbnails

gboolean thumbnail_local;

show thumbnails for local files only

gboolean show_internal_volumes;

show system internal volumes in side pane. (udisks-only)

gboolean si_unit;

use SI prefix for file sizes

gboolean advanced_mode;

enable advanced features for experienced user

gboolean force_startup_notify;

(since 1.0.1) use startup notify by default

gboolean backup_as_hidden;

(since 1.0.1) treat backup files as hidden

gboolean no_usb_trash;

(since 1.0.1) don't create trash folder on removable media

gboolean no_child_non_expandable;

(since 1.0.1) hide expanders on empty folder

gboolean show_full_names;

(since 1.2.0) always show full names in Icon View mode

gboolean shadow_hidden;

(since 1.2.0) show icons of hidden files shadowed in the view

gboolean places_home;

(since 1.2.0) show 'Home' item in Places

gboolean places_desktop;

(since 1.2.0) show 'Desktop' item in Places

gboolean places_applications;

(since 1.2.0) show 'Applications' item in Places

gboolean places_trash;

(since 1.2.0) show 'Trash' item in Places

gboolean places_root;

(since 1.2.0) show '/' item in Places

gboolean places_computer;

(since 1.2.0) show 'My computer' item in Places

gboolean places_network;

(since 1.2.0) show 'Network' item in Places

gboolean places_unmounted;

(since 1.2.0) show unmounted internal volumes in Places

gboolean only_user_templates;

(since 1.2.0) show only user defined templates in 'Create...' menu

gboolean template_run_app;

(since 1.2.0) run default application after creation from template

gboolean template_type_once;

(since 1.2.0) use only one template of each MIME type

gboolean defer_content_test;

(since 1.2.0) defer test for content type on folder loading

gboolean quick_exec;

(since 1.2.0) don't ask user for action on executable launch

gchar **modules_blacklist;

(since 1.2.0) list of modules (mask in form "type:name") to never load

gchar **modules_whitelist;

(since 1.2.0) list of excemptions from modules_blacklist

gchar *list_view_size_units;

(since 1.2.0) file size units in list view: h, k, M, G

gchar *format_cmd;

(since 1.2.0) command to format the volume (device will be added)

gboolean smart_desktop_autodrop;

(since 1.2.0) enable "smart shortcut" auto-action for ~/Desktop

gchar *saved_search;

(since 1.2.0) internal saved data of fm_launch_search_simple()

struct FmConfigClass

struct FmConfigClass {
    GObjectClass parent_class;
    void (*changed)(FmConfig* cfg);
};

GObjectClass parent_class;

the parent class

changed ()

the class closure for the "changed" signal

enum FmDndDestDropAction

typedef enum {
    FM_DND_DEST_DROP_AUTO,
    FM_DND_DEST_DROP_COPY,
    FM_DND_DEST_DROP_MOVE,
    FM_DND_DEST_DROP_ASK
} FmDndDestDropAction;

selected behavior when files are dropped on destination widget.

FM_DND_DEST_DROP_AUTO

move if source and destination are on the same file system, copy otherwise

FM_DND_DEST_DROP_COPY

copy

FM_DND_DEST_DROP_MOVE

move

FM_DND_DEST_DROP_ASK

open popup to let user select desired action

fm_config

extern FmConfig* fm_config;

fm_config_emit_changed ()

void                fm_config_emit_changed              (FmConfig *cfg,
                                                         const char *changed_key);

Causes the "changed" signal to be emitted.

This API is not thread-safe and should be used only in default context.

cfg :

pointer to configuration

changed_key :

what was changed

Since 0.1.0


fm_config_load_from_file ()

void                fm_config_load_from_file            (FmConfig *cfg,
                                                         const char *name);

Fills configuration cfg with data from configuration file. The file name may be NULL to load default configuration file. If name is full path then that file will be loaded. Otherwise name will be searched in system config directories and after that in ~/.config/ directory and all found files will be loaded, overwriting existing data in cfg.

See also: fm_config_load_from_key_file()

cfg :

pointer to configuration

name :

file name to load configuration. [allow-none]

Since 0.1.0


fm_config_load_from_key_file ()

void                fm_config_load_from_key_file        (FmConfig *cfg,
                                                         GKeyFile *kf);

Fills configuration cfg with data from GKeyFile kf.

cfg :

pointer to configuration

kf :

a GKeyFile with configuration keys and values

Since 0.1.0


fm_config_new ()

FmConfig *          fm_config_new                       (void);

Creates a new configuration structure filled with default values.

Returns :

a new FmConfig object.

Since 0.1.0


fm_config_save ()

void                fm_config_save                      (FmConfig *cfg,
                                                         const char *name);

Saves configuration into configuration file name. If name is NULL then configuration will be saved into default configuration file. Otherwise it will be saved into file name under directory ~/.config.

cfg :

pointer to configuration

name :

file name to save configuration. [allow-none]

Since 0.1.0

Signal Details

The "changed" signal

void                user_function                      (FmConfig *config,
                                                        gpointer  user_data)      : Has Details

The "changed" signal is emitted when a config key is changed.

config :

configuration that was changed

user_data :

user data set when the signal handler was connected.

Since 0.1.0