Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions doc/config
Original file line number Diff line number Diff line change
Expand Up @@ -627,3 +627,14 @@
#
#active_window_border = red
#
## By default all default key bindings are loaded unless explicitly override in
## local bindings in ~/.ncmpcpp/bindings or $XDG_CONFIG_HOME/ncmpcpp/bindings
##
## This config will disable that behaviour when set to no
##
## Note: with this config enabled it is required to have atlease one
## key defined in bindings file
## i.e ncmpcpp crashes if bindings file is empty or not found in expected
## path
# default_bindings = yes
#
6 changes: 5 additions & 1 deletion src/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ bool configure(int argc, char **argv)
("ignore-config-errors", "ignore unknown and invalid options in configuration files")
("test-lyrics-fetchers", "check if lyrics fetchers work")
("bindings,b", po::value<std::vector<std::string>>(&bindings_paths)->value_name("PATH")->default_value(default_bindings_paths, join<std::string>(default_bindings_paths, " AND ")), "specify bindings file(s)")
("no-default-bindings", "disable default keybindings")
("screen,s", po::value<std::string>()->value_name("SCREEN"), "specify the startup screen")
("slave-screen,S", po::value<std::string>()->value_name("SCREEN"), "specify the startup slave screen")
("help,?", "show help message")
Expand Down Expand Up @@ -194,7 +195,9 @@ bool configure(int argc, char **argv)
std::for_each(bindings_paths.begin(), bindings_paths.end(), expand_home);
if (Bindings.read(bindings_paths) == false)
exit(1);
Bindings.generateDefaults();

if ((vm.count("no-default-bindings") == false) && (Config.default_bindings == true))
Bindings.generateDefaults();

// create directories
boost::filesystem::create_directories(Config.ncmpcpp_directory);
Expand Down Expand Up @@ -270,3 +273,4 @@ bool configure(int argc, char **argv)
}
return true;
}

1 change: 1 addition & 0 deletions src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,7 @@ bool Configuration::read(const std::vector<std::string> &config_paths, bool igno
p.add("window_border_color", &window_border, "green", verbose_lexical_cast<NC::Color>);
p.add("active_window_border", &active_window_border, "red",
verbose_lexical_cast<NC::Color>);
p.add("default_bindings", &default_bindings, "yes", yes_no);

return std::all_of(
config_paths.begin(),
Expand Down
1 change: 1 addition & 0 deletions src/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ struct Configuration
bool allow_for_physical_item_deletion;
bool media_library_albums_split_by_date;
bool startup_slave_screen_focus;
bool default_bindings;

unsigned mpd_connection_timeout;
unsigned crossfade_time;
Expand Down