Commit graph

51 commits

Author SHA1 Message Date
Craig Barnes
1823fa846a completions: bash: simplify awk command used to filter terminfo names 2023-01-27 11:47:12 +00:00
Craig Barnes
becdcd9bb7 completions: bash: complete option arguments for short options 2023-01-10 19:56:12 +00:00
Craig Barnes
8acc10b9d4 completions: bash: use "case" instead of long if/elif/else chain 2023-01-10 19:44:24 +00:00
Craig Barnes
7d28da5006 Use "command -v" instead of "which" in bash completion scripts
The former is a built-in command in bash, whereas the latter is an
external command and isn't always necessarily available.
2023-01-10 18:34:25 +00:00
Antoine Beaupré
b80c7f75fe
change default log level to WARNING
The default foot output looks like this, in Debian testing "bookworm"
at the time of writing:

    anarcat@angela:pubpaste$ foot true
    info: main.c:421: version: 1.13.1 +pgo +ime +graphemes -assertions
    info: main.c:428: arch: Linux x86_64/64-bit
    info: main.c:440: locale: fr_CA.UTF-8
    info: config.c:3003: loading configuration from /home/anarcat/.config/foot/foot.ini
    info: fcft.c:338: fcft: 3.1.5 +graphemes -runs +svg(nanosvg) -assertions
    info: fcft.c:377: fontconfig: 2.13.1, freetype: 2.12.1, harfbuzz: 5.2.0
    info: fcft.c:838: /home/anarcat/.local/share/fonts/Fira-4.202/otf/FiraMono-Regular.otf: size=8.00pt/8px, dpi=75.00
    info: wayland.c:1353: eDP-1: 2256x1504+0x0@60Hz 0x095F 13.32" scale=2 PPI=205x214 (physical) PPI=136x143 (logical), DPI=271.31
    info: wayland.c:1509: requesting SSD decorations
    info: fcft.c:838: /home/anarcat/.local/share/fonts/Fira-4.202/otf/FiraMono-Bold.otf: size=24.00pt/32px, dpi=96.00
    info: fcft.c:838: /home/anarcat/.local/share/fonts/Fira-4.202/otf/FiraMono-Regular.otf: size=24.00pt/32px, dpi=96.00
    info: fcft.c:838: /home/anarcat/.local/share/fonts/Fira-4.202/otf/FiraMono-Bold.otf: size=24.00pt/32px, dpi=96.00
    info: fcft.c:838: /home/anarcat/.local/share/fonts/Fira-4.202/otf/FiraMono-Regular.otf: size=24.00pt/32px, dpi=96.00
    info: terminal.c:700: cell width=19, height=39
    info: terminal.c:588: using 16 rendering threads
    info: wayland.c:859: using SSD decorations
    info: main.c:680: goodbye
    anarcat@angela:pubpaste$

That's 17 lines of output that are *mostly* useless for most use
cases. I might understand having this output during the project's
startup, when it's helpful for diagnostics, but now Foot just mostly
works everywhere, and I've never had a use for any of that stuff in
the (arguably short) time I've been using Foot so far.

And if I do, there's the `--log-level` commandline option to tweak
this. At first, I looked at tweaking the log level through the config
file. But as explained in this issue:

https://codeberg.org/dnkl/foot/issues/1142

... there's a chicken and egg problem there that makes it hard to
implement and possibly confusing for users as well.

There's also the possibility for users to change the shortcut with
which they start foot, for example a `.desktop` file so that menu
systems that support those start foot properly. But that only works in
that environment, and not through the so many things that will just
call `foot` and hope it will do the right thing.

In my case, I have `foot` hardcoded in a lot of places now, between
sway and waybar, and this is only going to grow. Others have suggested
adding the flag to a $TERMINAL global variable, but that won't help
.desktop users.

So, instead of playing whack-a-mole with the log levels, just make it
so that, by default, foot is silent. This is actually one of the
[basics of UNIX philosophy][1]:

> Rule of Silence: When a program has nothing surprising to say, it
> should say nothing.

And yes, I am aware I am severely violating that principle by writing
a way too long commit log for a one-line patch, but there you go, I
figured it was good to document the why of this properly.

[1]: https://web.archive.org/web/20031102053334/http://www.faqs.org/docs/artu/ch01s06.html
2022-11-22 10:22:22 -05:00
Daniel Eklöf
f48955b26e
completions: footclient: add -E,--client-environment 2022-04-12 15:07:41 +02:00
Nicolai Dagestad
0f49a8a033 Fix bash completion for lists of short options 2022-02-03 18:49:54 +01:00
Craig Barnes
5dca0458a0 log: add LOG_CLASS_NONE and use as initializer for log_level
This means that logging will be completely disabled until log_init()
has been called, which is useful to prevent log spam when running
UNITTEST{} blocks in debug builds.

Note that this doesn't change the default log level at runtime, which
was already being set to LOG_CLASS_INFO in main.c and client.c.

The new log level is also exposed to the command-line interface as
`--log-level=none`, which allows disabling logging entirely.
2021-06-26 22:15:09 +01:00
Daniel Eklöf
5b9a000b9b
completions: add -o,--override to footclient 2021-06-23 15:12:09 +02:00
Ryan Farley
f379ffb8ed Override options from command line
Allow any configuration option to be overridden with -o/--override
'section.key=value' arguments, as suggested in #554

update completitions for override

slight refactoring to ease footclient support
2021-06-12 03:05:15 -05:00
Simon Schricker
b169623b64
Add: Bash completion for foot and footclient
* use toe for terminfo, thanks Craig.
* adds optional dependency on bash-completion for positional arguments

Co-authored-by: Craig Barnes <craigbarnes@protonmail.com>
2021-03-17 13:10:28 +01:00
Felipe Trzaskowski
452830bd08 add changelog entry, completions and man entry for -N, --no-wait 2021-03-13 08:07:08 -03:00
Daniel Eklöf
fc070dbdf1
completions: fish: add -D,--working-directory 2021-02-12 21:42:53 +01:00
Daniel Eklöf
60e67b9c21
completions: zsh: add -D,--working-directory 2021-02-12 21:42:53 +01:00
Daniel Eklöf
80cd3df790
completions: fish: -d,--log-level 2021-02-09 21:22:16 +01:00
Daniel Eklöf
2c5beed362
completions: zsh: -d,--log-level 2021-02-09 21:22:16 +01:00
Jan Beich
73522cec27
completions/zsh: unbreak with BSD find(1)
find: -printf: unknown primary or operator
2021-01-23 09:52:42 +01:00
FollieHiyuki
bb1b8bc7ca Add fish completion 2021-01-08 20:37:33 +03:00
Daniel Eklöf
e7c56b0b29
completions: zsh: foot: fix default path of foot.ini 2020-12-08 19:49:14 +01:00
Daniel Eklöf
8eaa195990
foot/footclient: add short options to all command line options
e813883367 added “missing” short command
line options to footclient.

Except they weren’t missing; they were intentionally missing short
options and only supported long options.

This commit makes the new/missing short options “official”, by adding
documentation, zsh completions and including them in usage().
2020-11-23 19:19:19 +01:00
Craig Barnes
b8fc2e19da client: add new "--window-size-*" options to docs and CHANGELOG.md 2020-11-22 18:52:51 +00:00
Daniel Eklöf
eb6737ca25
Add -W,--window-size-chars, and foot.ini:initial-window-size-chars
* Add -W,--window-size-chars command line option
* Add initial-window-size-chars foot.ini option
* Add -w,--window-size-pixels command line option
* Add initial-window-size-pixels foot.ini option
* Deprecate -g,--geometry command line option in favor of
  -w,--window-size-pixels
* Deprecate geometry option in foot.ini in favor of
  initial-window-size-pixels
2020-09-08 19:41:00 +02:00
Daniel Eklöf
5e26d3ef47
server/client: use $WAYLAND_DISPLAY instead of $XDG_SESSION_ID in default socket path
Foot is a Wayland client and cannot be run outside of a Wayland
session. As such, it makes more sense to use $WAYLAND_SESSION instead
of $XDG_SESSION_ID in the default socket path since this makes it
clearer which Wayland session we belong to.

Closes #55.
2020-08-02 13:10:31 +02:00
Daniel Eklöf
86e7cb04c4
main: add --check-config command line option 2020-07-29 17:48:22 +02:00
Daniel Eklöf
fbfbcc453c
completions: zsh: footclient: add --hold 2020-05-26 20:12:35 +02:00
Daniel Eklöf
2e7ead42de
completions: zsh: complete command/shell, and its arguments 2020-05-08 18:45:05 +02:00
Daniel Eklöf
4ca6e760f2
completions: zsh: -f,--font accepts multiple, comma separated values 2020-04-20 18:38:33 +02:00
Daniel Eklöf
a145f7b32a
completions: zsh: foot: default geometry is 700x500, not 700x50 2020-04-08 17:45:59 +02:00
Daniel Eklöf
ec7a768487
conf: add 'title' conf option and --title command line option 2020-04-01 19:59:47 +02:00
Daniel Eklöf
57761fbd50
completions: zsh: repair -a,--app-id completions 2020-04-01 19:58:09 +02:00
Daniel Eklöf
4d52a870b4
conf: add app-id config option and --app-id command line option 2020-04-01 18:40:51 +02:00
Daniel Eklöf
ecbee4af3a
meson: completions: join_paths() all the way 2020-03-29 12:21:28 +02:00
Daniel Eklöf
758fd9fd58
client: add --maximized and --fullscreen
We now create a copy of the config for each client, and updates it
with the values passed from the client.

Since we're not actually cloning it (and e.g. strdup() all strings
etc) we can't call conf_destroy() to free it, but need to free just
the strings we've replaced.
2020-03-27 21:14:49 +01:00
Daniel Eklöf
728e23863c
foot: add --maximized and --fullscreen command line options 2020-03-26 19:47:00 +01:00
Daniel Eklöf
4860c3eb37
completions: zsh: don't strip spaces from font name completions 2020-03-15 12:31:42 +01:00
Daniel Eklöf
5717a0dfb0
config: change default geometry from 800x600 -> 700x500
If the display resolution *is* 800x600, using this size is bad since
there will typically be panels and other things on the screen too.

Not that 800x600 is something we expect to see in real life, but may
happen on virtual displays.
2020-02-29 11:01:23 +01:00
Daniel Eklöf
ac32bcda07
main: geometry defaults to 800x600 pixels 2020-02-25 19:05:48 +01:00
Daniel Eklöf
87c956352f
completions: zsh: add --login-shell 2020-02-20 18:36:43 +01:00
Daniel Eklöf
82b8853f17
main: add --print-pid=FILE|FD
When specified, our PID is written to the specified file (or FD),
after we've successfully started up.
2020-02-05 19:54:16 +01:00
Daniel Eklöf
00d76784f4
main: add --print-pid=FILE|FD
When specified, our PID is written to the specified file (or FD),
after we've successfully started up.

Only applicable in server mode.
2020-02-05 19:53:50 +01:00
Daniel Eklöf
9c5557539f
completions: zsh: --hold has no arguments 2020-02-04 18:28:53 +01:00
Daniel Eklöf
8f4ec9aa47
Implement --hold
When specified, we don't exit when the slave/client process exits.
2020-02-03 19:58:32 +01:00
Daniel Eklöf
21a666e7eb
completions: zsh: add empty completions for options with required argument 2020-01-09 21:06:20 +01:00
Daniel Eklöf
5f2592bd4b
completions: zsh: footclient: auto-complete files for -s,--server-socket 2019-12-17 19:10:19 +01:00
Daniel Eklöf
f408a070e2
completions: zsh: add -c,--config 2019-12-17 19:10:07 +01:00
Daniel Eklöf
cc0903cabe
completions: zsh: footclient: add -s,--server-socket 2019-12-14 13:02:33 +01:00
Daniel Eklöf
1808c8a5fc
completions: zsh: foot: complete optional -s,--server PATH argument 2019-12-14 13:02:08 +01:00
Daniel Eklöf
438d6eaff0
client/server: add -t,--term to footclient 2019-11-01 21:10:47 +01:00
Daniel Eklöf
3032ac33da
completions: zsh: add --server and --term to completions 2019-11-01 20:40:10 +01:00
Daniel Eklöf
6637c8aeda
client: a standalone binary that connects to a foot --server 2019-11-01 20:39:34 +01:00