1############################################################## 2## This is the example bindings file. Copy it to ## 3## $XDG_CONFIG_HOME/ncmpcpp/bindings or ~/.ncmpcpp/bindings ## 4## and set up your preferences. ## 5############################################################## 6## 7##### General rules ##### 8## 9## 1) Because each action has runtime checks whether it's 10## ok to run it, a few actions can be bound to one key. 11## Actions will be bound in order given in configuration 12## file. When a key is pressed, first action in order 13## will test itself whether it's possible to run it. If 14## test succeeds, action is executed and other actions 15## bound to this key are ignored. If it doesn't, next 16## action in order tests itself etc. 17## 18## 2) It's possible to bind more that one action at once 19## to a key. It can be done using the following syntax: 20## 21## def_key "key" 22## action1 23## action2 24## ... 25## 26## This creates a chain of actions. When such chain is 27## executed, each action in chain is run until the end of 28## chain is reached or one of its actions fails to execute 29## due to its requirements not being met. If multiple actions 30## and/or chains are bound to the same key, they will be 31## consecutively run until one of them gets fully executed. 32## 33## 3) When ncmpcpp starts, bindings configuration file is 34## parsed and then ncmpcpp provides "missing pieces" 35## of default keybindings. If you want to disable some 36## bindings, there is a special action called 'dummy' 37## for that purpose. Eg. if you want to disable ability 38## to crop playlists, you need to put the following 39## into configuration file: 40## 41## def_key "C" 42## dummy 43## 44## After that ncmpcpp will not bind any default action 45## to this key. 46## 47## 4) To let you write simple macros, the following special 48## actions are provided: 49## 50## - push_character "character" - pushes given special 51## character into input queue, so it will be immediately 52## picked by ncmpcpp upon next call to readKey function. 53## Accepted values: mouse, up, down, page_up, page_down, 54## home, end, space, enter, insert, delete, left, right, 55## tab, ctrl-a, ctrl-b, ..., ctrl-z, ctrl-[, ctrl-\\, 56## ctrl-], ctrl-^, ctrl-_, f1, f2, ..., f12, backspace. 57## In addition, most of these names can be prefixed with 58## alt-/ctrl-/shift- to be recognized with the appropriate 59## modifier key(s). 60## 61## - push_characters "string" - pushes given string into 62## input queue. 63## 64## - require_runnable "action" - checks whether given action 65## is runnable and fails if it isn't. This is especially 66## useful when mixed with previous two functions. Consider 67## the following macro definition: 68## 69## def_key "key" 70## push_characters "custom_filter" 71## apply_filter 72## 73## If apply_filter can't be currently run, we end up with 74## sequence of characters in input queue which will be 75## treated just as we typed them. This may lead to unexpected 76## results (in this case 'c' will most likely clear current 77## playlist, 'u' will trigger database update, 's' will stop 78## playback etc.). To prevent such thing from happening, we 79## need to change above definition to this one: 80## 81## def_key "key" 82## require_runnable "apply_filter" 83## push_characters "custom_filter" 84## apply_filter 85## 86## Here, first we test whether apply_filter can be actually run 87## before we stuff characters into input queue, so if condition 88## is not met, whole chain is aborted and we're fine. 89## 90## - require_screen "screen" - checks whether given screen is 91## currently active. accepted values: browser, clock, help, 92## media_library, outputs, playlist, playlist_editor, 93## search_engine, tag_editor, visualizer, last_fm, lyrics, 94## selected_items_adder, server_info, song_info, 95## sort_playlist_dialog, tiny_tag_editor. 96## 97## - run_external_command "command" - runs given command using 98## system() function. 99## 100## - run_external_console_command "command" - runs given console 101## command using system() function. 102## 103## 104## 5) In addition to binding to a key, you can also bind actions 105## or chains of actions to a command. If it comes to commands, 106## syntax is very similar to defining keys. Here goes example 107## definition of a command: 108## 109## def_command "quit" [deferred] 110## stop 111## quit 112## 113## If you execute the above command (which can be done by 114## invoking action execute_command, typing 'quit' and pressing 115## enter), ncmpcpp will stop the player and then quit. Note the 116## presence of word 'deferred' enclosed in square brackets. It 117## tells ncmpcpp to wait for confirmation (ie. pressing enter) 118## after you typed quit. Instead of 'deferred', 'immediate' 119## could be used. Then ncmpcpp will not wait for confirmation 120## (enter) and will execute the command the moment it sees it. 121## 122## Note: while command chains are executed, internal environment 123## update (which includes current window refresh and mpd status 124## update) is not performed for performance reasons. However, it 125## may be desirable to do so in some situration. Therefore it's 126## possible to invoke by hand by performing 'update enviroment' 127## action. 128## 129## Note: There is a difference between: 130## 131## def_key "key" 132## action1 133## 134## def_key "key" 135## action2 136## 137## and 138## 139## def_key "key" 140## action1 141## action2 142## 143## First one binds two single actions to the same key whilst 144## second one defines a chain of actions. The behavior of 145## these two is different and is described in (1) and (2). 146## 147## Note: Function def_key accepts non-ascii characters. 148## 149##### List of unbound actions ##### 150## 151## The following actions are not bound to any key/command: 152## 153## - set_volume 154## - load 155## 156# 157#def_key "mouse" 158# mouse_event 159# 160#def_key "up" 161# scroll_up 162# 163#def_key "shift-up" 164# select_item 165# scroll_up 166# 167#def_key "down" 168# scroll_down 169# 170#def_key "shift-down" 171# select_item 172# scroll_down 173# 174#def_key "[" 175# scroll_up_album 176# 177#def_key "]" 178# scroll_down_album 179# 180#def_key "{" 181# scroll_up_artist 182# 183#def_key "}" 184# scroll_down_artist 185# 186#def_key "page_up" 187# page_up 188# 189#def_key "page_down" 190# page_down 191# 192#def_key "home" 193# move_home 194# 195#def_key "end" 196# move_end 197# 198#def_key "insert" 199# select_item 200# 201#def_key "enter" 202# enter_directory 203# 204#def_key "enter" 205# toggle_output 206# 207#def_key "enter" 208# run_action 209# 210#def_key "enter" 211# play_item 212# 213#def_key "space" 214# add_item_to_playlist 215# 216#def_key "space" 217# toggle_lyrics_update_on_song_change 218# 219#def_key "space" 220# toggle_visualization_type 221# 222#def_key "delete" 223# delete_playlist_items 224# 225#def_key "delete" 226# delete_browser_items 227# 228#def_key "delete" 229# delete_stored_playlist 230# 231#def_key "right" 232# next_column 233# 234#def_key "right" 235# slave_screen 236# 237#def_key "right" 238# volume_up 239# 240#def_key "+" 241# volume_up 242# 243#def_key "left" 244# previous_column 245# 246#def_key "left" 247# master_screen 248# 249#def_key "left" 250# volume_down 251# 252#def_key "-" 253# volume_down 254# 255#def_key ":" 256# execute_command 257# 258#def_key "tab" 259# next_screen 260# 261#def_key "shift-tab" 262# previous_screen 263# 264#def_key "f1" 265# show_help 266# 267#def_key "1" 268# show_playlist 269# 270#def_key "2" 271# show_browser 272# 273#def_key "2" 274# change_browse_mode 275# 276#def_key "3" 277# show_search_engine 278# 279#def_key "3" 280# reset_search_engine 281# 282#def_key "4" 283# show_media_library 284# 285#def_key "4" 286# toggle_media_library_columns_mode 287# 288#def_key "5" 289# show_playlist_editor 290# 291#def_key "6" 292# show_tag_editor 293# 294#def_key "7" 295# show_outputs 296# 297#def_key "8" 298# show_visualizer 299# 300#def_key "=" 301# show_clock 302# 303#def_key "@" 304# show_server_info 305# 306#def_key "s" 307# stop 308# 309#def_key "p" 310# pause 311# 312#def_key ">" 313# next 314# 315#def_key "<" 316# previous 317# 318#def_key "ctrl-h" 319# jump_to_parent_directory 320# 321#def_key "ctrl-h" 322# replay_song 323# 324#def_key "backspace" 325# jump_to_parent_directory 326# 327#def_key "backspace" 328# replay_song 329# 330#def_key "backspace" 331# play 332# 333#def_key "f" 334# seek_forward 335# 336#def_key "b" 337# seek_backward 338# 339#def_key "r" 340# toggle_repeat 341# 342#def_key "z" 343# toggle_random 344# 345#def_key "y" 346# save_tag_changes 347# 348#def_key "y" 349# start_searching 350# 351#def_key "y" 352# toggle_single 353# 354#def_key "R" 355# toggle_consume 356# 357#def_key "Y" 358# toggle_replay_gain_mode 359# 360#def_key "T" 361# toggle_add_mode 362# 363#def_key "|" 364# toggle_mouse 365# 366#def_key "#" 367# toggle_bitrate_visibility 368# 369#def_key "Z" 370# shuffle 371# 372#def_key "x" 373# toggle_crossfade 374# 375#def_key "X" 376# set_crossfade 377# 378#def_key "u" 379# update_database 380# 381#def_key "ctrl-s" 382# sort_playlist 383# 384#def_key "ctrl-s" 385# toggle_browser_sort_mode 386# 387#def_key "ctrl-s" 388# toggle_media_library_sort_mode 389# 390#def_key "ctrl-r" 391# reverse_playlist 392# 393#def_key "ctrl-f" 394# apply_filter 395# 396#def_key "ctrl-_" 397# select_found_items 398# 399#def_key "/" 400# find 401# 402#def_key "/" 403# find_item_forward 404# 405#def_key "?" 406# find 407# 408#def_key "?" 409# find_item_backward 410# 411#def_key "." 412# next_found_item 413# 414#def_key "," 415# previous_found_item 416# 417#def_key "w" 418# toggle_find_mode 419# 420#def_key "e" 421# edit_song 422# 423#def_key "e" 424# edit_library_tag 425# 426#def_key "e" 427# edit_library_album 428# 429#def_key "e" 430# edit_directory_name 431# 432#def_key "e" 433# edit_playlist_name 434# 435#def_key "e" 436# edit_lyrics 437# 438#def_key "i" 439# show_song_info 440# 441#def_key "I" 442# show_artist_info 443# 444#def_key "g" 445# jump_to_position_in_song 446# 447#def_key "l" 448# show_lyrics 449# 450#def_key "ctrl-v" 451# select_range 452# 453#def_key "v" 454# reverse_selection 455# 456#def_key "V" 457# remove_selection 458# 459#def_key "B" 460# select_album 461# 462#def_key "a" 463# add_selected_items 464# 465#def_key "c" 466# clear_playlist 467# 468#def_key "c" 469# clear_main_playlist 470# 471#def_key "C" 472# crop_playlist 473# 474#def_key "C" 475# crop_main_playlist 476# 477#def_key "m" 478# move_sort_order_up 479# 480#def_key "m" 481# move_selected_items_up 482# 483#def_key "n" 484# move_sort_order_down 485# 486#def_key "n" 487# move_selected_items_down 488# 489#def_key "M" 490# move_selected_items_to 491# 492#def_key "A" 493# add 494# 495#def_key "S" 496# save_playlist 497# 498#def_key "o" 499# jump_to_playing_song 500# 501#def_key "G" 502# jump_to_browser 503# 504#def_key "G" 505# jump_to_playlist_editor 506# 507#def_key "~" 508# jump_to_media_library 509# 510#def_key "E" 511# jump_to_tag_editor 512# 513#def_key "U" 514# toggle_playing_song_centering 515# 516#def_key "P" 517# toggle_display_mode 518# 519#def_key "\\" 520# toggle_interface 521# 522#def_key "!" 523# toggle_separators_between_albums 524# 525#def_key "L" 526# toggle_lyrics_fetcher 527# 528#def_key "F" 529# fetch_lyrics_in_background 530# 531#def_key "alt-l" 532# toggle_fetching_lyrics_in_background 533# 534#def_key "ctrl-l" 535# toggle_screen_lock 536# 537#def_key "`" 538# toggle_library_tag_type 539# 540#def_key "`" 541# refetch_lyrics 542# 543#def_key "`" 544# add_random_items 545# 546#def_key "ctrl-p" 547# set_selected_items_priority 548# 549#def_key "q" 550# quit 551# 552