summaryrefslogtreecommitdiffstats
path: root/source/dialogs
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-03-04 12:00:59 +0100
committerDave Davenport <qball@gmpclient.org>2017-03-04 12:00:59 +0100
commit86dc1e14486044c4b5d7838005fbe7960d157026 (patch)
tree6bf2c878a94b7e93ff38fb91f5ca5915fa324e04 /source/dialogs
parent45c70cbecf980769ec5cda10e1186bf3d7dcb580 (diff)
Detect plugins on startup.
Diffstat (limited to 'source/dialogs')
-rw-r--r--source/dialogs/combi.c36
1 files changed, 5 insertions, 31 deletions
diff --git a/source/dialogs/combi.c b/source/dialogs/combi.c
index 33bed0ce..4699f151 100644
--- a/source/dialogs/combi.c
+++ b/source/dialogs/combi.c
@@ -68,48 +68,22 @@ static void combi_mode_parse_switchers ( Mode *sw )
pd->switchers = (CombiMode *) g_realloc ( pd->switchers,
sizeof ( CombiMode ) * ( pd->num_switchers + 1 ) );
- // Window switcher.
- #ifdef WINDOW_MODE
- if ( strcasecmp ( token, "window" ) == 0 ) {
+ Mode *mode = rofi_collect_modi_search ( token );
+ if ( mode ){
pd->switchers[pd->num_switchers].disable = FALSE;
- pd->switchers[pd->num_switchers++].mode = &window_mode;
- }
- else if ( strcasecmp ( token, "windowcd" ) == 0 ) {
- pd->switchers[pd->num_switchers].disable = FALSE;
- pd->switchers[pd->num_switchers++].mode = &window_mode_cd;
- }
- else
- #endif // WINDOW_MODE
- // SSh dialog
- if ( strcasecmp ( token, "ssh" ) == 0 ) {
- pd->switchers[pd->num_switchers].disable = FALSE;
- pd->switchers[pd->num_switchers++].mode = &ssh_mode;
- }
- // Run dialog
- else if ( strcasecmp ( token, "run" ) == 0 ) {
- pd->switchers[pd->num_switchers].disable = FALSE;
- pd->switchers[pd->num_switchers++].mode = &run_mode;
- }
- #ifdef ENABLE_DRUN
- else if ( strcasecmp ( token, "drun" ) == 0 ) {
- pd->switchers[pd->num_switchers].disable = FALSE;
- pd->switchers[pd->num_switchers++].mode = &drun_mode;
- }
-#endif // ENABLE_DRUN
- else {
+ pd->switchers[pd->num_switchers++].mode = mode;
+ } else {
// If not build in, use custom switchers.
Mode *sw = script_switcher_parse_setup ( token );
if ( sw != NULL ) {
pd->switchers[pd->num_switchers].disable = FALSE;
pd->switchers[pd->num_switchers++].mode = sw;
- }
- else{
+ } else {
// Report error, don't continue.
fprintf ( stderr, "Invalid script switcher: %s\n", token );
token = NULL;
}
}
- // Keybinding.
}
// Free string that was modified by strtok_r
g_free ( switcher_str );