diff options
author | Thomas Lübking <thomas.luebking@gmail.com> | 2016-04-24 20:49:51 (GMT) |
---|---|---|
committer | Mathias Gumz <akira@fluxbox.org> | 2016-04-25 17:04:13 (GMT) |
commit | 7b8e4413f8c68f13a36945b9482218ec6be4be5e (patch) | |
tree | ab8272dbbdf22aa90688173ea497cfd26465692b /util | |
parent | 58b50fb786a15fb1740a3d900e271d0baa6b5482 (diff) | |
download | fluxbox-7b8e4413f8c68f13a36945b9482218ec6be4be5e.zip fluxbox-7b8e4413f8c68f13a36945b9482218ec6be4be5e.tar.bz2 |
Allow to preselect preset text
Diffstat (limited to 'util')
-rw-r--r-- | util/fbrun/main.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/util/fbrun/main.cc b/util/fbrun/main.cc index 16ca923..c47788a 100644 --- a/util/fbrun/main.cc +++ b/util/fbrun/main.cc | |||
@@ -65,6 +65,7 @@ void showUsage(const char *progname) { | |||
65 | " -bg [color name] Background color"<<endl<< | 65 | " -bg [color name] Background color"<<endl<< |
66 | " -na Disable antialias"<<endl<< | 66 | " -na Disable antialias"<<endl<< |
67 | " -hf [history file] History file to load (default ~/.fluxbox/fbrun_history)"<<endl<< | 67 | " -hf [history file] History file to load (default ~/.fluxbox/fbrun_history)"<<endl<< |
68 | " -preselect Select preset text"<<endl<< | ||
68 | " -help Show this help"<<endl<<endl<< | 69 | " -help Show this help"<<endl<<endl<< |
69 | "Example: fbrun -fg black -bg white -text xterm -title \"run xterm\""<<endl; | 70 | "Example: fbrun -fg black -bg white -text xterm -title \"run xterm\""<<endl; |
70 | } | 71 | } |
@@ -76,6 +77,7 @@ int main(int argc, char **argv) { | |||
76 | bool set_pos = false; // set position | 77 | bool set_pos = false; // set position |
77 | bool near_mouse = false; // popup near mouse | 78 | bool near_mouse = false; // popup near mouse |
78 | bool print = false; | 79 | bool print = false; |
80 | bool preselect = false; | ||
79 | string fontname; // font name | 81 | string fontname; // font name |
80 | string title("Run program"); // default title | 82 | string title("Run program"); // default title |
81 | string text; // default input text | 83 | string text; // default input text |
@@ -115,6 +117,8 @@ int main(int argc, char **argv) { | |||
115 | background = argv[++i]; | 117 | background = argv[++i]; |
116 | } else if (strcmp(argv[i], "-hf") == 0 && i+1 < argc) { | 118 | } else if (strcmp(argv[i], "-hf") == 0 && i+1 < argc) { |
117 | history_file = argv[++i]; | 119 | history_file = argv[++i]; |
120 | } else if (strcmp(argv[i], "-preselect") == 0) { | ||
121 | preselect = true; | ||
118 | } else if (arg == "-h" || arg == "-help" || arg == "--help") { | 122 | } else if (arg == "-h" || arg == "-help" || arg == "--help") { |
119 | showUsage(argv[0]); | 123 | showUsage(argv[0]); |
120 | exit(0); | 124 | exit(0); |
@@ -159,6 +163,8 @@ int main(int argc, char **argv) { | |||
159 | 163 | ||
160 | fbrun.setTitle(title); | 164 | fbrun.setTitle(title); |
161 | fbrun.setText(text); | 165 | fbrun.setText(text); |
166 | if (preselect) | ||
167 | fbrun.selectAll(); | ||
162 | 168 | ||
163 | if (near_mouse) { | 169 | if (near_mouse) { |
164 | 170 | ||