Allow to preselect preset text
Thomas Lübking thomas.luebking@gmail.com
1 files changed,
6 insertions(+),
0 deletions(-)
jump to
M
util/fbrun/main.cc
→
util/fbrun/main.cc
@@ -65,6 +65,7 @@ " -fg [color name] Foreground text color"<<endl<<
" -bg [color name] Background color"<<endl<< " -na Disable antialias"<<endl<< " -hf [history file] History file to load (default ~/.fluxbox/fbrun_history)"<<endl<< + " -preselect Select preset text"<<endl<< " -help Show this help"<<endl<<endl<< "Example: fbrun -fg black -bg white -text xterm -title \"run xterm\""<<endl; }@@ -76,6 +77,7 @@ bool set_height = false, set_width=false; // use height/width of font by default
bool set_pos = false; // set position bool near_mouse = false; // popup near mouse bool print = false; + bool preselect = false; string fontname; // font name string title("Run program"); // default title string text; // default input text@@ -115,6 +117,8 @@ } else if (strcmp(argv[i], "-bg") == 0 && i+1 < argc) {
background = argv[++i]; } else if (strcmp(argv[i], "-hf") == 0 && i+1 < argc) { history_file = argv[++i]; + } else if (strcmp(argv[i], "-preselect") == 0) { + preselect = true; } else if (arg == "-h" || arg == "-help" || arg == "--help") { showUsage(argv[0]); exit(0);@@ -159,6 +163,8 @@ cerr<<"FbRun Warning: Failed to load history file: "<<expanded_filename<<endl;
fbrun.setTitle(title); fbrun.setText(text); + if (preselect) + fbrun.selectAll(); if (near_mouse) {