Commit graph

39 commits

Author SHA1 Message Date
Daniel Hahler
eb7aa511fb awesome-client: simplify/fix ISATTY usage (#1151)
ISATTY was a bit confusing and can be replaced by `[ -t 0 ]`.

Followup to 4ce1608.
2016-10-09 22:36:03 +02:00
Daniel Hahler
2fb8492076 awesome-client: allow override of rlwrap (#1150)
This is necessary when being run with a tty that has no width, which
happens when using https://github.com/metakirby5/codi.vim/ in Vim 8 (but
not Neovim), where rlwrap complains as follows:

> rlwrap: error: My terminal reports width=0 (is it emacs?) I can't
> handle this, sorry!
2016-10-07 23:32:58 +02:00
Uli Schlachter
4ce16084ff awesome-client: Handle errors when running arguments
Commit 78abb4a54c made awesome-client fail with a
non-zero exit code when sending a command that it got from stdin failed.

Commit f0f31bc305 added the possibility to specify
commands to run as arguments to awesome-client. However, the exit code was still
zero even when such a command failed.

This commit makes awesome-client signal errors with its exit code even for code
specified via arguments.

Note that this means that following arguments will not be executed if some
argument fails. I do not know if this is the best behaviour or not, but I am
implementing it like this here due to its simplicity to implement.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-08-31 17:44:43 +02:00
Fernando Vezzosi
f0f31bc305 awesome-client: send command line arguments to awesome (#1058)
In some languages, invoking commands with command-line arguments is
significantly simpler than setting up pipes for writing to a command's
standard input.

This adds an additional way for sending commands through awesome-client;
so all of these will be equivalent:

  $ awesome-client 'awesome.restart()'
  $ echo 'awesome.restart()' | awesome-client
  $ awesome-client <<<'awesome.restart()'
  $ awesome-client
  awesome# awesome.restart()
  awesome# ^D
  $

Note that this sends each command line argument as a separate message
over dbus.
2016-08-30 12:58:54 +02:00
Uli Schlachter
5db6c04c42 Add vim modelines to all shell scripts
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-12 17:36:35 +01:00
Daniel Hahler
7b233f3d37 awesome-client: do not send empty requests 2015-07-26 00:40:43 +02:00
Daniel Hahler
78abb4a54c Improved awesome-client: exit code, bash, prompt
- exit with a non-zero status code when dbus-send fails.
   If awesome does not respond to the D-Bus message, e.g. because it is not
   running (yet), awesome-client now returns with a non-zero return code.
   This can be used to check if awesome has finished starting up, which is
   meant to be used for the functional test runner.
 - changed the shebang to use bash directly, which simplifies the logic
   to detect/handle "bash as /bin/sh" and allows to use `set -o pipefail`
   (which makes handling the D-Bus error easier - without using a subshell).
 - fix the prompt: now with trailing space, and the prompt is actually used
   (which wasn't the case with /bin/sh not pointing at bash before).

Closes https://github.com/awesomeWM/awesome/pull/304.
2015-07-14 00:24:33 +02:00
Uli Schlachter
ff71347016 Remove all traces of awsetbg and wallpaper setters
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-07-29 15:38:31 +02:00
Julien Danjou
3762cbd5c7 awsetbg: xli is reported as ok
Signed-off-by: Julien Danjou <julien@danjou.info>
2011-12-09 10:44:43 +01:00
Jacques-Pascal Deplaix
a9bedf39d8 awsetbg: Add the aspect option with feh
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-29 21:22:39 +02:00
Enric Morales
38d97bd070 Add imlibsetroot setter to awsetbg script.
Signed-off-by: Enric Morales <spam@enric.me>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-05-02 21:47:56 +02:00
Julien Danjou
7008d927f9 awesome-client: allow to send multi line code
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-12-16 11:55:51 +01:00
Alexandre "kAworu" Perrin
7c8e096a62 avoid using seq in awsetbg, and test for columns count argument of -m option.
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-11 17:08:58 +02:00
fabschub
5b8ad722a1 awsetbg was missing break
Signed-off-by: fabschub <fabschub@gmx.de>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-17 15:57:21 +02:00
Julien Danjou
7d1fb8bcf5 Fix awesome-client parameters
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-11 10:01:28 +02:00
Uli Schlachter
4e92699cb0 Check for xwininfo before using it
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-03 10:59:43 +02:00
Julien Danjou
eb402b5a34 Move wmsetbg as a last option (FS#737)
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-03-25 10:25:35 +01:00
Adrian C. (anrxc)
44271e0977 awsetbg: add fvwm-root support
fvwm-root is a part of the FVWM window manager, and is one of those
utilities that properly support transparency because it can retain and
publish the Pixmap with which the background has been set. It supports
XBM, XPM, PNG and SVG image formats, but is not very rich in options
as opposed to habak or feh.

Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-03-01 16:00:58 +01:00
Brian Gianforcaro
3145e3145e Grammar/spelling corrections in comments and docs.
Signed-off-by: Brian Gianforcaro <b.gianfo@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-31 10:39:36 +02:00
Julien Danjou
cbff5fe9dd awful: split D-Bus name from awesome
awful uses its own namespace in D-Bus

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-15 20:52:40 +02:00
Jonny Lamb
88be323e4a dbus: Use org.naquadah.awesome instead of org.awesome.
http://dbus.freedesktop.org/doc/dbus-specification.html#naming-conventions

Signed-off-by: Jonny Lamb <jonny@debian.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-15 20:42:28 +02:00
Paweł Zuzelski
1fe239e577 unbash awesome-client
-e and -p options for read are bashizm, so awesome-client don't work
if /bin/sh is something other than bash (for example it fails with
pdksh which is default shell on PLD Linux).

The simplest sollution is 's,#!/bin/sh,#!/bin/bash,'. But I believe
that it is better to patch script so it will work with any POSIX
compliant shell.

Attached patch checks if shell is bash. If no it disables use of
non-standard read options.

I've also changed `` to $(), as backquotes are obsolete and
shouldn't be used.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-12 09:27:12 +02:00
Uli Schlachter
7bd08e683c awesome-client: Use /bin/sh instead of /bin/bash
All bashisms should be fixed (hopefully).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-05-10 10:54:27 +02:00
Uli Schlachter
b04aaa8ad5 awesome-client: Fix bashism
Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-05-10 10:48:38 +02:00
Uli Schlachter
9e49865d3f awesome-client: Properly exit when dbus-send isn't found
Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-05-10 10:48:27 +02:00
Julien Danjou
b38ebbeac1 awesome-client: use readline and no backslash
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-30 00:32:06 +02:00
Julien Danjou
4f1eac6fa5 awesome-client: we use bash extensions
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-30 00:26:53 +02:00
Nikos Ntarmos
5ad3eb8021 Fix display misbehaving as a wpsetter.
ImageMagick's display returns 1 if it is to draw on the root window.
Teach awsetbg that this is not an error condition.

Signed-off-by: Nikos Ntarmos <ntarmos@cs.uoi.gr>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-29 15:32:20 +02:00
Uli Schlachter
b6db5137fc awesome-client: Use rlwrap if it is available
This should make this more usable again. The old C version used readline, if
possible and now the new bash version does too. :)

The idea to use rlwrap is from jd and it's a good one.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-04-18 14:05:14 +02:00
Julien Danjou
f79cd42c33 import new awesome-client using D-Bus
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-08 17:30:18 +02:00
Perrin "kAworu" Alexandre
9b72694836 awsetbg: fix wallpapersetter detection
Signed-off-by: Perrin "kAworu" Alexandre <kaworu(a)kaworu,ch>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-01-20 19:32:45 +01:00
koniu
46b3a14a8f awsetbg: add solid xsetroot fallback if no real wpsetters
Signed-off-by: koniu <gkusnierz@gmail.com>
2008-12-01 19:37:03 +01:00
Julien Danjou
5afca2e182 awsetbg: remove -B option
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-11-21 11:35:03 +01:00
Pawel F
530b170cf0 awsetbg: add habak support
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-11-20 10:40:44 +01:00
Sébastien Gross
edd0ae73e2 awsetbg: Add montage(1) support
* Using -m X (X standing for screen number) the give background image is
  converted to a big image in the <cache directory>/montage.png.
  Limitations:
    + -m should be the last argument before the image name
    + for better results screens should have the same sizes and the background
      image should fit one screen size.

Signed-off-by: Sébastien Gross <seb-awesome@chezwam.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-11-19 14:18:35 +01:00
MATSUU Takuto
735dacbe3e awsetbg: enhance display command
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-10-01 09:26:03 +02:00
MATSUU Takuto
79acfa7a65 awsetbg: mkdir recursive
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-10-01 09:26:03 +02:00
Julien Danjou
306c20dd95 awsetbg: fix typo
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-09-13 13:33:23 +02:00
Julien Danjou
72145f66fb utils: add awsetbg to set background
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-08-21 11:33:27 +02:00