Skip to content

Commit

Permalink
Add examples and help text for awesome-client (awesomeWM#2162)
Browse files Browse the repository at this point in the history
This adds a -h|--help option to awesome-client. In addition it adds
examples to the awesome-client manpage.
  • Loading branch information
Veratil authored and Elv13 committed Jan 21, 2018
1 parent 19a1ee6 commit 1149e03
Show file tree
Hide file tree
Showing 7 changed files with 202 additions and 14 deletions.
30 changes: 29 additions & 1 deletion manpages/awesome-client.1.de.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ awesome-client - awesome Fenstermanager externe Befehlsschnittstelle
SYNTAX
-------

awesome-client
awesome-client [-h|--help] [command [command...]]

BESCHREIBUNG
------------
Expand All @@ -24,6 +24,34 @@ Wenn 'rlwrap' installiert ist wird es benutzt, um eine readline-Kommandozeilenei

Das Modul 'awful.remote' muss geladen sein, um diesen Befehl zu benutzen.

EXAMPLES
-------
....
$ awesome-client 'return 1+1, "Hello, world"\
double 2
string "Hello, world"

# The following does not return anything on the command line,
# but will show a notification.
$ awesome-client '
> naughty = require("naughty")
> naughty.notify({
> title="CLI Notification",
> text="This is a notification sent from the command line!"})
> '

# Entering read-eval-print-loop mode
# This mode will send every line to awesome, exactly the same as passing
# multiple commands on the command line.
$ awesome-client
awesome# return 1+1
double 2
awesome# return 1+1, "Hello, world"
double 2
string "Hello, world"
awesome#
....

SIEHE AUCH
----------
awesome(1) awesomerc(5)
Expand Down
30 changes: 29 additions & 1 deletion manpages/awesome-client.1.es.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ awesome-client - ejecución remota en el gestor de ventanas awesome
SINOPSIS
--------

awesome-client
awesome-client [-h|--help] [command [command...]]

DESCRIPCIÓN
-----------
Expand All @@ -28,6 +28,34 @@ readline.
El módulo 'awful.remote' tiene que estar cargado para que este comando
funcione.

EXAMPLES
-------
....
$ awesome-client 'return 1+1, "Hello, world"\
double 2
string "Hello, world"

# The following does not return anything on the command line,
# but will show a notification.
$ awesome-client '
> naughty = require("naughty")
> naughty.notify({
> title="CLI Notification",
> text="This is a notification sent from the command line!"})
> '

# Entering read-eval-print-loop mode
# This mode will send every line to awesome, exactly the same as passing
# multiple commands on the command line.
$ awesome-client
awesome# return 1+1
double 2
awesome# return 1+1, "Hello, world"
double 2
string "Hello, world"
awesome#
....

VÉASE TAMBIÉN
-------------
awesome(1) awesomerc(5)
Expand Down
34 changes: 29 additions & 5 deletions manpages/awesome-client.1.fr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ awesome-client - exécution à distance du gestionnaire de fenêtres awesome
SYNOPSIS
--------

awesome-client
awesome-client [-h|--help] [command [command...]]

DESCRIPTION
------------
Expand All @@ -25,24 +25,48 @@ Si 'rlwrap' est installé, il sera utilisé pour fournir une interface en ligne

Le module 'awful.remote' doit être chargé pour que cette commande fonctionne.

EXAMPLES
-------
....
$ awesome-client 'return 1+1, "Hello, world"\
double 2
string "Hello, world"

# The following does not return anything on the command line,
# but will show a notification.
$ awesome-client '
> naughty = require("naughty")
> naughty.notify({
> title="CLI Notification",
> text="This is a notification sent from the command line!"})
> '

# Entering read-eval-print-loop mode
# This mode will send every line to awesome, exactly the same as passing
# multiple commands on the command line.
$ awesome-client
awesome# return 1+1
double 2
awesome# return 1+1, "Hello, world"
double 2
string "Hello, world"
awesome#
....

VOIR AUSSI
----------

awesome(1) awesomerc(5)

AUTEURS
-------

Julien Danjou <[email protected]>

WWW
---

https://awesomewm.org

TRADUCTION
----------

Ce document est une traduction, réalisée par Jean-Luc Duflot <jl POING
duflot CHEZ laposte POING net> le 20 février 2012.

Expand Down
30 changes: 29 additions & 1 deletion manpages/awesome-client.1.it.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ awesome-client - esecutore remoto per il gestore di finestre awesome
SINOSSI
-------

awesome-client
awesome-client [-h|--help] [command [command...]]

DESCRIZIONE
-----------
Expand All @@ -28,6 +28,34 @@ riga di comando per le funzionalità di readline.
Il modulo 'awful.remote' deve essere caricato per far funzionare questo
comando.

EXAMPLES
-------
....
$ awesome-client 'return 1+1, "Hello, world"\
double 2
string "Hello, world"

# The following does not return anything on the command line,
# but will show a notification.
$ awesome-client '
> naughty = require("naughty")
> naughty.notify({
> title="CLI Notification",
> text="This is a notification sent from the command line!"})
> '

# Entering read-eval-print-loop mode
# This mode will send every line to awesome, exactly the same as passing
# multiple commands on the command line.
$ awesome-client
awesome# return 1+1
double 2
awesome# return 1+1, "Hello, world"
double 2
string "Hello, world"
awesome#
....

VEDI ANCHE
----------
awesome(1) awesomerc(5)
Expand Down
31 changes: 29 additions & 2 deletions manpages/awesome-client.1.ru.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ awesome-client - удалённое управление потрясающим
СИНОПСИС
--------

awesome-client
awesome-client [-h|--help] [command [command...]]

ОПИСАНИЕ
--------
Expand All @@ -27,6 +27,34 @@ awesome через D-Bus. Если установлен «rlwrap», то он б
В awesome должен быть загружен модуль «awful.remote», чтобы позволить удалённое
выполнение кода.

EXAMPLES
-------
....
$ awesome-client 'return 1+1, "Hello, world"\
double 2
string "Hello, world"

# The following does not return anything on the command line,
# but will show a notification.
$ awesome-client '
> naughty = require("naughty")
> naughty.notify({
> title="CLI Notification",
> text="This is a notification sent from the command line!"})
> '

# Entering read-eval-print-loop mode
# This mode will send every line to awesome, exactly the same as passing
# multiple commands on the command line.
$ awesome-client
awesome# return 1+1
double 2
awesome# return 1+1, "Hello, world"
double 2
string "Hello, world"
awesome#
....

СМОТРИ ТАКЖЕ
------------
awesome(1) awesomerc(5)
Expand All @@ -41,6 +69,5 @@ https://awesomewm.org

ПЕРЕВОД
-------

Это руководство переведено на русский язык Константином Степановым <[email protected]>
13 апреля 2011 года.
36 changes: 33 additions & 3 deletions manpages/awesome-client.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ awesome-client - awesome window manager remote execution
SYNOPSIS
--------

awesome-client
awesome-client [-h|--help] [command [command...]]

DESCRIPTION
-----------
Expand All @@ -19,11 +19,41 @@ It communicates with awesome via D-Bus, allowing remote execution of Lua code.

USAGE
-----
awesome-client reads commands from standard input and sends them via D-Bus to awesome.
If 'rlwrap' is installed, it will be used to provide a readline command line interface.
awesome-client reads commands passed on the command line or from standard input
and sends them via D-Bus to awesome.
If 'rlwrap' is installed, it will be used to provide a readline command line
interface.

The 'awful.remote' module has to be loaded if you want this command to work.

EXAMPLES
-------
....
$ awesome-client 'return 1+1, "Hello, world"\
double 2
string "Hello, world"

# The following does not return anything on the command line,
# but will show a notification.
$ awesome-client '
> naughty = require("naughty")
> naughty.notify({
> title="CLI Notification",
> text="This is a notification sent from the command line!"})
> '

# Entering read-eval-print-loop mode
# This mode will send every line to awesome, exactly the same as passing
# multiple commands on the command line.
$ awesome-client
awesome# return 1+1
double 2
awesome# return 1+1, "Hello, world"
double 2
string "Hello, world"
awesome#
....

SEE ALSO
--------
awesome(1) awesomerc(5)
Expand Down
25 changes: 24 additions & 1 deletion utils/awesome-client
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,32 @@ a_dbus_send()
fi
}

print_help()
{
echo "Usage: awesome-client [-h|--help] [command [command...]]
awesome window manager remote execution
awesome-client is a remote command line interface to awesome.
It communicates with awesome via D-Bus, allowing remote execution of Lua code.
Run without a command to enter REPL (read-eval-print-loop) mode.
For examples see \`man awesome-client\`."
}

if [ $# -ne 0 ]
then
for arg in "$@" ; do
# check for command-line arguments
ARGS=()
for arg in "$@"; do
if [ "$arg" = "-h" ] || [ "$arg" = "--help" ]; then
print_help
exit 0
else
ARGS+=("$arg")
fi
done
# run arguments
for arg in "$ARGS" ; do
a_dbus_send "$arg"
done
elif [ -t 0 ]
Expand Down

0 comments on commit 1149e03

Please sign in to comment.