diff options
author | Mathias Gumz <akira at fluxbox dot org> | 2013-01-31 08:13:45 (GMT) |
---|---|---|
committer | Mathias Gumz <akira at fluxbox dot org> | 2013-01-31 08:14:06 (GMT) |
commit | dc47491533e0ca7cf5a5386a10e68fbaf873e9db (patch) | |
tree | 4ee0c68722207189912a106d3f77e9cab52e65a8 /src/FbTk | |
parent | 716532dd47d718cb548da5f65b53a8b744ce235f (diff) | |
download | fluxbox-dc47491533e0ca7cf5a5386a10e68fbaf873e9db.zip fluxbox-dc47491533e0ca7cf5a5386a10e68fbaf873e9db.tar.bz2 |
Adds 'ClientPatternTest' command
ClientPatterns might be tricky to get right. Instead of fiddling around in
either the keys-file or the apps-file and restarting fluxbox to see if the
changes had any effect / matched the right windows, 'ClientPatternTest' and
the fluxbox-remote should make this easier:
$> fluxbox-remote "clientpatterntest (title=.*vim*)"
This causes fluxbox to store the list of matched windows in the
_FLUXBOX_ACTION_RESULT property onto the rootwindow. This property might
then be read by:
$> xprop -root _FLUXBOX_ACTION_RESULT
or
$> fluxbox-remote result
The format of the list is:
win_id \t title_of_window \n
win_id is '-1' when fluxbox wasn't able to parse the given ClientPattern.
win_id is '0' when there are no windows matching the given ClientPattern.
Diffstat (limited to 'src/FbTk')
-rw-r--r-- | src/FbTk/StringUtil.cc | 9 | ||||
-rw-r--r-- | src/FbTk/StringUtil.hh | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/FbTk/StringUtil.cc b/src/FbTk/StringUtil.cc index 0dcd989..fa809be 100644 --- a/src/FbTk/StringUtil.cc +++ b/src/FbTk/StringUtil.cc | |||
@@ -145,10 +145,17 @@ int extractNumber(const std::string& in, unsigned long long& out) { | |||
145 | 145 | ||
146 | std::string number2String(long long num) { | 146 | std::string number2String(long long num) { |
147 | char s[128]; | 147 | char s[128]; |
148 | sprintf(s, "%lld", num); | 148 | snprintf(s, sizeof(s), "%lld", num); |
149 | return std::string(s); | 149 | return std::string(s); |
150 | } | 150 | } |
151 | 151 | ||
152 | std::string number2HexString(long long num) { | ||
153 | char s[17]; | ||
154 | snprintf(s, sizeof(s), "%lx", num); | ||
155 | return std::string(s); | ||
156 | } | ||
157 | |||
158 | |||
152 | /** | 159 | /** |
153 | Tries to find a string in another and | 160 | Tries to find a string in another and |
154 | ignoring the case of the characters | 161 | ignoring the case of the characters |
diff --git a/src/FbTk/StringUtil.hh b/src/FbTk/StringUtil.hh index 538828b..930e0b5 100644 --- a/src/FbTk/StringUtil.hh +++ b/src/FbTk/StringUtil.hh | |||
@@ -44,6 +44,7 @@ int extractNumber(const std::string& in, unsigned long long& out); | |||
44 | 44 | ||
45 | /// creates a number to a string | 45 | /// creates a number to a string |
46 | std::string number2String(long long num); | 46 | std::string number2String(long long num); |
47 | std::string number2HexString(long long num); | ||
47 | 48 | ||
48 | /// Similar to `strstr' but this function ignores the case of both strings | 49 | /// Similar to `strstr' but this function ignores the case of both strings |
49 | const char *strcasestr(const char *str, const char *ptn); | 50 | const char *strcasestr(const char *str, const char *ptn); |