Commit graph

433 commits

Author SHA1 Message Date
Mark Tiefenbruck
ee9c0a34ba Patch from Dmytro Bagrii
Fix fbrun completion search for last directory in PATH
2021-07-06 16:10:30 -07:00
Pete Beardmore
248b15c25f fbrun, add horizontal padding option 2018-03-14 07:49:50 +01:00
kottroll
05d860eda7 rm not needed newlines 2018-03-11 13:35:56 +01:00
Thomas Lübking
e480255a79 remove dead switch from help 2016-11-20 14:08:25 +01:00
Thomas Lübking
507782e5d4 escape special chars in filenames
This follows the escaped chars in bash completion and allows to pass
filenames with spaces etc.
Using quotes would be another option but requires special handling of
"~" and, what's worse, either hand-correcting the cursor position (into
the quoted area) or more completion mumbo-jumbo to handle the quotes.
2016-09-22 21:04:01 +02:00
Thomas Lübking
39b34a9109 fix segfault when completing ~ or .
ie. w/o any / in the given path we'll get an irregular split point and
thus out of bounds array access
2016-09-22 21:03:35 +02:00
Thomas Lübking
31e758f1f1 fix display $WPSETTER
BUG: 1031
2016-09-03 20:08:14 +02:00
Thomas Lübking
e8021e3697 handle DISPLAY :x and :x.0 idem
Patch originally provided by Francesco Poli to Debian

BUG: 1052
2016-09-03 20:08:14 +02:00
Thomas Lübking
2cfffee19b handle subdirs and symlinks in $wallpaperdir
Thanks for the base patch, kindly provided by some Anonymous coward
on the bugtracker ;-)

BUG: 1065
2016-09-03 20:08:14 +02:00
Thomas Lübking
baaf477d46 add support for dedicated completion data
This allows to complete random things, useful along the -print flag but
also to limit the commands to those found my menumaker etc.
2016-07-23 16:58:04 +02:00
Thomas Lübking
8094f4d1a9 Allow to center fbrun
While any window can be centered using the apps file, fbrun can serve many
purposes and sometimes (runner) makes sense being centered, sometimes
(button/menu triggered input) near the mouse, sometimes ("application")
regularily placed.

REQUEST: 282
2016-07-23 16:58:04 +02:00
Thomas Lübking
0ca5daf997 limit fbrun history size
the default is 1024-1025, values are read from the FBRUN_HISTORY_SIZE
environment variable
NOTICE: the limit isn't hard, but will typically be n+1 and only n if
the new entry is already present in the last n entries

REQUEST: 202
2016-07-23 16:58:04 +02:00
Thomas Lübking
e85dc01d28 add autocompletion support to fbrun 2016-07-23 16:58:04 +02:00
Thomas Lübking
d741b6fe6e improve fbrun completion
- streamline code
- indicate completion by making use of selection
- fix buggy behavior (notably subsequent completions and FS path
  following)
- support "~" in paths
- support chunk completion
  (ie. "mp[layer] ~/vid[eos/favporn.mp4]" can be completed in both
   tokens; buggy with paths including spaces in non-leafs)

REQUEST: 223
2016-07-23 16:58:04 +02:00
Thomas Lübking
7525226fe2 less bashisms in fluxbox-generate_menu
still works with bash or zsh, but fish (now) complains about "cat << EOF" ...

no "grep -q"
BUG: 961

echo is troublesome
POSIX doesn't know a "local" keyword
BUG: 975

seems double comments ## aren't supported everywhere
BUG: 1057
2016-07-03 09:30:51 +02:00
Thomas Lübking
848875eb92 Revert "bugfix: fbsetroot needs to use 24bit visuals as well"
This reverts commit 4f4d5e25d9.

The patch resolved a problem introduced by the ::setDepth abuse in
FbRootWindow, but this fails if the root window is *really* 32bit
With commit dcdde4d, the broken workaround depth selection is no longer
required.

BUG: 1093
2016-07-02 05:36:34 +02:00
Mathias Gumz
a11035440c fix fbsetbg in combination with picky shells
in *BSD, /bin/sh is Almquist Shell(ash). the 'hash' built-in command of ash
returns 0, always. 'hash' is not usable for find_it() function in
util/fbsetbg and util/fluxbox-generate_menu.in.

this patch changes the behavior of find_it(): when 'hash' is detected to
not work correctly, switch back to 'which'.


this patch is the work of Yamashiro, Jun and appeared first as patch-160
on sourceforge: https://sourceforge.net/p/fluxbox/patches/160/. i submit
it on behalf of the author.
2016-04-25 20:11:14 +02:00
Thomas Lübking
7b8e4413f8 Allow to preselect preset text 2016-04-25 19:04:13 +02:00
John Sennesael
22866c4d30 fixes bug #1138 2016-01-09 20:20:53 +01:00
Oliver Gondža
c7462f09a4 fbsetbg: Report wallpaper directory path when invalid 2015-08-10 21:52:49 +02:00
Mathias Gumz
fff0abad76 Improve I18n support
Among the first steps to produce better i18n support is to test the created
translations adhoc without running "make install". To achieve this, fluxbox
now honors several environment variables:

- NLSPATH: fluxbox won't create the absolute path to the catalog and thus
  catopen() is free to use NLSPATH as described in the manpage. Example
  given: "/tmp/%N" will pick "/tmp/fluxbox.cat". %N refers to FLUXBOX_CATFILE.

- FLUXBOX_CATFILE: By setting FLUXBOX_CATFILE the users can make fluxbox to
  use a different name for the catalog file.  Default: "fluxbox.cat"

- FLUXBOX_CATDIR: Per default fluxbox tries to find FLUXBOX_CATFILE at several
  places. Setting this environment variable allows to point fluxbox to a
  different search path for the catalog files.

Then, fluxbox tries catopen() first without changing the deduced catalog file
name. After that it applies some heuristics to get a good catalog file name.
2015-01-31 21:37:44 +01:00
Mathias Gumz
0a87632032 Clean up FbTk::I18n API
Move private stuff into FbTk/I18n.cc.
2015-01-31 12:04:30 +01:00
Mathias Gumz
da285bcb11 Add chrome* to fluxbox-generate_menu 2015-01-29 13:24:57 +01:00
Daniel Campbell
fc245408d6 Fix printf bug in fluxbox-generate_menu 2015-01-25 13:37:31 +01:00
Mathias Gumz
6721c7c70b Add 'lxterminal' and 'geany' to fbgm
Implements #305 (feature request "Recognize lxterminal and geany
(fluxbox-generate_menu)"
2015-01-24 19:17:02 +01:00
Mathias Gumz
ad8e6da8ef Make coverity happy
Coverity complaints about 'isdigit(whole_keyfile[pos])' is changing the
validity of 'keyfile' (which itself is just a copy of whole_keyfile.c_str()).

This might be a valid claim, it might be not. By using the 'keyfile'
variable we make Coverity happy and achieve the same behavior.
2015-01-16 10:45:39 +01:00
Mathias Gumz
f8d0bd4cb3 Fix build-system: install data files (keys, apps, menu ...)
* Correctly build data files when operate outside of the $(srcdir)
* Actually install data files
* Use pkg-config to detect X11, works better on MacOSX. We used pkg-config
  already anyway, double checking for X11 does not yield better results.
* Replace EXEEXT in some files while before installing them
2015-01-05 15:08:32 +01:00
Mathias Gumz
0820bcb640 Fix build-system: use xxx_LDADD instead of xxx_LDFLAGS
xxx_LDFLAGS place the libraries like '-lX11' or '-lXft' at the beginning of
the linker command. Some systems were not able to handle the situation and
this lead to a lot of unresolved symbols. Reading the documentation of
automake:

    ... you can use LDADD to do so. This variable is used to specify
    additional objects or libraries to link with; it is inappropriate for
    specifying specific linker flags, you should use AM_LDFLAGS for this
    purpose.

In addition we link against -lm in order to satisfy symbols refering to 'cos'
and 'sin'.
2015-01-04 16:21:02 +01:00
Mathias Gumz
63f9a1637f Clean unused variables 2015-01-03 21:42:24 +01:00
Mathias Gumz
bd519dd952 Remove various unused variables
Clang and Gcc-4.9 complaint about some unused variables here
and there. And who are we to not make a compiler happy :)
2015-01-03 18:43:44 +01:00
Mathias Gumz
74df62b081 Remove unused code / option from FbRun 2015-01-03 18:39:46 +01:00
Mathias Gumz
376ed523cb Update release version 2015-01-03 14:07:34 +01:00
Mathias Gumz
a3c0b049bf Fix corruption of fbrun-history
This commit fixes issues #72 (brought up + different solution by Mattias
Guns; I received a similar patch by 'Nable 80' via ML and discussed the
issue in #fluxbox with 'Nable 80'), patch #73 (Mattias Guns) and finally
patch #162 (Ulrich Eckhardt; this commit is heavily based upon Ulrich's
work).

The original code was overly complex. It tried to avoid writing
bytes to the disk at the expense of comprehensibility and as a result it
was buggy. I looked at both patches from Mattias and 'Nable 80' which address
the bug with skipping entries in the history-file (my fault: incorrect use
of outfile.ignore(1, '\n')): They provided a proper fix for the problem
but I decided to use Ulrich's code since it improves the whole code by making
it a lot simpler.

So, kudos to all of you.
2015-01-02 17:08:44 +01:00
Mathias Gumz
0e8a27e931 Fix loading fbrun-history
Previous code add one additional entry on loading the history. This
commit is one part of the patch #162 (see [1] and [2]), written
by Ulrich Eckhardt <doomster@knuut.de>.

[1]: https://sourceforge.net/p/fluxbox/patches/162/
[2]: https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=10;filename=fbrun-bug636632.patch;att=1;bug=636632
2015-01-02 16:45:39 +01:00
Mathias Gumz
e105de7d46 merge Sami Kerola's new build-system 2014-04-11 17:42:40 +02:00
Mathias Gumz
3696562aa8 update of copyright info 2014-02-17 20:14:49 +01:00
Mathias Gumz
f464f24eb3 fix detection of $HOME folder
usually $HOME is set when fluxbox runs. in some rare scenarios (eg., fuzzying
binaries to detect bugs) one could launch fluxbox by using 'env -i' and thus
eliminating $HOME from the environment. to prevent crashes fluxbox uses now
'getpwuid()' when $HOME is not set to detect the home folder.
2013-06-29 08:39:02 +02:00
Paul Tagliamonte
34656ac622 Returning EXIT_FAILURE on exit in fluxbox-remote. 2013-06-18 18:02:38 +02:00
Sami Kerola
7541054b29 build-sys: move to non-recursive build
This rather large change will attempts to make 'make' to work better.
See excellent paper 'Recursive Make Considered Harmful' by Peter Miller
for further explanation why several make files is worse than one for
whole project.

Note.  The tests are build with 'make check' rather than defining TEST.

Reference: http://miller.emu.id.au/pmiller/books/rmch/
Reference: http://karelzak.blogspot.co.uk/2013/02/non-recursive-automake.html
2013-05-26 10:38:11 +01:00
Sami Kerola
9e5eddfc3d build-sys: use pkg-config to locate dependencies
This commit alters XRANDR (X Resize And Rotate) extension dependency,
which is expected to have at least version 1.4.  Earlier old versions of
xrandr were supported, at least to some extent.
2013-05-26 10:38:10 +01:00
Sami Kerola
47b9786533 build-sys: use AC_USE_SYSTEM_EXTENSIONS
The earlier _GNU_SOURCE definitions possibly did not take effect
everywhere where it was intended.
2013-05-26 10:38:10 +01:00
Sami Kerola
73b7958770 build-sys: include config.h to all files using automake
Do not try to be too smart which compilations need config.h, as most of
them will simply because of the config.h has information about system
capabilities.
2013-05-26 10:38:10 +01:00
Mathias Gumz
ac27c8cb42 Updates copyright date information in some binaries 2013-02-14 19:45:17 +01:00
Mathias Gumz
dc47491533 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.
2013-01-31 09:14:06 +01:00
Sami Kerola
f12e149baf automake: use AM_CPPFLAGS rather than INCLUDES
The INCLUDES macro deprecated in favour of AM_CPPFLAGS.

References: http://www.gnu.org/software/automake/manual/html_node/Program-Variables.html
2013-01-03 08:17:27 +01:00
Sami Kerola
be2c52a146 util/fluxbox-generate_menu: default browswer variable can be empty
Noticed when debugging in mac.
2013-01-02 10:08:04 +01:00
Sami Kerola
dcdfdfd56b utils: remove bashisms
fbsetbg: The random number generation used 'time' shell internal, which
does not exist in all shells.  Allowing 'ps' output to be part of cksum
input will increase entropy and enhance quality of the randomness.

fbsetbg: The second fix is more important.  In posix shell there is no
'==' comparision operator.

fluxbox-generate_menu: There are no quarantees about echo accepting
options, so use 'printf' for more advanced outputing.
2013-01-02 10:01:00 +01:00
Vladimir A. Pavlov
7a404e7fbc Store XClassHint on stack, not in dynamic memory 2012-12-30 12:27:37 +01:00
Ryan Pavlik
d70bdbe675 Check .empty() instead of .size() == 0
Found with cppcheck.
2012-01-04 07:54:46 +01:00
Ryan Pavlik
f859e78cb2 Exceptions should be caught by reference.
Found using cppcheck.
2012-01-04 07:51:35 +01:00