summaryrefslogtreecommitdiff
path: root/debian/xcwd.1
blob: ff7c970ca33524b19ef9e69a7b4abf958c568efe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
.\" © 2013, 2015-2018 Benjamin Barenblat
.\"
.\" Licensed under the Apache License, Version 2.0 (the "License"); you may not
.\" use this file except in compliance with the License.  You may obtain a copy
.\" of the License at
.\"
.\"     http://www.apache.org/licenses/LICENSE-2.0
.\"
.\" Unless required by applicable law or agreed to in writing, software
.\" distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
.\" WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
.\" License for the specific language governing permissions and limitations
.\" under the License.
.TH XCWD 1 2018-03-06
.SH NAME
xcwd \- X current working directory
.SH SYNOPSIS
.B xcwd
.SH DESCRIPTION
.B xcwd
is a simple tool which prints the current working directory of the focused
window.
It's useful for launching applications directly into the same directory as the
focused application\(emfor instance, you might want to launch a new terminal in
the same directory as your editor.
You can make this happen by binding something like
.sp
.RS
.EX
urxvt \-cd "$(xcwd)"
.EE
.RE
.sp
to a keyboard shortcut within your window manager and then invoking that
shortcut during editor usage.
.SH EXIT STATUS
.B xcwd
exits with a nonzero status if it can't figure out the working directory
associated with the currently focused window and $HOME is unset.
Otherwise,
.B xcwd
returns zero.
.SH ENVIRONMENT
If
.B xcwd
can't figure out the working directory associated with the currently focused
window, it falls back on $HOME.
.SH BUGS
.BR xcwd 's
algorithm fails when applied to most single-instance applications, applications
with tabs, or terminal multiplexers.
.BR lilyterm (1),
.BR screen (1),
.BR tmux (1),
and
.BR urxvtc (1)
are all known to fail.
.SH SEE ALSO
.BR gnome-terminal (1),
.BR terminology (1),
.BR urxvt (1),
.BR xterm (1)
.SH COPYRIGHT
.B xcwd
is copyright 2013
.MT adrien+dev@schischi.me
Adrien Schildknecht
.ME .
.PP
This manual page is copyright 2013, 2015\(en2018 Benjamin Barenblat and
licensed under the Apache License, Version 2.0.