Compare commits
No commits in common. "master" and "utils_import" have entirely different histories.
master
...
utils_impo
12
.gitignore
vendored
12
.gitignore
vendored
@ -1,2 +1,10 @@
|
|||||||
.environment
|
*.swp
|
||||||
.firefox_env
|
*.tmp
|
||||||
|
c/scream
|
||||||
|
c/xgetnewwindow
|
||||||
|
c/timer
|
||||||
|
c/boid
|
||||||
|
c/a.out
|
||||||
|
c/anaconda
|
||||||
|
c/colors
|
||||||
|
c/tmessage
|
||||||
|
6
.gitmodules
vendored
6
.gitmodules
vendored
@ -1,6 +0,0 @@
|
|||||||
[submodule "builds/dwm"]
|
|
||||||
path = builds/dwm
|
|
||||||
url = https://git.beepboop.systems/stupidcomputer/dwm
|
|
||||||
[submodule "builds/dmenu"]
|
|
||||||
path = builds/dmenu
|
|
||||||
url = https://git.suckless.org/dmenu
|
|
4
.mailmap
4
.mailmap
@ -1,4 +0,0 @@
|
|||||||
stupidcomputer <ryan@beepboop.systems> <randomuser@tilde.club>
|
|
||||||
stupidcomputer <ryan@beepboop.systems>
|
|
||||||
stupidcomputer <ryan@beepboop.systems> <rndusr@beepboop.systems>
|
|
||||||
stupidcomputer <ryan@beepboop.systems> <Unixsys@github.com>
|
|
1
.merging_helper
Normal file
1
.merging_helper
Normal file
@ -0,0 +1 @@
|
|||||||
|
test
|
619
LICENSE
619
LICENSE
@ -1,619 +0,0 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
Version 3, 29 June 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The GNU General Public License is a free, copyleft license for
|
|
||||||
software and other kinds of works.
|
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed
|
|
||||||
to take away your freedom to share and change the works. By contrast,
|
|
||||||
the GNU General Public License is intended to guarantee your freedom to
|
|
||||||
share and change all versions of a program--to make sure it remains free
|
|
||||||
software for all its users. We, the Free Software Foundation, use the
|
|
||||||
GNU General Public License for most of our software; it applies also to
|
|
||||||
any other work released this way by its authors. You can apply it to
|
|
||||||
your programs, too.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
them if you wish), that you receive source code or can get it if you
|
|
||||||
want it, that you can change the software or use pieces of it in new
|
|
||||||
free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to prevent others from denying you
|
|
||||||
these rights or asking you to surrender the rights. Therefore, you have
|
|
||||||
certain responsibilities if you distribute copies of the software, or if
|
|
||||||
you modify it: responsibilities to respect the freedom of others.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
|
||||||
gratis or for a fee, you must pass on to the recipients the same
|
|
||||||
freedoms that you received. You must make sure that they, too, receive
|
|
||||||
or can get the source code. And you must show them these terms so they
|
|
||||||
know their rights.
|
|
||||||
|
|
||||||
Developers that use the GNU GPL protect your rights with two steps:
|
|
||||||
(1) assert copyright on the software, and (2) offer you this License
|
|
||||||
giving you legal permission to copy, distribute and/or modify it.
|
|
||||||
|
|
||||||
For the developers' and authors' protection, the GPL clearly explains
|
|
||||||
that there is no warranty for this free software. For both users' and
|
|
||||||
authors' sake, the GPL requires that modified versions be marked as
|
|
||||||
changed, so that their problems will not be attributed erroneously to
|
|
||||||
authors of previous versions.
|
|
||||||
|
|
||||||
Some devices are designed to deny users access to install or run
|
|
||||||
modified versions of the software inside them, although the manufacturer
|
|
||||||
can do so. This is fundamentally incompatible with the aim of
|
|
||||||
protecting users' freedom to change the software. The systematic
|
|
||||||
pattern of such abuse occurs in the area of products for individuals to
|
|
||||||
use, which is precisely where it is most unacceptable. Therefore, we
|
|
||||||
have designed this version of the GPL to prohibit the practice for those
|
|
||||||
products. If such problems arise substantially in other domains, we
|
|
||||||
stand ready to extend this provision to those domains in future versions
|
|
||||||
of the GPL, as needed to protect the freedom of users.
|
|
||||||
|
|
||||||
Finally, every program is threatened constantly by software patents.
|
|
||||||
States should not allow patents to restrict development and use of
|
|
||||||
software on general-purpose computers, but in those that do, we wish to
|
|
||||||
avoid the special danger that patents applied to a free program could
|
|
||||||
make it effectively proprietary. To prevent this, the GPL assures that
|
|
||||||
patents cannot be used to render the program non-free.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU General Public License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
||||||
works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of an
|
|
||||||
exact copy. The resulting work is called a "modified version" of the
|
|
||||||
earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user through
|
|
||||||
a computer network, with no transfer of a copy, is not conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices"
|
|
||||||
to the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work
|
|
||||||
for making modifications to it. "Object code" means any non-source
|
|
||||||
form of a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users
|
|
||||||
can regenerate automatically from other parts of the Corresponding
|
|
||||||
Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that
|
|
||||||
same work.
|
|
||||||
|
|
||||||
2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not
|
|
||||||
convey, without conditions so long as your license otherwise remains
|
|
||||||
in force. You may convey covered works to others for the sole purpose
|
|
||||||
of having them make modifications exclusively for you, or provide you
|
|
||||||
with facilities for running those works, provided that you comply with
|
|
||||||
the terms of this License in conveying all material for which you do
|
|
||||||
not control copyright. Those thus making or running the covered works
|
|
||||||
for you must do so exclusively on your behalf, under your direction
|
|
||||||
and control, on terms that prohibit them from making any copies of
|
|
||||||
your copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under
|
|
||||||
the conditions stated below. Sublicensing is not allowed; section 10
|
|
||||||
makes it unnecessary.
|
|
||||||
|
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such circumvention
|
|
||||||
is effected by exercising rights under this License with respect to
|
|
||||||
the covered work, and you disclaim any intention to limit operation or
|
|
||||||
modification of the work as a means of enforcing, against the work's
|
|
||||||
users, your or third parties' legal rights to forbid circumvention of
|
|
||||||
technological measures.
|
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
|
|
||||||
b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under section
|
|
||||||
7. This requirement modifies the requirement in section 4 to
|
|
||||||
"keep intact all notices".
|
|
||||||
|
|
||||||
c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
|
|
||||||
d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms
|
|
||||||
of sections 4 and 5, provided that you also convey the
|
|
||||||
machine-readable Corresponding Source under the terms of this License,
|
|
||||||
in one of these ways:
|
|
||||||
|
|
||||||
a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
|
|
||||||
b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the
|
|
||||||
Corresponding Source from a network server at no charge.
|
|
||||||
|
|
||||||
c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
|
|
||||||
d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
|
|
||||||
e) Convey the object code using peer-to-peer transmission, provided
|
|
||||||
you inform other peers where the object code and Corresponding
|
|
||||||
Source of the work are being offered to the general public at no
|
|
||||||
charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal, family,
|
|
||||||
or household purposes, or (2) anything designed or sold for incorporation
|
|
||||||
into a dwelling. In determining whether a product is a consumer product,
|
|
||||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
||||||
product received by a particular user, "normally used" refers to a
|
|
||||||
typical or common use of that class of product, regardless of the status
|
|
||||||
of the particular user or of the way in which the particular user
|
|
||||||
actually uses, or expects or is expected to use, the product. A product
|
|
||||||
is a consumer product regardless of whether the product has substantial
|
|
||||||
commercial, industrial or non-consumer uses, unless such uses represent
|
|
||||||
the only significant mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to install
|
|
||||||
and execute modified versions of a covered work in that User Product from
|
|
||||||
a modified version of its Corresponding Source. The information must
|
|
||||||
suffice to ensure that the continued functioning of the modified object
|
|
||||||
code is in no case prevented or interfered with solely because
|
|
||||||
modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or updates
|
|
||||||
for a work that has been modified or installed by the recipient, or for
|
|
||||||
the User Product in which it has been modified or installed. Access to a
|
|
||||||
network may be denied when the modification itself materially and
|
|
||||||
adversely affects the operation of the network or violates the rules and
|
|
||||||
protocols for communication across the network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders of
|
|
||||||
that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
|
|
||||||
b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
|
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or
|
|
||||||
requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
|
|
||||||
d) Limiting the use for publicity purposes of names of licensors or
|
|
||||||
authors of the material; or
|
|
||||||
|
|
||||||
e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
|
|
||||||
f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions of
|
|
||||||
it) with contractual assumptions of liability to the recipient, for
|
|
||||||
any liability that these contractual assumptions directly impose on
|
|
||||||
those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions;
|
|
||||||
the above requirements apply either way.
|
|
||||||
|
|
||||||
8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your
|
|
||||||
license from a particular copyright holder is reinstated (a)
|
|
||||||
provisionally, unless and until the copyright holder explicitly and
|
|
||||||
finally terminates your license, and (b) permanently, if the copyright
|
|
||||||
holder fails to notify you of the violation by some reasonable means
|
|
||||||
prior to 60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or
|
|
||||||
run a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims
|
|
||||||
owned or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within
|
|
||||||
the scope of its coverage, prohibits the exercise of, or is
|
|
||||||
conditioned on the non-exercise of one or more of the rights that are
|
|
||||||
specifically granted under this License. You may not convey a covered
|
|
||||||
work if you are a party to an arrangement with a third party that is
|
|
||||||
in the business of distributing software, under which you make payment
|
|
||||||
to the third party based on the extent of your activity of conveying
|
|
||||||
the work, and under which the third party grants, to any of the
|
|
||||||
parties who would receive the covered work from you, a discriminatory
|
|
||||||
patent license (a) in connection with copies of the covered work
|
|
||||||
conveyed by you (or copies made from those copies), or (b) primarily
|
|
||||||
for and in connection with specific products or compilations that
|
|
||||||
contain the covered work, unless you entered into that arrangement,
|
|
||||||
or that patent license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you may
|
|
||||||
not convey it at all. For example, if you agree to terms that obligate you
|
|
||||||
to collect a royalty for further conveying from those to whom you convey
|
|
||||||
the Program, the only way you could satisfy both those terms and this
|
|
||||||
License would be to refrain entirely from conveying the Program.
|
|
||||||
|
|
||||||
13. Use with the GNU Affero General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU Affero General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the special requirements of the GNU Affero General Public License,
|
|
||||||
section 13, concerning interaction through a network will apply to the
|
|
||||||
combination as such.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
|
||||||
the GNU General Public License from time to time. Such new versions will
|
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Program specifies that a certain numbered version of the GNU General
|
|
||||||
Public License "or any later version" applies to it, you have the
|
|
||||||
option of following the terms and conditions either of that numbered
|
|
||||||
version or of any later version published by the Free Software
|
|
||||||
Foundation. If the Program does not specify a version number of the
|
|
||||||
GNU General Public License, you may choose any version ever published
|
|
||||||
by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
|
||||||
versions of the GNU General Public License can be used, that proxy's
|
|
||||||
public statement of acceptance of a version permanently authorizes you
|
|
||||||
to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
|
||||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
||||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
||||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
||||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
|
||||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
|
||||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
|
||||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
|
||||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
||||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
||||||
SUCH DAMAGES.
|
|
||||||
|
|
||||||
17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
19
README.md
19
README.md
@ -1,19 +0,0 @@
|
|||||||
randomuser's dotfiles
|
|
||||||
=====================
|
|
||||||
|
|
||||||
things to do
|
|
||||||
------------
|
|
||||||
|
|
||||||
* [ ] integrate `disko` and `sops-nix` into the setup
|
|
||||||
* [ ] write an app that replaces the nextcloud phonetrack setup
|
|
||||||
* [ ] establish backup infrastructure for `netbox`
|
|
||||||
|
|
||||||
license
|
|
||||||
-------
|
|
||||||
|
|
||||||
all materials in this repository, except for:
|
|
||||||
|
|
||||||
* `./config/pape.jpg`, which is of unknown license, and
|
|
||||||
* `./builds/st`, which is licensed under MIT, pursuant to `./builds/st/LICENSE`,
|
|
||||||
|
|
||||||
is (c) rndusr, randomuser, stupidcomputer, etc 2024-2025 and licensed under the GPLv3 (see `./LICENSE`)
|
|
@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
age = {
|
|
||||||
secrets = {
|
|
||||||
nm-home-net-config = {
|
|
||||||
file = ../../secrets/nm-home-net-config.age;
|
|
||||||
path = "/etc/NetworkManager/system-connections/main.nmconnection";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
identityPaths = [ "/home/usr/.ssh/id_ed25519" ];
|
|
||||||
};
|
|
||||||
}
|
|
@ -1 +0,0 @@
|
|||||||
sudo nixos-rebuild switch --flake .?submodules=1
|
|
@ -1,81 +0,0 @@
|
|||||||
{ pkgs, lib, machines, ... }:
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
../../config/aristotle.nix
|
|
||||||
./paperless.nix
|
|
||||||
./sshd.nix
|
|
||||||
./agenix.nix
|
|
||||||
./hardware-configuration.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
programs.adb.enable = true;
|
|
||||||
|
|
||||||
boot.loader.grub = {
|
|
||||||
enable = true;
|
|
||||||
device = "/dev/nvme0n1";
|
|
||||||
};
|
|
||||||
|
|
||||||
networking = {
|
|
||||||
hostName = "aristotle";
|
|
||||||
networkmanager.enable = true;
|
|
||||||
firewall.allowedTCPPorts = [ 24800 ];
|
|
||||||
|
|
||||||
hosts = lib.attrsets.mergeAttrsList [
|
|
||||||
(machines.mkHosts machines "router" "localnet")
|
|
||||||
(machines.mkHosts machines "copernicus" "localnet")
|
|
||||||
(machines.mkHosts machines "phone" "localnet")
|
|
||||||
(machines.mkHosts machines "netbox" "internet")
|
|
||||||
] // {
|
|
||||||
"127.0.0.1" = [ "news.ycombinator.com" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
hardware = {
|
|
||||||
bluetooth = {
|
|
||||||
enable = true;
|
|
||||||
settings.General.ControllerMode = "bredr";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
time.timeZone = "America/Chicago";
|
|
||||||
i18n.defaultLocale = "en_US.UTF-8";
|
|
||||||
|
|
||||||
users.users.usr = {
|
|
||||||
isNormalUser = true;
|
|
||||||
description = "usr";
|
|
||||||
extraGroups = [ "networkmanager" "wheel" "input" "adbusers" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
nix.settings = {
|
|
||||||
experimental-features = [ "nix-command" "flakes" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
services = {
|
|
||||||
xserver = {
|
|
||||||
enable = true;
|
|
||||||
xkb = {
|
|
||||||
layout = "us";
|
|
||||||
variant = "";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
libinput.enable = true;
|
|
||||||
tlp.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
powerManagement.powertop.enable = true;
|
|
||||||
|
|
||||||
systemd.services."getty@tty6" = {
|
|
||||||
overrideStrategy = "asDropin";
|
|
||||||
serviceConfig.ExecStart = ["" "@${pkgs.coreutils}/bin/cat"];
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.user.services.ssh-socks5-proxy = {
|
|
||||||
enable = true;
|
|
||||||
description = "SOCKS5 proxy over ssh";
|
|
||||||
|
|
||||||
serviceConfig.ExecStart = "${pkgs.openssh}/bin/ssh -ND 127.0.0.1:4000 netbox";
|
|
||||||
wantedBy = []; # start only when I say so
|
|
||||||
};
|
|
||||||
|
|
||||||
system.stateVersion = "24.05";
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
{ config, lib, modulesPath, ... }:
|
|
||||||
{
|
|
||||||
imports =
|
|
||||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
|
||||||
];
|
|
||||||
|
|
||||||
boot = {
|
|
||||||
initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
|
|
||||||
initrd.kernelModules = [ ];
|
|
||||||
kernelModules = [ "kvm-intel" ];
|
|
||||||
extraModulePackages = [ ];
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/" =
|
|
||||||
{ device = "/dev/disk/by-uuid/e10eea5c-4dca-40f7-86cc-02105bc6d4e0";
|
|
||||||
fsType = "ext4";
|
|
||||||
};
|
|
||||||
|
|
||||||
swapDevices = [ ];
|
|
||||||
|
|
||||||
networking.useDHCP = lib.mkDefault true;
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
|
||||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
{ lib, ... }:
|
|
||||||
{
|
|
||||||
services.paperless = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
# we're only hosting on loopback, so this is safe
|
|
||||||
passwordFile = builtins.toFile "admin_pass" "admin";
|
|
||||||
address = "127.0.0.1"; # see above comment
|
|
||||||
port = 5000;
|
|
||||||
};
|
|
||||||
|
|
||||||
# start paperless manually so as to not destroy battery life
|
|
||||||
systemd.services = {
|
|
||||||
paperless-scheduler.wantedBy = lib.mkForce [];
|
|
||||||
redis-paperless.wantedBy = lib.mkForce [];
|
|
||||||
redis-paperless.after = lib.mkForce [];
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
{ lib, machines, ... }:
|
|
||||||
{
|
|
||||||
services.openssh = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
PermitRootLogin = "no";
|
|
||||||
PasswordAuthentication = false;
|
|
||||||
};
|
|
||||||
listenAddresses = [
|
|
||||||
{
|
|
||||||
addr = "0.0.0.0";
|
|
||||||
port = 2222;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
users.users.usr.openssh.authorizedKeys.keys = with machines; [
|
|
||||||
copernicus.pubkey
|
|
||||||
aristotle.pubkey
|
|
||||||
phone.pubkey
|
|
||||||
];
|
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ 2222 ];
|
|
||||||
|
|
||||||
# don't start the sshd immediately
|
|
||||||
systemd.services.sshd.wantedBy = lib.mkForce [];
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
{ machines, ... }:
|
|
||||||
{
|
|
||||||
age = {
|
|
||||||
secrets = {
|
|
||||||
copernicus-wg-priv = {
|
|
||||||
file = machines.copernicus.wg-privkey;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
identityPaths = [ "/home/usr/.ssh/id_ed25519" ];
|
|
||||||
};
|
|
||||||
}
|
|
@ -1 +0,0 @@
|
|||||||
sudo nixos-rebuild --flake .?submodules=1 switch --impure -I nixos-config=./
|
|
@ -1,156 +0,0 @@
|
|||||||
{ pkgs, lib, machines, ...}:
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./hardware-configuration.nix
|
|
||||||
./nvidia.nix
|
|
||||||
./agenix.nix
|
|
||||||
./services
|
|
||||||
../../config/copernicus.nix
|
|
||||||
../../lib/bootstrap.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
wine
|
|
||||||
xdotool
|
|
||||||
|
|
||||||
libreoffice
|
|
||||||
texliveMedium
|
|
||||||
kdePackages.kdenlive
|
|
||||||
audacity
|
|
||||||
bespokesynth
|
|
||||||
musescore
|
|
||||||
unzip
|
|
||||||
ledger
|
|
||||||
|
|
||||||
unzip
|
|
||||||
imagemagick
|
|
||||||
pciutils
|
|
||||||
usbutils
|
|
||||||
|
|
||||||
ffmpeg
|
|
||||||
mdadm
|
|
||||||
git-annex
|
|
||||||
tigervnc
|
|
||||||
|
|
||||||
dmenu
|
|
||||||
|
|
||||||
(pkgs.callPackage ../../builds/sssg.nix {})
|
|
||||||
];
|
|
||||||
|
|
||||||
services.hardware.bolt.enable = true; # thunderbolt support
|
|
||||||
hardware.bluetooth = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
General = {
|
|
||||||
# AutoEnable = true;
|
|
||||||
Enable = "Source,Sink,Media,Socket";
|
|
||||||
# ControllerMode = "bredr";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
boot.loader = {
|
|
||||||
efi = {
|
|
||||||
canTouchEfiVariables = true;
|
|
||||||
efiSysMountPoint = "/boot";
|
|
||||||
};
|
|
||||||
grub = {
|
|
||||||
efiSupport = true;
|
|
||||||
device = "nodev";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services = {
|
|
||||||
# enable printing
|
|
||||||
printing.enable = true;
|
|
||||||
avahi = {
|
|
||||||
enable = true; # runs the Avahi daemon
|
|
||||||
nssmdns4 = true; # enables the mDNS NSS plug-in
|
|
||||||
openFirewall = true; # opens the firewall for UDP port 5353
|
|
||||||
};
|
|
||||||
|
|
||||||
pipewire = {
|
|
||||||
enable = true;
|
|
||||||
extraConfig.pipewire = {
|
|
||||||
"properties" = {
|
|
||||||
default.clock.allowed-rates = [ 44100 48000 96000 ];
|
|
||||||
"log.level" = 4;
|
|
||||||
"default.clock.quantum" = 256;
|
|
||||||
"default.clock.min-quantum" = 256;
|
|
||||||
"default.clock.max-quantum" = 256;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
alsa = {
|
|
||||||
enable = true;
|
|
||||||
support32Bit = true;
|
|
||||||
};
|
|
||||||
pulse.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.adb.enable = true;
|
|
||||||
|
|
||||||
powerManagement.cpuFreqGovernor = "performance";
|
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
networking = {
|
|
||||||
hostName = "copernicus";
|
|
||||||
interfaces.eno1 = {
|
|
||||||
useDHCP = true;
|
|
||||||
ipv4.addresses = [
|
|
||||||
{
|
|
||||||
address = "192.168.1.201";
|
|
||||||
prefixLength = 24;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
firewall = {
|
|
||||||
enable = true;
|
|
||||||
interfaces = {
|
|
||||||
eno1 = {
|
|
||||||
allowedTCPPorts = [ 6000 ];
|
|
||||||
allowedTCPPortRanges = [
|
|
||||||
{ from = 1714; to = 1764; } # KDE Connect
|
|
||||||
{ from = 10000; to = 10100; } # temp stuff
|
|
||||||
];
|
|
||||||
allowedUDPPortRanges = [
|
|
||||||
{ from = 1714; to = 1764; } # KDE Connect
|
|
||||||
];
|
|
||||||
};
|
|
||||||
wg0 = {
|
|
||||||
# allow everything bound to the wg0 interface
|
|
||||||
allowedTCPPortRanges = [
|
|
||||||
{ from = 1; to = 35565; }
|
|
||||||
];
|
|
||||||
allowedUDPPortRanges = [
|
|
||||||
{ from = 1; to = 35565; }
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
hosts = lib.attrsets.mergeAttrsList [
|
|
||||||
(machines.mkHosts machines "aristotle" "localnet")
|
|
||||||
(machines.mkHosts machines "router" "localnet")
|
|
||||||
(machines.mkHosts machines "phone" "localnet")
|
|
||||||
(machines.mkHosts machines "netbox" "internet")
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
services.getty.autologinUser = "usr";
|
|
||||||
|
|
||||||
time.timeZone = "America/Chicago";
|
|
||||||
|
|
||||||
i18n.defaultLocale = "en_US.UTF-8";
|
|
||||||
console = {
|
|
||||||
font = "Lat2-Terminus16";
|
|
||||||
keyMap = "us";
|
|
||||||
};
|
|
||||||
|
|
||||||
users.users.usr = {
|
|
||||||
isNormalUser = true;
|
|
||||||
extraGroups = [ "wheel" "networkmanager" "adbusers" ];
|
|
||||||
initialPassword = "usr";
|
|
||||||
};
|
|
||||||
|
|
||||||
system.stateVersion = "24.05"; # don't change this, lol
|
|
||||||
}
|
|
@ -1,29 +0,0 @@
|
|||||||
{ config, lib, modulesPath, ... }:
|
|
||||||
{
|
|
||||||
imports =
|
|
||||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "vmd" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
|
|
||||||
boot.initrd.kernelModules = [ ];
|
|
||||||
boot.kernelModules = [ "kvm-intel" "psmouse" "wacom" ];
|
|
||||||
boot.extraModulePackages = [ ];
|
|
||||||
|
|
||||||
fileSystems."/" =
|
|
||||||
{ device = "/dev/disk/by-uuid/8182bde6-7213-4108-9dbf-951f76870207";
|
|
||||||
fsType = "ext4";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/boot" =
|
|
||||||
{ device = "/dev/disk/by-uuid/0D21-265A";
|
|
||||||
fsType = "vfat";
|
|
||||||
options = [ "fmask=0022" "dmask=0022" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
swapDevices =
|
|
||||||
[ { device = "/dev/disk/by-uuid/fc5366cc-2cec-415e-85dd-7c01a4e4fb4f"; }
|
|
||||||
];
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
|
||||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
{
|
|
||||||
# Make sure opengl is enabled
|
|
||||||
hardware.graphics = {
|
|
||||||
enable = true;
|
|
||||||
enable32Bit = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
glxinfo
|
|
||||||
];
|
|
||||||
|
|
||||||
# Tell Xorg to use the nvidia driver (also valid for Wayland)
|
|
||||||
services.xserver.videoDrivers = ["nvidia"];
|
|
||||||
|
|
||||||
hardware.nvidia = {
|
|
||||||
|
|
||||||
# Modesetting is needed for most Wayland compositors
|
|
||||||
modesetting.enable = true;
|
|
||||||
|
|
||||||
# Use the open source version of the kernel module
|
|
||||||
# Only available on driver 515.43.04+
|
|
||||||
open = false;
|
|
||||||
|
|
||||||
# Enable the nvidia settings menu
|
|
||||||
nvidiaSettings = true;
|
|
||||||
|
|
||||||
# Optionally, you may need to select the appropriate driver version for your specific GPU.
|
|
||||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
|
||||||
|
|
||||||
prime = {
|
|
||||||
sync.enable = true;
|
|
||||||
|
|
||||||
intelBusId = "PCI:0:2:0";
|
|
||||||
nvidiaBusId = "PCI:1:0:0";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
imports = [
|
|
||||||
./wireguard.nix
|
|
||||||
./sshd.nix
|
|
||||||
];
|
|
||||||
}
|
|
@ -1,31 +0,0 @@
|
|||||||
{ machines, ...}:
|
|
||||||
|
|
||||||
{
|
|
||||||
services.openssh = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
PermitRootLogin = "no";
|
|
||||||
PasswordAuthentication = false;
|
|
||||||
};
|
|
||||||
listenAddresses = [
|
|
||||||
{
|
|
||||||
addr = "192.168.1.201";
|
|
||||||
port = 2222;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
addr = "10.100.0.2";
|
|
||||||
port = 2222;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
networking.firewall.interfaces.eno1 = {
|
|
||||||
allowedTCPPorts = [ 2222 ];
|
|
||||||
};
|
|
||||||
|
|
||||||
users.users.usr.openssh.authorizedKeys.keys = [
|
|
||||||
machines.copernicus.pubkey
|
|
||||||
machines.aristotle.pubkey
|
|
||||||
machines.phone.pubkey
|
|
||||||
];
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
{ config, machines, ... }:
|
|
||||||
{
|
|
||||||
networking = {
|
|
||||||
firewall.allowedUDPPorts = [ 50000 ];
|
|
||||||
|
|
||||||
wireguard.interfaces = {
|
|
||||||
wg0 = {
|
|
||||||
ips = [ "10.100.0.2/24" ];
|
|
||||||
listenPort = 50000;
|
|
||||||
|
|
||||||
privateKeyFile = config.age.secrets.copernicus-wg-priv.path;
|
|
||||||
peers = [
|
|
||||||
{ # netbox
|
|
||||||
publicKey = machines.netbox.wg-pubkey;
|
|
||||||
allowedIPs = [ "10.100.0.0/24" ]; # only stuff in the wg-subnet (10.100.0.*)
|
|
||||||
endpoint = "149.28.63.115:50000";
|
|
||||||
persistentKeepalive = 25;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,37 +0,0 @@
|
|||||||
{ machines, ... }:
|
|
||||||
{
|
|
||||||
age.secrets = {
|
|
||||||
gitea-postgres-password = {
|
|
||||||
file = ../../secrets/gitea-postgres-password.age;
|
|
||||||
mode = "0700";
|
|
||||||
owner = "gitea";
|
|
||||||
group = "gitea";
|
|
||||||
};
|
|
||||||
|
|
||||||
mailaccount = {
|
|
||||||
file = ../../secrets/mailaccount.age;
|
|
||||||
};
|
|
||||||
|
|
||||||
netbox-wg-priv = {
|
|
||||||
file = machines.netbox.wg-privkey;
|
|
||||||
};
|
|
||||||
|
|
||||||
radicale-passwd = {
|
|
||||||
file = ../../secrets/radicale-passwd.age;
|
|
||||||
owner = "radicale";
|
|
||||||
group = "radicale";
|
|
||||||
};
|
|
||||||
|
|
||||||
nextcloud-passwd = {
|
|
||||||
file = ../../secrets/nextcloud-admin-passwd.age;
|
|
||||||
owner = "nextcloud";
|
|
||||||
group = "nextcloud";
|
|
||||||
};
|
|
||||||
|
|
||||||
pcomon-secrets-file = {
|
|
||||||
file = ../../secrets/pcomon-secrets-file.age;
|
|
||||||
owner = "pcomon";
|
|
||||||
group = "pcomon";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1 +0,0 @@
|
|||||||
sudo nixos-rebuild --flake . switch --impure -I nixos-config=./
|
|
@ -1,124 +0,0 @@
|
|||||||
{ pkgs, lib, machines, ... }:
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./hardware-configuration.nix
|
|
||||||
../../lib/bootstrap.nix
|
|
||||||
|
|
||||||
./agenix.nix
|
|
||||||
./flasktrack.nix
|
|
||||||
./franklincce.nix
|
|
||||||
./gitea.nix
|
|
||||||
./mail.nix
|
|
||||||
./nextcloud.nix
|
|
||||||
./nginx.nix
|
|
||||||
./pcomon.nix
|
|
||||||
./radicale.nix
|
|
||||||
./ssh.nix
|
|
||||||
./sslh.nix
|
|
||||||
./vaultwarden.nix
|
|
||||||
./wireguard.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
nix = {
|
|
||||||
optimise = {
|
|
||||||
automatic = true;
|
|
||||||
dates = [ "02:30" ];
|
|
||||||
};
|
|
||||||
gc = {
|
|
||||||
automatic = true;
|
|
||||||
dates = "03:15";
|
|
||||||
options = "-d";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
time.timeZone = "America/Chicago";
|
|
||||||
|
|
||||||
i18n.defaultLocale = "en_US.UTF-8";
|
|
||||||
console = {
|
|
||||||
font = "Lat2-Terminus16";
|
|
||||||
keyMap = "us";
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
python3
|
|
||||||
curl
|
|
||||||
htop
|
|
||||||
git
|
|
||||||
tree
|
|
||||||
dig
|
|
||||||
htop
|
|
||||||
neovim
|
|
||||||
];
|
|
||||||
|
|
||||||
system = {
|
|
||||||
stateVersion = "23.05"; # don't change this, lol
|
|
||||||
};
|
|
||||||
|
|
||||||
services.journald.extraConfig = ''
|
|
||||||
SystemMaxUse=1G
|
|
||||||
'';
|
|
||||||
|
|
||||||
system.userActivationScripts = {
|
|
||||||
copyEssentialConfiguration = {
|
|
||||||
# we don't want to bring in the entirety of home-manager for this, so just
|
|
||||||
# write some files as a hack
|
|
||||||
text = ''
|
|
||||||
${pkgs.coreutils}/bin/cp /home/ryan/dot_testing/config/bash/bashrc /home/ryan/.bashrc
|
|
||||||
${pkgs.coreutils}/bin/cp /home/ryan/dot_testing/config/bash/profile /home/ryan/.bash_profile
|
|
||||||
${pkgs.coreutils}/bin/mkdir -p /home/ryan/config/nvim
|
|
||||||
${pkgs.coreutils}/bin/cp /home/ryan/dot_testing/config/nvim/init.min.lua /home/ryan/.config/nvim/init.lua
|
|
||||||
'';
|
|
||||||
deps = [];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
system.activationScripts = {
|
|
||||||
copyEssentialConfiguration = {
|
|
||||||
text = ''
|
|
||||||
${pkgs.coreutils}/bin/cp /home/ryan/dot_testing/config/bash/bashrc /root/.bashrc
|
|
||||||
${pkgs.coreutils}/bin/cp /home/ryan/dot_testing/config/bash/profile /root/.bash_profile
|
|
||||||
${pkgs.coreutils}/bin/mkdir -p /root/config/nvim
|
|
||||||
${pkgs.coreutils}/bin/cp /home/ryan/dot_testing/config/nvim/init.min.lua /root/.config/nvim/init.lua
|
|
||||||
'';
|
|
||||||
deps = [];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
boot.loader = {
|
|
||||||
grub.enable = true;
|
|
||||||
grub.device = "/dev/vda";
|
|
||||||
};
|
|
||||||
|
|
||||||
users.users.ryan = {
|
|
||||||
isNormalUser = true;
|
|
||||||
extraGroups = [ "wheel" "docker" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
networking = {
|
|
||||||
usePredictableInterfaceNames = false;
|
|
||||||
networkmanager.enable = true;
|
|
||||||
hostName = "netbox";
|
|
||||||
|
|
||||||
firewall = {
|
|
||||||
enable = true;
|
|
||||||
interfaces = {
|
|
||||||
eth0 = {
|
|
||||||
allowedTCPPorts = [ 80 443 ];
|
|
||||||
};
|
|
||||||
wg0 = {
|
|
||||||
# allow everything bound to the wg0 interface
|
|
||||||
allowedTCPPortRanges = [
|
|
||||||
{ from = 1; to = 35565; }
|
|
||||||
];
|
|
||||||
allowedUDPPortRanges = [
|
|
||||||
{ from = 1; to = 35565; }
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
hosts = lib.attrsets.mergeAttrsList [
|
|
||||||
(machines.mkHosts machines "copernicus" "wgnet")
|
|
||||||
(machines.mkHosts machines "aristotle" "wgnet")
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
{ pkgs, ... }:
|
|
||||||
let
|
|
||||||
appEnv = pkgs.python3.withPackages (p: with p; [
|
|
||||||
waitress
|
|
||||||
(callPackage ../../builds/flasktrack.nix {})
|
|
||||||
]);
|
|
||||||
in {
|
|
||||||
systemd.services.flasktrack = {
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
environment = {
|
|
||||||
FLASKTRACK_CREDENTIAL_LOCATION = "/etc/flasktrack-secrets.cfg";
|
|
||||||
};
|
|
||||||
serviceConfig = {
|
|
||||||
ExecStart = "${appEnv}/bin/waitress-serve --port=8042 flasktrack:app";
|
|
||||||
StandardOutput = "journal";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx.virtualHosts."flasktrack.beepboop.systems" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/" = {
|
|
||||||
extraConfig = ''
|
|
||||||
proxy_pass http://localhost:8042;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
virtualisation.docker.enable = true;
|
|
||||||
|
|
||||||
services.nginx.virtualHosts."franklincce.beepboop.systems" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://localhost:1337";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# WARNING WARNING WARNING
|
|
||||||
# the below is SUPER BAD and should not be copied ANYWHERE
|
|
||||||
# the docker container should be initialized by a flake or other nix concept,
|
|
||||||
# not this nonsense
|
|
||||||
|
|
||||||
systemd.services.franklincce = {
|
|
||||||
description = "the docker container that runs the franklincce app";
|
|
||||||
|
|
||||||
environment = { # this is EVIL, NEVER DO THIS!!!111!
|
|
||||||
NIX_PATH = "nixpkgs=flake:nixpkgs:/nix/var/nix/profiles/per-user/root/channels";
|
|
||||||
};
|
|
||||||
|
|
||||||
script = ''
|
|
||||||
cd /home/ryan
|
|
||||||
|
|
||||||
# don't fail if cloning the git repo fails
|
|
||||||
${pkgs.git}/bin/git clone https://git.beepboop.systems/stupidcomputer/yig yig || true
|
|
||||||
|
|
||||||
cd /home/ryan/yig
|
|
||||||
${pkgs.nix}/bin/nix-shell --command make
|
|
||||||
'';
|
|
||||||
|
|
||||||
serviceConfig = {
|
|
||||||
User = "ryan";
|
|
||||||
};
|
|
||||||
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,45 +0,0 @@
|
|||||||
{ config, ... }:
|
|
||||||
{
|
|
||||||
services.gitea = {
|
|
||||||
enable = true;
|
|
||||||
appName = "beepboop.systems"; # Give the site a name
|
|
||||||
database = {
|
|
||||||
type = "postgres";
|
|
||||||
passwordFile = config.age.secrets.gitea-postgres-password.path;
|
|
||||||
};
|
|
||||||
settings.security.INSTALL_LOCK = true;
|
|
||||||
settings.service = {
|
|
||||||
SHOW_REGISTRATION_BUTTON = false;
|
|
||||||
DISABLE_REGISTRATION = true;
|
|
||||||
};
|
|
||||||
settings.api.ENABLE_SWAGGER = false;
|
|
||||||
settings.server = {
|
|
||||||
DOMAIN = "git.beepboop.systems";
|
|
||||||
ROOT_URL = "https://git.beepboop.systems/";
|
|
||||||
LANDING_PAGE = "explore";
|
|
||||||
HTTP_PORT = 3001;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.postgresql = {
|
|
||||||
enable = true; # Ensure postgresql is enabled
|
|
||||||
authentication = ''
|
|
||||||
local gitea all ident map=gitea-users
|
|
||||||
'';
|
|
||||||
identMap = # Map the gitea user to postgresql
|
|
||||||
''
|
|
||||||
gitea-users gitea gitea
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx.virtualHosts."git.beepboop.systems" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://localhost:3001";
|
|
||||||
};
|
|
||||||
locations."/bridge" = {
|
|
||||||
proxyPass = "http://localhost:5000";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,29 +0,0 @@
|
|||||||
{ lib, ... }:
|
|
||||||
{
|
|
||||||
imports = [ ];
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk" ];
|
|
||||||
boot.initrd.kernelModules = [ ];
|
|
||||||
boot.kernelModules = [ ];
|
|
||||||
boot.extraModulePackages = [ ];
|
|
||||||
|
|
||||||
fileSystems."/" =
|
|
||||||
{ device = "/dev/disk/by-uuid/a57b82ca-7bfd-458e-b3e8-4962511cc0b8";
|
|
||||||
fsType = "ext4";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/boot" =
|
|
||||||
{ device = "/dev/disk/by-uuid/DF39-1ECE";
|
|
||||||
fsType = "vfat";
|
|
||||||
};
|
|
||||||
|
|
||||||
swapDevices =
|
|
||||||
[ { device = "/dev/disk/by-uuid/57fbd850-1ced-4e21-9e52-4f3b529c61b0"; }
|
|
||||||
];
|
|
||||||
|
|
||||||
networking.useDHCP = lib.mkDefault true;
|
|
||||||
# networking.interfaces.ens3.useDHCP = lib.mkDefault true;
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
|
||||||
virtualisation.hypervGuest.enable = true;
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
{ config, inputs, ... }:
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
inputs.simple-nixos-mailserver.nixosModule
|
|
||||||
];
|
|
||||||
|
|
||||||
mailserver = {
|
|
||||||
enable = true;
|
|
||||||
fqdn = "mail.beepboop.systems";
|
|
||||||
domains = [ "beepboop.systems" ];
|
|
||||||
loginAccounts = {
|
|
||||||
"ryan@beepboop.systems" = {
|
|
||||||
# nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt' > /hashed/password/file/location
|
|
||||||
hashedPasswordFile = config.age.secrets.mailaccount.path;
|
|
||||||
|
|
||||||
aliases = [
|
|
||||||
"info@beepboop.systems"
|
|
||||||
"postmaster@beepboop.systems"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
certificateScheme = "acme-nginx";
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
{
|
|
||||||
services.nextcloud = {
|
|
||||||
enable = true;
|
|
||||||
https = true;
|
|
||||||
package = pkgs.nextcloud30;
|
|
||||||
hostName = "nextcloud.beepboop.systems";
|
|
||||||
config.adminpassFile = config.age.secrets.nextcloud-passwd.path;
|
|
||||||
settings.overwriteprotocol = "https";
|
|
||||||
extraApps = {
|
|
||||||
phonetrack = pkgs.fetchNextcloudApp {
|
|
||||||
sha256 = "sha256-zQt+3t86HZJVT/wiETHkPdTwV6Qy+iNkH3/THtTe1Xs=";
|
|
||||||
license = "agpl3Only";
|
|
||||||
url = "https://github.com/julien-nc/phonetrack/releases/download/v0.8.1/phonetrack-0.8.1.tar.gz";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
extraAppsEnable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx.virtualHosts."${config.services.nextcloud.hostName}" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,50 +0,0 @@
|
|||||||
{
|
|
||||||
services.nginx.enable = true;
|
|
||||||
services.nginx.clientMaxBodySize = "100m";
|
|
||||||
services.nginx.defaultSSLListenPort = 442;
|
|
||||||
|
|
||||||
services.nginx.virtualHosts."beepboop.systems" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
root = "/var/www/beepboop.systems";
|
|
||||||
locations."/" = {
|
|
||||||
extraConfig = ''
|
|
||||||
port_in_redirect off;
|
|
||||||
absolute_redirect off;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx.virtualHosts."tfb.beepboop.systems" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/" = {
|
|
||||||
extraConfig = ''
|
|
||||||
return 301 https://marching.beepboop.systems;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
locations."/groupme" = {
|
|
||||||
proxyPass = "http://10.100.0.2:7439";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx.virtualHosts."marching.beepboop.systems" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
root = "/var/www/tfb.beepboop.systems";
|
|
||||||
locations."/" = {
|
|
||||||
extraConfig = ''
|
|
||||||
port_in_redirect off;
|
|
||||||
absolute_redirect off;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
locations."/groupme" = {
|
|
||||||
proxyPass = "http://10.100.0.2:7439";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
security.acme = {
|
|
||||||
acceptTerms = true;
|
|
||||||
defaults.email = "nickforanick@protonmail.com";
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
pcomon = (pkgs.callPackage ../../builds/pcomon.nix {});
|
|
||||||
in {
|
|
||||||
users.users.pcomon = {
|
|
||||||
isSystemUser = true;
|
|
||||||
group = "pcomon";
|
|
||||||
};
|
|
||||||
|
|
||||||
users.groups.pcomon = {};
|
|
||||||
|
|
||||||
systemd.services.pcomon = {
|
|
||||||
serviceConfig.type = "oneshot";
|
|
||||||
script = ''
|
|
||||||
${pkgs.coreutils}/bin/mkdir -p /run/pcomon
|
|
||||||
${pkgs.coreutils}/bin/chown -R pcomon:pcomon /run/pcomon
|
|
||||||
${pcomon}/bin/pcomon ${config.age.secrets.pcomon-secrets-file.path}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.timers.pcomon = {
|
|
||||||
wantedBy = [ "timers.target" ];
|
|
||||||
partOf = [ "pcomon.service" ];
|
|
||||||
timerConfig.OnCalendar = "*:0/30:*";
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
{ config, ... }:
|
|
||||||
{
|
|
||||||
services.radicale = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
auth = {
|
|
||||||
type = "htpasswd";
|
|
||||||
htpasswd_filename = config.age.secrets.radicale-passwd.path;
|
|
||||||
htpasswd_encryption = "plain";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx.virtualHosts."radicale.beepboop.systems" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://127.0.0.1:5232";
|
|
||||||
extraConfig = ''
|
|
||||||
proxy_set_header X-Script-Name /;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_pass_header Authorization;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx.virtualHosts."calendar.beepboop.systems" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
globalRedirect = "radicale.beepboop.systems";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx.virtualHosts."cal.beepboop.systems" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
globalRedirect = "radicale.beepboop.systems";
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,62 +0,0 @@
|
|||||||
{ pkgs, machines, ... }:
|
|
||||||
{
|
|
||||||
services.openssh = {
|
|
||||||
enable = true;
|
|
||||||
ports = [55555];
|
|
||||||
settings = {
|
|
||||||
X11Forwarding = false;
|
|
||||||
AllowTcpForwarding = true;
|
|
||||||
PermitRootLogin = "no";
|
|
||||||
PasswordAuthentication = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
users.users.ryan.openssh.authorizedKeys.keys = [
|
|
||||||
machines.copernicus.pubkey
|
|
||||||
machines.aristotle.pubkey
|
|
||||||
machines.phone.pubkey
|
|
||||||
];
|
|
||||||
|
|
||||||
# save ip addresses in cache from repeat logins
|
|
||||||
services.nginx.virtualHosts."localhost" = {
|
|
||||||
listen = [{ addr = "127.0.0.1"; port = 9414; }];
|
|
||||||
extraConfig = ''
|
|
||||||
location / {
|
|
||||||
proxy_pass_request_headers off;
|
|
||||||
proxy_pass https://ipinfo.io/;
|
|
||||||
proxy_cache_key $scheme://$host$uri$is_args$query_string;
|
|
||||||
proxy_cache_valid 203 1d;
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.etc."ssh/sshrc".text = ''
|
|
||||||
login_ip="''${SSH_CLIENT%% *}"
|
|
||||||
is_in_ignored=$(grep "$login_ip" /etc/ssh/ignored_ips -c)
|
|
||||||
if [ "$is_in_ignored" -gt 0 ]; then
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
time=$(date "+%T%:z")
|
|
||||||
geodata=$(
|
|
||||||
curl -s 127.0.0.1:9414/$login_ip |
|
|
||||||
sed '1d;$d;/readme/d;s/^ //g'
|
|
||||||
)
|
|
||||||
${pkgs.mailutils}/bin/mail \
|
|
||||||
ryan@beepboop.systems -r "ssh" \
|
|
||||||
-s "ssh login from $login_ip at $time" \
|
|
||||||
<<EOF
|
|
||||||
Hi there,
|
|
||||||
|
|
||||||
\`netbox\` was just logged into from $login_ip at $time (America/Chicago).
|
|
||||||
It was not in /etc/ssh/ignored_ips.
|
|
||||||
|
|
||||||
If this is you, that's great! If not, there is most certainly
|
|
||||||
an unauthorized user connected to the machine -- in which case, the
|
|
||||||
prudent course of action is to shut the machine down.
|
|
||||||
|
|
||||||
For your information, here is geolocation data from $login_ip.
|
|
||||||
|
|
||||||
$geodata
|
|
||||||
EOF
|
|
||||||
'';
|
|
||||||
}
|
|
@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
services.sslh = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
protocols = [
|
|
||||||
{
|
|
||||||
host = "localhost";
|
|
||||||
name = "ssh";
|
|
||||||
port = "55555";
|
|
||||||
service = "ssh";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
host = "localhost";
|
|
||||||
name = "tls";
|
|
||||||
port = "442";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
transparent = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
services.vaultwarden.enable = true;
|
|
||||||
services.vaultwarden.config = {
|
|
||||||
DOMAIN = "https://bitwarden.beepboop.systems";
|
|
||||||
SIGNUPS_ALLOWED = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx.virtualHosts."bit.beepboop.systems" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
globalRedirect = "bitwarden.beepboop.systems";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx.virtualHosts."bitwarden.beepboop.systems" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://127.0.0.1:8000";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,39 +0,0 @@
|
|||||||
{ config, machines, pkgs, ... }:
|
|
||||||
{
|
|
||||||
networking = {
|
|
||||||
nat = {
|
|
||||||
enable = true;
|
|
||||||
externalInterface = "eth0";
|
|
||||||
internalInterfaces = [ "wg0" ];
|
|
||||||
};
|
|
||||||
firewall.allowedUDPPorts = [ 50000 ];
|
|
||||||
|
|
||||||
wireguard.interfaces = {
|
|
||||||
wg0 = {
|
|
||||||
ips = [ "10.100.0.1/24" ];
|
|
||||||
|
|
||||||
listenPort = 50000;
|
|
||||||
|
|
||||||
postSetup = ''
|
|
||||||
${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -s 10.100.0.0/24 -o eth0 -j MASQUERADE
|
|
||||||
'';
|
|
||||||
postShutdown = ''
|
|
||||||
${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -s 10.100.0.0/24 -o eth0 -j MASQUERADE
|
|
||||||
'';
|
|
||||||
|
|
||||||
privateKeyFile = config.age.secrets.netbox-wg-priv.path;
|
|
||||||
|
|
||||||
peers = [
|
|
||||||
{ # copernicus
|
|
||||||
publicKey = machines.copernicus.wg-pubkey;
|
|
||||||
allowedIPs = [ "10.100.0.2/32" ];
|
|
||||||
}
|
|
||||||
{ # aristotle
|
|
||||||
publicKey = machines.aristotle.wg-pubkey;
|
|
||||||
allowedIPs = [ "10.100.0.3/32" ];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
2
boxes/phone/init/.gitignore
vendored
2
boxes/phone/init/.gitignore
vendored
@ -1,2 +0,0 @@
|
|||||||
app_cache/
|
|
||||||
gpapp_cache/
|
|
@ -1,18 +0,0 @@
|
|||||||
https://f-droid.org/repo/com.termux_1020.apk
|
|
||||||
https://f-droid.org/repo/com.termux.api_51.apk
|
|
||||||
https://f-droid.org/repo/com.termux.widget_13.apk
|
|
||||||
https://f-droid.org/repo/com.coboltforge.dontmind.multivnc_101.apk
|
|
||||||
https://f-droid.org/repo/com.kylecorry.trail_sense_124.apk
|
|
||||||
https://f-droid.org/repo/org.ligi.survivalmanual_428.apk
|
|
||||||
https://github.com/bitwarden/android/releases/download/v2024.4.0/com.x8bit.bitwarden.apk
|
|
||||||
https://f-droid.org/repo/at.bitfire.icsdroid_81.apk
|
|
||||||
https://f-droid.org/repo/ws.xsoh.etar_47.apk
|
|
||||||
https://f-droid.org/repo/at.bitfire.davdroid_404030200.apk
|
|
||||||
https://f-droid.org/repo/org.oxycblt.auxio_53.apk
|
|
||||||
https://f-droid.org/repo/de.danoeh.antennapod_3050095.apk
|
|
||||||
https://f-droid.org/repo/eu.faircode.email_2241.apk
|
|
||||||
https://f-droid.org/repo/org.koreader.launcher.fdroid_105232.apk
|
|
||||||
https://f-droid.org/repo/at.techbee.jtx_209010003.apk
|
|
||||||
https://f-droid.org/repo/mn.tck.semitone_4.apk
|
|
||||||
https://f-droid.org/repo/de.moekadu.tuner_38.apk
|
|
||||||
https://f-droid.org/repo/io.github.domi04151309.home_1100.apk
|
|
@ -1,3 +0,0 @@
|
|||||||
com.ministrycentered.PlanningCenter
|
|
||||||
com.groupme.android
|
|
||||||
com.brivo.pass
|
|
@ -1,34 +0,0 @@
|
|||||||
mkdir -p app_cache
|
|
||||||
for i in $(cat apps); do
|
|
||||||
output_name=$(echo $i | awk -F'/' '{print $NF}')
|
|
||||||
curl "$i" --max-redirs 999 -L -C - -o "app_cache/$output_name"
|
|
||||||
adb install "app_cache/$output_name"
|
|
||||||
done
|
|
||||||
|
|
||||||
mkdir -p gpapp_cache
|
|
||||||
for i in $(cat gpapps); do
|
|
||||||
apkeep -a "$i" ./gpapp_cache/
|
|
||||||
done
|
|
||||||
|
|
||||||
for i in $(ls gpapp_cache/ | grep xapk); do
|
|
||||||
# this is specific to planning center online
|
|
||||||
xapk_playground=$(mktemp)
|
|
||||||
rm $xapk_playground
|
|
||||||
mkdir $xapk_playground
|
|
||||||
|
|
||||||
cp gpapp_cache/$i $xapk_playground
|
|
||||||
cd $xapk_playground
|
|
||||||
mkdir out
|
|
||||||
unzip $i -d out
|
|
||||||
cd -
|
|
||||||
cd $xapk_playground/out
|
|
||||||
rm icon.png
|
|
||||||
rm manifest.json
|
|
||||||
adb install-multiple *
|
|
||||||
cd -
|
|
||||||
done
|
|
||||||
|
|
||||||
cd gpapp_cache
|
|
||||||
for i in $(ls | grep '\.apk'); do
|
|
||||||
adb install $i
|
|
||||||
done
|
|
@ -1,7 +0,0 @@
|
|||||||
{ pkgs ? import <nixpkgs> {} }:
|
|
||||||
|
|
||||||
pkgs.mkShell {
|
|
||||||
packages = [
|
|
||||||
pkgs.apkeep
|
|
||||||
];
|
|
||||||
}
|
|
4
boxes/phone/out-of-tree/.gitignore
vendored
4
boxes/phone/out-of-tree/.gitignore
vendored
@ -1,4 +0,0 @@
|
|||||||
git-annex-install
|
|
||||||
git-annex-install.*
|
|
||||||
git-annex.linux
|
|
||||||
|
|
@ -1,90 +0,0 @@
|
|||||||
termux: termux-pkgs termux-dots utils-sh rebuild-sh st pip-pkgs git-annex.linux sssg statusbar-polyfill
|
|
||||||
|
|
||||||
list: options # alias
|
|
||||||
options:
|
|
||||||
@echo specific options
|
|
||||||
@echo st - rebuild st
|
|
||||||
@echo utils-sh - copy utilities
|
|
||||||
@echo pip-pkgs - install pip packages
|
|
||||||
@echo termux-pkgs - install termux pkgs
|
|
||||||
@echo termux-dots - install termux dotfiles
|
|
||||||
@echo git-annex.linux - install git-annex
|
|
||||||
@echo sssg - install sssg
|
|
||||||
|
|
||||||
st:
|
|
||||||
-cd ../../../builds/st/ && CFLAGS="-DIS_PHONE" CC=clang make && cp st ~/.local/bin/st
|
|
||||||
|
|
||||||
utils-sh:
|
|
||||||
mkdir -p ~/.local/bin
|
|
||||||
cp ../../../builds/utils/* ~/.local/bin
|
|
||||||
|
|
||||||
rebuild-sh:
|
|
||||||
mkdir -p ~/.local/bin
|
|
||||||
cp ../../../builds/rebuild/* ~/.local/bin
|
|
||||||
pip-pkgs:
|
|
||||||
pip3 install vdirsyncer
|
|
||||||
pip3 install khal
|
|
||||||
# pip3 install khard
|
|
||||||
|
|
||||||
termux-pkgs:
|
|
||||||
pkg install -y \
|
|
||||||
tur-repo \
|
|
||||||
x11-repo
|
|
||||||
|
|
||||||
pkg install -y \
|
|
||||||
neovim \
|
|
||||||
python-pip \
|
|
||||||
feh \
|
|
||||||
xdotool \
|
|
||||||
git \
|
|
||||||
tig \
|
|
||||||
tigervnc \
|
|
||||||
sxhkd \
|
|
||||||
clang \
|
|
||||||
elinks \
|
|
||||||
tmux \
|
|
||||||
fontconfig \
|
|
||||||
xorgproto \
|
|
||||||
fzy \
|
|
||||||
man \
|
|
||||||
libxft \
|
|
||||||
firefox \
|
|
||||||
mupdf \
|
|
||||||
texlive-bin \
|
|
||||||
htop \
|
|
||||||
rbw \
|
|
||||||
pkg-config \
|
|
||||||
xorg-xrandr \
|
|
||||||
bspwm \
|
|
||||||
termux-api \
|
|
||||||
jq \
|
|
||||||
xclip \
|
|
||||||
isync \
|
|
||||||
neomutt \
|
|
||||||
pandoc \
|
|
||||||
wget \
|
|
||||||
which \
|
|
||||||
rsync \
|
|
||||||
openssl \
|
|
||||||
chromium
|
|
||||||
|
|
||||||
termux-dots:
|
|
||||||
mkdir -p ~/.local/bin
|
|
||||||
ln -sf $(CURDIR)/../../../.config ~/.config
|
|
||||||
ln -sf $(CURDIR)/../../../.config/ssh/config ~/.ssh/config
|
|
||||||
ln -sf ~/.config/bash/bashrc ~/.bashrc
|
|
||||||
ln -sf ~/.config/bash/profile ~/.bash_profile
|
|
||||||
mkdir -p ~/.local/share
|
|
||||||
cp $(CURDIR)/../../../home/wallpapers/pape.jpg ~/.local/share
|
|
||||||
mkdir -p ~/.shortcuts
|
|
||||||
cp $(CURDIR)/shortcuts/* ~/.shortcuts
|
|
||||||
|
|
||||||
git-annex.linux:
|
|
||||||
bash install-git-annex.sh
|
|
||||||
|
|
||||||
sssg:
|
|
||||||
-cp ~/git/sssg/sssg.sh ~/.local/bin/sssg
|
|
||||||
-chmod +x ~/.local/bin/sssg
|
|
||||||
|
|
||||||
statusbar-polyfill:
|
|
||||||
cp ~/dot_testing/builds/statusbar/termux-statusbar-polyfill ~/.local/bin
|
|
@ -1,7 +0,0 @@
|
|||||||
wget https://git-annex.branchable.com/install/Android/git-annex-install
|
|
||||||
MY_WD=$(pwd)
|
|
||||||
|
|
||||||
source git-annex-install || printf "failed\n"
|
|
||||||
|
|
||||||
cd "$MY_WD"
|
|
||||||
mv ~/git-annex.linux ./
|
|
@ -1,19 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
today=$(date "+%m/%d/%Y")
|
|
||||||
|
|
||||||
printf "Inputting height and weight information for today\n\n"
|
|
||||||
printf "Height?\n"
|
|
||||||
|
|
||||||
read -p "?>" height
|
|
||||||
|
|
||||||
printf "Weight?\n"
|
|
||||||
|
|
||||||
read -p "?>" weight
|
|
||||||
|
|
||||||
cd ~/pdbs
|
|
||||||
printf "\n%s %i" "$today" "$weight" >> weight.timeseries
|
|
||||||
printf "\n%s %i" "$today" "$height" >> height.timeseries
|
|
||||||
|
|
||||||
git add weight.timeseries height.timeseries
|
|
||||||
git commit -m "added height, weight data for $today"
|
|
@ -1,19 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
today=$(date "+%m/%d/%Y")
|
|
||||||
ledgerdate=$(date "+%Y/%m/%d")
|
|
||||||
|
|
||||||
printf "Inputting an expense for today\n\n"
|
|
||||||
printf "Payee name?\n"
|
|
||||||
|
|
||||||
read -p "?>" payee
|
|
||||||
|
|
||||||
printf "Amount?\n"
|
|
||||||
|
|
||||||
read -p "?>" amount
|
|
||||||
|
|
||||||
cd ~/pdbs
|
|
||||||
printf '%s * %s\n\tExpenses:%s $%s\n\tAssets:Greencard 4154\n\n' "$ledgerdate" "$payee" "$payee" "$amount" >> phone.ledger
|
|
||||||
|
|
||||||
git add phone.ledger
|
|
||||||
git commit -m "added an expense for $today"
|
|
@ -1,9 +0,0 @@
|
|||||||
register_habits=$(ls ~/pdbs/ |
|
|
||||||
grep '\.habit$' |
|
|
||||||
fzy)
|
|
||||||
|
|
||||||
if [ -z "$register_habits" ]; then
|
|
||||||
echo "you didn't choose one!"
|
|
||||||
else
|
|
||||||
date "+%m/%d/%Y" >> ~/pdbs/$register_habits
|
|
||||||
fi
|
|
@ -1,31 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
day5=$(date --date="5 days ago" "+%m/%d/%Y")
|
|
||||||
day4=$(date --date="4 days ago" "+%m/%d/%Y")
|
|
||||||
day3=$(date --date="3 days ago" "+%m/%d/%Y")
|
|
||||||
day2=$(date --date="2 days ago" "+%m/%d/%Y")
|
|
||||||
day1=$(date --date="1 days ago" "+%m/%d/%Y")
|
|
||||||
today=$(date "+%m/%d/%Y")
|
|
||||||
|
|
||||||
# $1 -- habit filename
|
|
||||||
show_past_habit () {
|
|
||||||
printf "%25s =========\n" "$1"
|
|
||||||
donein5days=$(grep -c "$day5" "$HOME/pdbs/$1")
|
|
||||||
donein4days=$(grep -c "$day4" "$HOME/pdbs/$1")
|
|
||||||
donein3days=$(grep -c "$day3" "$HOME/pdbs/$1")
|
|
||||||
donein2days=$(grep -c "$day2" "$HOME/pdbs/$1")
|
|
||||||
donein1days=$(grep -c "$day1" "$HOME/pdbs/$1")
|
|
||||||
donetoday=$(grep -c "$today" "$HOME/pdbs/$1")
|
|
||||||
|
|
||||||
printf "%.5s %.5s %.5s %.5s %.5s %.5s\n%5s %5s %5s %5s %5s %5s\n\n" \
|
|
||||||
"$day5" "$day4" "$day3" "$day2" "$day1" "$today" \
|
|
||||||
"$donein5days" "$donein4days" "$donein3days" \
|
|
||||||
"$donein2days" "$donein1days" "$donetoday"
|
|
||||||
}
|
|
||||||
|
|
||||||
habits=$(ls ~/pdbs | grep '\.habit$')
|
|
||||||
for i in $habits; do
|
|
||||||
show_past_habit "$i"
|
|
||||||
done
|
|
||||||
|
|
||||||
read THROWAWAY
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit bc3aad5943208972ff1bee43f8e732e0c355c8fd
|
|
@ -1,21 +0,0 @@
|
|||||||
{ lib, stdenv, fetchurl, libX11, libXinerama, libXft, zlib }:
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
pname = "dmenu";
|
|
||||||
version = "5.2";
|
|
||||||
|
|
||||||
src = ./dmenu;
|
|
||||||
|
|
||||||
buildInputs = [ libX11 libXinerama zlib libXft ];
|
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
sed -ri -e 's!\<(dmenu|dmenu_path|stest)\>!'"$out/bin"'/&!g' dmenu_run
|
|
||||||
sed -ri -e 's!\<stest\>!'"$out/bin"'/&!g' dmenu_path
|
|
||||||
'';
|
|
||||||
|
|
||||||
preConfigure = ''
|
|
||||||
sed -i "s@PREFIX = /usr/local@PREFIX = $out@g" config.mk
|
|
||||||
'';
|
|
||||||
|
|
||||||
makeFlags = [ "CC:=$(CC)" ];
|
|
||||||
}
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 7248b43424def635e2a6194281e84ec0689fd7ba
|
|
@ -1,20 +0,0 @@
|
|||||||
{ stdenv
|
|
||||||
, libX11
|
|
||||||
, libXinerama
|
|
||||||
, libXft
|
|
||||||
}:
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
pname = "dwm";
|
|
||||||
version = "6.5";
|
|
||||||
|
|
||||||
src = ./dwm;
|
|
||||||
|
|
||||||
buildInputs = [ libX11 libXinerama libXft ];
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/bin
|
|
||||||
cp dwm $out/bin
|
|
||||||
cp dwm-setstatus $out/bin
|
|
||||||
'';
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
{ python3Packages, fetchgit }:
|
|
||||||
with python3Packages;
|
|
||||||
buildPythonApplication rec {
|
|
||||||
pname = "flasktrack";
|
|
||||||
version = "1.0.0";
|
|
||||||
format = "other";
|
|
||||||
|
|
||||||
propagatedBuildInputs = [ flask ];
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
|
|
||||||
mkdir -p $out/${pythonPackages.python.sitePackages}
|
|
||||||
cp -r ./${pname} $out/${pythonPackages.python.sitePackages}/${pname}
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
shellHook = "export FLASK_APP=${pname}";
|
|
||||||
|
|
||||||
src = fetchgit {
|
|
||||||
url = "https://git.beepboop.systems/stupidcomputer/flasktrack";
|
|
||||||
hash = "sha256-ezR+Y0ciA5+SVEOIWYUtmVxMeNpcVKXOBe1OSgYm0sA=";
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
{ python3Packages, system-sendmail, fetchgit }:
|
|
||||||
with python3Packages;
|
|
||||||
buildPythonApplication {
|
|
||||||
pname = "pcomon";
|
|
||||||
version = "1.0.0";
|
|
||||||
|
|
||||||
propagatedBuildInputs = [ requests system-sendmail ];
|
|
||||||
|
|
||||||
src = fetchgit {
|
|
||||||
url = "https://git.beepboop.systems/stupidcomputer/pcomon";
|
|
||||||
hash = "sha256-XxPb1WWq5YQz+UZ7P5dgInPweSD+52R2XVmoVrV0GMQ=";
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
{ stdenv
|
|
||||||
, lib
|
|
||||||
, bash
|
|
||||||
, makeWrapper
|
|
||||||
}:
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
pname = "rebuild";
|
|
||||||
version = "1.00";
|
|
||||||
|
|
||||||
src = ./rebuild;
|
|
||||||
|
|
||||||
nativeBuildInputs = [ makeWrapper ];
|
|
||||||
buildInputs = [ bash ];
|
|
||||||
|
|
||||||
buildPhase = "";
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/bin
|
|
||||||
cp $src/rebuild $out/bin
|
|
||||||
cp $src/git-rebuild $out/bin
|
|
||||||
cp $src/nix-sanitation $out/bin
|
|
||||||
wrapProgram $out/bin/rebuild --prefix PATH : ${lib.makeBinPath [ bash ]}
|
|
||||||
'';
|
|
||||||
|
|
||||||
phases = [ "buildPhase" "installPhase" ];
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# make sure we're in dot_testing
|
|
||||||
cd ~/dot_testing
|
|
||||||
|
|
||||||
git pull
|
|
||||||
git stash
|
|
||||||
git rebase
|
|
||||||
|
|
||||||
rebuild
|
|
@ -1,7 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
printf "clearing out nix caches\n"
|
|
||||||
|
|
||||||
sudo nix-collect-garbage -d
|
|
||||||
nix-collect-garbage -d
|
|
||||||
sudo nix-store --optimize
|
|
@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
if [ -d "$HOME/dot_testing" ]; then
|
|
||||||
cd ~/dot_testing
|
|
||||||
elif [ -d "$HOME/dots" ]; then
|
|
||||||
cd ~/dots
|
|
||||||
fi
|
|
||||||
|
|
||||||
machine=$(hostname)
|
|
||||||
|
|
||||||
if [ "$machine" = "localhost" ]; then
|
|
||||||
machine="phone"
|
|
||||||
fi
|
|
||||||
|
|
||||||
sh boxes/$machine/custom_command $@
|
|
@ -1,13 +0,0 @@
|
|||||||
{ python3Packages, fetchgit }:
|
|
||||||
with python3Packages;
|
|
||||||
buildPythonApplication {
|
|
||||||
pname = "sssg";
|
|
||||||
version = "1.1";
|
|
||||||
|
|
||||||
propagatedBuildInputs = [ markdown jinja2 watchdog ];
|
|
||||||
|
|
||||||
src = fetchgit {
|
|
||||||
url = "https://git.beepboop.systems/stupidcomputer/sssg";
|
|
||||||
hash = "sha256-17FRRgOGH/ZF6IrTprubiaZI/ihFSB4zu1spoxUZ2bA=";
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
{ stdenv
|
|
||||||
, lib
|
|
||||||
, pkg-config
|
|
||||||
, libX11
|
|
||||||
, libXft
|
|
||||||
, fontconfig
|
|
||||||
, freetype
|
|
||||||
, ncurses
|
|
||||||
, lightMode ? false
|
|
||||||
, aristotle ? false
|
|
||||||
, extraLibs ? [ ]
|
|
||||||
}:
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
pname = "st";
|
|
||||||
version = "1.02";
|
|
||||||
|
|
||||||
src = ./st;
|
|
||||||
|
|
||||||
nativeBuildInputs = [ pkg-config fontconfig freetype ncurses ];
|
|
||||||
buildInputs = [ libX11 libXft ] ++ extraLibs;
|
|
||||||
|
|
||||||
buildPhase =
|
|
||||||
lib.optionalString (lightMode == true) "cp lightmode.h colors.h; " +
|
|
||||||
lib.optionalString (aristotle == true) "CFLAGS='-DARISTOTLE' " +
|
|
||||||
''
|
|
||||||
make
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/bin
|
|
||||||
cp ${pname} $out/bin
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
description = "Customized builds of the st terminal emulator";
|
|
||||||
homepage = "https://git.beepboop.systems/rndusr/st";
|
|
||||||
license = licenses.mit;
|
|
||||||
};
|
|
||||||
}
|
|
4
builds/st/.gitignore
vendored
4
builds/st/.gitignore
vendored
@ -1,4 +0,0 @@
|
|||||||
st
|
|
||||||
st.o
|
|
||||||
tags
|
|
||||||
x.o
|
|
250
builds/st/FAQ
250
builds/st/FAQ
@ -1,250 +0,0 @@
|
|||||||
## Why does st not handle utmp entries?
|
|
||||||
|
|
||||||
Use the excellent tool of [utmp](https://git.suckless.org/utmp/) for this task.
|
|
||||||
|
|
||||||
|
|
||||||
## Some _random program_ complains that st is unknown/not recognised/unsupported/whatever!
|
|
||||||
|
|
||||||
It means that st doesn’t have any terminfo entry on your system. Chances are
|
|
||||||
you did not `make install`. If you just want to test it without installing it,
|
|
||||||
you can manually run `tic -sx st.info`.
|
|
||||||
|
|
||||||
|
|
||||||
## Nothing works, and nothing is said about an unknown terminal!
|
|
||||||
|
|
||||||
* Some programs just assume they’re running in xterm i.e. they don’t rely on
|
|
||||||
terminfo. What you see is the current state of the “xterm compliance”.
|
|
||||||
* Some programs don’t complain about the lacking st description and default to
|
|
||||||
another terminal. In that case see the question about terminfo.
|
|
||||||
|
|
||||||
|
|
||||||
## How do I scroll back up?
|
|
||||||
|
|
||||||
* Using a terminal multiplexer.
|
|
||||||
* `st -e tmux` using C-b [
|
|
||||||
* `st -e screen` using C-a ESC
|
|
||||||
* Using the excellent tool of [scroll](https://git.suckless.org/scroll/).
|
|
||||||
* Using the scrollback [patch](https://st.suckless.org/patches/scrollback/).
|
|
||||||
|
|
||||||
|
|
||||||
## I would like to have utmp and/or scroll functionality by default
|
|
||||||
|
|
||||||
You can add the absolute path of both programs in your config.h file. You only
|
|
||||||
have to modify the value of utmp and scroll variables.
|
|
||||||
|
|
||||||
|
|
||||||
## Why doesn't the Del key work in some programs?
|
|
||||||
|
|
||||||
Taken from the terminfo manpage:
|
|
||||||
|
|
||||||
If the terminal has a keypad that transmits codes when the keys
|
|
||||||
are pressed, this information can be given. Note that it is not
|
|
||||||
possible to handle terminals where the keypad only works in
|
|
||||||
local (this applies, for example, to the unshifted HP 2621 keys).
|
|
||||||
If the keypad can be set to transmit or not transmit, give these
|
|
||||||
codes as smkx and rmkx. Otherwise the keypad is assumed to
|
|
||||||
always transmit.
|
|
||||||
|
|
||||||
In the st case smkx=E[?1hE= and rmkx=E[?1lE>, so it is mandatory that
|
|
||||||
applications which want to test against keypad keys send these
|
|
||||||
sequences.
|
|
||||||
|
|
||||||
But buggy applications (like bash and irssi, for example) don't do this. A fast
|
|
||||||
solution for them is to use the following command:
|
|
||||||
|
|
||||||
$ printf '\033[?1h\033=' >/dev/tty
|
|
||||||
|
|
||||||
or
|
|
||||||
$ tput smkx
|
|
||||||
|
|
||||||
In the case of bash, readline is used. Readline has a different note in its
|
|
||||||
manpage about this issue:
|
|
||||||
|
|
||||||
enable-keypad (Off)
|
|
||||||
When set to On, readline will try to enable the
|
|
||||||
application keypad when it is called. Some systems
|
|
||||||
need this to enable arrow keys.
|
|
||||||
|
|
||||||
Adding this option to your .inputrc will fix the keypad problem for all
|
|
||||||
applications using readline.
|
|
||||||
|
|
||||||
If you are using zsh, then read the zsh FAQ
|
|
||||||
<http://zsh.sourceforge.net/FAQ/zshfaq03.html#l25>:
|
|
||||||
|
|
||||||
It should be noted that the O / [ confusion can occur with other keys
|
|
||||||
such as Home and End. Some systems let you query the key sequences
|
|
||||||
sent by these keys from the system's terminal database, terminfo.
|
|
||||||
Unfortunately, the key sequences given there typically apply to the
|
|
||||||
mode that is not the one zsh uses by default (it's the "application"
|
|
||||||
mode rather than the "raw" mode). Explaining the use of terminfo is
|
|
||||||
outside of the scope of this FAQ, but if you wish to use the key
|
|
||||||
sequences given there you can tell the line editor to turn on
|
|
||||||
"application" mode when it starts and turn it off when it stops:
|
|
||||||
|
|
||||||
function zle-line-init () { echoti smkx }
|
|
||||||
function zle-line-finish () { echoti rmkx }
|
|
||||||
zle -N zle-line-init
|
|
||||||
zle -N zle-line-finish
|
|
||||||
|
|
||||||
Putting these lines into your .zshrc will fix the problems.
|
|
||||||
|
|
||||||
|
|
||||||
## How can I use meta in 8bit mode?
|
|
||||||
|
|
||||||
St supports meta in 8bit mode, but the default terminfo entry doesn't
|
|
||||||
use this capability. If you want it, you have to use the 'st-meta' value
|
|
||||||
in TERM.
|
|
||||||
|
|
||||||
|
|
||||||
## I cannot compile st in OpenBSD
|
|
||||||
|
|
||||||
OpenBSD lacks librt, despite it being mandatory in POSIX
|
|
||||||
<http://pubs.opengroup.org/onlinepubs/9699919799/utilities/c99.html#tag_20_11_13>.
|
|
||||||
If you want to compile st for OpenBSD you have to remove -lrt from config.mk, and
|
|
||||||
st will compile without any loss of functionality, because all the functions are
|
|
||||||
included in libc on this platform.
|
|
||||||
|
|
||||||
|
|
||||||
## The Backspace Case
|
|
||||||
|
|
||||||
St is emulating the Linux way of handling backspace being delete and delete being
|
|
||||||
backspace.
|
|
||||||
|
|
||||||
This is an issue that was discussed in suckless mailing list
|
|
||||||
<https://lists.suckless.org/dev/1404/20697.html>. Here is why some old grumpy
|
|
||||||
terminal users wants its backspace to be how he feels it:
|
|
||||||
|
|
||||||
Well, I am going to comment why I want to change the behaviour
|
|
||||||
of this key. When ASCII was defined in 1968, communication
|
|
||||||
with computers was done using punched cards, or hardcopy
|
|
||||||
terminals (basically a typewriter machine connected with the
|
|
||||||
computer using a serial port). ASCII defines DELETE as 7F,
|
|
||||||
because, in punched-card terms, it means all the holes of the
|
|
||||||
card punched; it is thus a kind of 'physical delete'. In the
|
|
||||||
same way, the BACKSPACE key was a non-destructive backspace,
|
|
||||||
as on a typewriter. So, if you wanted to delete a character,
|
|
||||||
you had to BACKSPACE and then DELETE. Another use of BACKSPACE
|
|
||||||
was to type accented characters, for example 'a BACKSPACE `'.
|
|
||||||
The VT100 had no BACKSPACE key; it was generated using the
|
|
||||||
CONTROL key as another control character (CONTROL key sets to
|
|
||||||
0 b7 b6 b5, so it converts H (code 0x48) into BACKSPACE (code
|
|
||||||
0x08)), but it had a DELETE key in a similar position where
|
|
||||||
the BACKSPACE key is located today on common PC keyboards.
|
|
||||||
All the terminal emulators emulated the difference between
|
|
||||||
these keys correctly: the backspace key generated a BACKSPACE
|
|
||||||
(^H) and delete key generated a DELETE (^?).
|
|
||||||
|
|
||||||
But a problem arose when Linus Torvalds wrote Linux. Unlike
|
|
||||||
earlier terminals, the Linux virtual terminal (the terminal
|
|
||||||
emulator integrated in the kernel) returned a DELETE when
|
|
||||||
backspace was pressed, due to the VT100 having a DELETE key in
|
|
||||||
the same position. This created a lot of problems (see [1]
|
|
||||||
and [2]). Since Linux has become the king, a lot of terminal
|
|
||||||
emulators today generate a DELETE when the backspace key is
|
|
||||||
pressed in order to avoid problems with Linux. The result is
|
|
||||||
that the only way of generating a BACKSPACE on these systems
|
|
||||||
is by using CONTROL + H. (I also think that emacs had an
|
|
||||||
important point here because the CONTROL + H prefix is used
|
|
||||||
in emacs in some commands (help commands).)
|
|
||||||
|
|
||||||
From point of view of the kernel, you can change the key
|
|
||||||
for deleting a previous character with stty erase. When you
|
|
||||||
connect a real terminal into a machine you describe the type
|
|
||||||
of terminal, so getty configures the correct value of stty
|
|
||||||
erase for this terminal. In the case of terminal emulators,
|
|
||||||
however, you don't have any getty that can set the correct
|
|
||||||
value of stty erase, so you always get the default value.
|
|
||||||
For this reason, it is necessary to add 'stty erase ^H' to your
|
|
||||||
profile if you have changed the value of the backspace key.
|
|
||||||
Of course, another solution is for st itself to modify the
|
|
||||||
value of stty erase. I usually have the inverse problem:
|
|
||||||
when I connect to non-Unix machines, I have to press CONTROL +
|
|
||||||
h to get a BACKSPACE. The inverse problem occurs when a user
|
|
||||||
connects to my Unix machines from a different system with a
|
|
||||||
correct backspace key.
|
|
||||||
|
|
||||||
[1] http://www.ibb.net/~anne/keyboard.html
|
|
||||||
[2] http://www.tldp.org/HOWTO/Keyboard-and-Console-HOWTO-5.html
|
|
||||||
|
|
||||||
|
|
||||||
## But I really want the old grumpy behaviour of my terminal
|
|
||||||
|
|
||||||
Apply [1].
|
|
||||||
|
|
||||||
[1] https://st.suckless.org/patches/delkey
|
|
||||||
|
|
||||||
|
|
||||||
## Why do images not work in st using the w3m image hack?
|
|
||||||
|
|
||||||
w3mimg uses a hack that draws an image on top of the terminal emulator Drawable
|
|
||||||
window. The hack relies on the terminal to use a single buffer to draw its
|
|
||||||
contents directly.
|
|
||||||
|
|
||||||
st uses double-buffered drawing so the image is quickly replaced and may show a
|
|
||||||
short flicker effect.
|
|
||||||
|
|
||||||
Below is a patch example to change st double-buffering to a single Drawable
|
|
||||||
buffer.
|
|
||||||
|
|
||||||
diff --git a/x.c b/x.c
|
|
||||||
--- a/x.c
|
|
||||||
+++ b/x.c
|
|
||||||
@@ -732,10 +732,6 @@ xresize(int col, int row)
|
|
||||||
win.tw = col * win.cw;
|
|
||||||
win.th = row * win.ch;
|
|
||||||
|
|
||||||
- XFreePixmap(xw.dpy, xw.buf);
|
|
||||||
- xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h,
|
|
||||||
- DefaultDepth(xw.dpy, xw.scr));
|
|
||||||
- XftDrawChange(xw.draw, xw.buf);
|
|
||||||
xclear(0, 0, win.w, win.h);
|
|
||||||
|
|
||||||
/* resize to new width */
|
|
||||||
@@ -1148,8 +1144,7 @@ xinit(int cols, int rows)
|
|
||||||
gcvalues.graphics_exposures = False;
|
|
||||||
dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures,
|
|
||||||
&gcvalues);
|
|
||||||
- xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h,
|
|
||||||
- DefaultDepth(xw.dpy, xw.scr));
|
|
||||||
+ xw.buf = xw.win;
|
|
||||||
XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
|
|
||||||
XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, win.w, win.h);
|
|
||||||
|
|
||||||
@@ -1632,8 +1627,6 @@ xdrawline(Line line, int x1, int y1, int x2)
|
|
||||||
void
|
|
||||||
xfinishdraw(void)
|
|
||||||
{
|
|
||||||
- XCopyArea(xw.dpy, xw.buf, xw.win, dc.gc, 0, 0, win.w,
|
|
||||||
- win.h, 0, 0);
|
|
||||||
XSetForeground(xw.dpy, dc.gc,
|
|
||||||
dc.col[IS_SET(MODE_REVERSE)?
|
|
||||||
defaultfg : defaultbg].pixel);
|
|
||||||
|
|
||||||
|
|
||||||
## BadLength X error in Xft when trying to render emoji
|
|
||||||
|
|
||||||
Xft makes st crash when rendering color emojis with the following error:
|
|
||||||
|
|
||||||
"X Error of failed request: BadLength (poly request too large or internal Xlib length error)"
|
|
||||||
Major opcode of failed request: 139 (RENDER)
|
|
||||||
Minor opcode of failed request: 20 (RenderAddGlyphs)
|
|
||||||
Serial number of failed request: 1595
|
|
||||||
Current serial number in output stream: 1818"
|
|
||||||
|
|
||||||
This is a known bug in Xft (not st) which happens on some platforms and
|
|
||||||
combination of particular fonts and fontconfig settings.
|
|
||||||
|
|
||||||
See also:
|
|
||||||
https://gitlab.freedesktop.org/xorg/lib/libxft/issues/6
|
|
||||||
https://bugs.freedesktop.org/show_bug.cgi?id=107534
|
|
||||||
https://bugzilla.redhat.com/show_bug.cgi?id=1498269
|
|
||||||
|
|
||||||
The solution is to remove color emoji fonts or disable this in the fontconfig
|
|
||||||
XML configuration. As an ugly workaround (which may work only on newer
|
|
||||||
fontconfig versions (FC_COLOR)), the following code can be used to mask color
|
|
||||||
fonts:
|
|
||||||
|
|
||||||
FcPatternAddBool(fcpattern, FC_COLOR, FcFalse);
|
|
||||||
|
|
||||||
Please don't bother reporting this bug to st, but notify the upstream Xft
|
|
||||||
developers about fixing this bug.
|
|
@ -1,17 +0,0 @@
|
|||||||
A STATEMENT ON LEGACY SUPPORT
|
|
||||||
|
|
||||||
In the terminal world there is much cruft that comes from old and unsup‐
|
|
||||||
ported terminals that inherit incompatible modes and escape sequences
|
|
||||||
which noone is able to know, except when he/she comes from that time and
|
|
||||||
developed a graphical vt100 emulator at that time.
|
|
||||||
|
|
||||||
One goal of st is to only support what is really needed. When you en‐
|
|
||||||
counter a sequence which you really need, implement it. But while you
|
|
||||||
are at it, do not add the other cruft you might encounter while sneek‐
|
|
||||||
ing at other terminal emulators. History has bloated them and there is
|
|
||||||
no real evidence that most of the sequences are used today.
|
|
||||||
|
|
||||||
|
|
||||||
Christoph Lohmann <20h@r-36.net>
|
|
||||||
2012-09-13T07:00:36.081271045+02:00
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
|||||||
MIT/X Consortium License
|
|
||||||
|
|
||||||
© 2014-2022 Hiltjo Posthuma <hiltjo at codemadness dot org>
|
|
||||||
© 2018 Devin J. Pohly <djpohly at gmail dot com>
|
|
||||||
© 2014-2017 Quentin Rameau <quinq at fifth dot space>
|
|
||||||
© 2009-2012 Aurélien APTEL <aurelien dot aptel at gmail dot com>
|
|
||||||
© 2008-2017 Anselm R Garbe <garbeam at gmail dot com>
|
|
||||||
© 2012-2017 Roberto E. Vargas Caballero <k0ga at shike2 dot com>
|
|
||||||
© 2012-2016 Christoph Lohmann <20h at r-36 dot net>
|
|
||||||
© 2013 Eon S. Jeon <esjeon at hyunmu dot am>
|
|
||||||
© 2013 Alexander Sedov <alex0player at gmail dot com>
|
|
||||||
© 2013 Mark Edgar <medgar123 at gmail dot com>
|
|
||||||
© 2013-2014 Eric Pruitt <eric.pruitt at gmail dot com>
|
|
||||||
© 2013 Michael Forney <mforney at mforney dot org>
|
|
||||||
© 2013-2014 Markus Teich <markus dot teich at stusta dot mhn dot de>
|
|
||||||
© 2014-2015 Laslo Hunhold <dev at frign dot de>
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a
|
|
||||||
copy of this software and associated documentation files (the "Software"),
|
|
||||||
to deal in the Software without restriction, including without limitation
|
|
||||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
||||||
and/or sell copies of the Software, and to permit persons to whom the
|
|
||||||
Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
||||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
||||||
DEALINGS IN THE SOFTWARE.
|
|
@ -1,57 +0,0 @@
|
|||||||
# st - simple terminal
|
|
||||||
# See LICENSE file for copyright and license details.
|
|
||||||
.POSIX:
|
|
||||||
|
|
||||||
include config.mk
|
|
||||||
|
|
||||||
SRC = st.c x.c
|
|
||||||
OBJ = $(SRC:.c=.o)
|
|
||||||
|
|
||||||
all: options st
|
|
||||||
|
|
||||||
options:
|
|
||||||
@echo st build options:
|
|
||||||
@echo "CFLAGS = $(STCFLAGS)"
|
|
||||||
@echo "LDFLAGS = $(STLDFLAGS)"
|
|
||||||
@echo "CC = $(CC)"
|
|
||||||
|
|
||||||
config.h:
|
|
||||||
cp config.def.h config.h
|
|
||||||
|
|
||||||
.c.o:
|
|
||||||
$(CC) $(STCFLAGS) -c $<
|
|
||||||
|
|
||||||
st.o: config.h st.h win.h
|
|
||||||
x.o: arg.h config.h st.h win.h
|
|
||||||
|
|
||||||
$(OBJ): config.h config.mk
|
|
||||||
|
|
||||||
st: $(OBJ)
|
|
||||||
$(CC) -o $@ $(OBJ) $(STLDFLAGS)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f st $(OBJ) st-$(VERSION).tar.gz
|
|
||||||
|
|
||||||
dist: clean
|
|
||||||
mkdir -p st-$(VERSION)
|
|
||||||
cp -R FAQ LEGACY TODO LICENSE Makefile README config.mk\
|
|
||||||
config.def.h st.info st.1 arg.h st.h win.h $(SRC)\
|
|
||||||
st-$(VERSION)
|
|
||||||
tar -cf - st-$(VERSION) | gzip > st-$(VERSION).tar.gz
|
|
||||||
rm -rf st-$(VERSION)
|
|
||||||
|
|
||||||
install: st
|
|
||||||
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
|
||||||
cp -f st $(DESTDIR)$(PREFIX)/bin
|
|
||||||
chmod 755 $(DESTDIR)$(PREFIX)/bin/st
|
|
||||||
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
|
|
||||||
sed "s/VERSION/$(VERSION)/g" < st.1 > $(DESTDIR)$(MANPREFIX)/man1/st.1
|
|
||||||
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/st.1
|
|
||||||
tic -sx st.info
|
|
||||||
@echo Please see the README file regarding the terminfo entry of st.
|
|
||||||
|
|
||||||
uninstall:
|
|
||||||
rm -f $(DESTDIR)$(PREFIX)/bin/st
|
|
||||||
rm -f $(DESTDIR)$(MANPREFIX)/man1/st.1
|
|
||||||
|
|
||||||
.PHONY: all options clean dist install uninstall
|
|
@ -1,34 +0,0 @@
|
|||||||
st - simple terminal
|
|
||||||
--------------------
|
|
||||||
st is a simple terminal emulator for X which sucks less.
|
|
||||||
|
|
||||||
|
|
||||||
Requirements
|
|
||||||
------------
|
|
||||||
In order to build st you need the Xlib header files.
|
|
||||||
|
|
||||||
|
|
||||||
Installation
|
|
||||||
------------
|
|
||||||
Edit config.mk to match your local setup (st is installed into
|
|
||||||
the /usr/local namespace by default).
|
|
||||||
|
|
||||||
Afterwards enter the following command to build and install st (if
|
|
||||||
necessary as root):
|
|
||||||
|
|
||||||
make clean install
|
|
||||||
|
|
||||||
|
|
||||||
Running st
|
|
||||||
----------
|
|
||||||
If you did not install st with make clean install, you must compile
|
|
||||||
the st terminfo entry with the following command:
|
|
||||||
|
|
||||||
tic -sx st.info
|
|
||||||
|
|
||||||
See the man page for additional details.
|
|
||||||
|
|
||||||
Credits
|
|
||||||
-------
|
|
||||||
Based on Aurélien APTEL <aurelien dot aptel at gmail dot com> bt source code.
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
|||||||
vt emulation
|
|
||||||
------------
|
|
||||||
|
|
||||||
* double-height support
|
|
||||||
|
|
||||||
code & interface
|
|
||||||
----------------
|
|
||||||
|
|
||||||
* add a simple way to do multiplexing
|
|
||||||
|
|
||||||
drawing
|
|
||||||
-------
|
|
||||||
* add diacritics support to xdraws()
|
|
||||||
* switch to a suckless font drawing library
|
|
||||||
* make the font cache simpler
|
|
||||||
* add better support for brightening of the upper colors
|
|
||||||
|
|
||||||
bugs
|
|
||||||
----
|
|
||||||
|
|
||||||
* fix shift up/down (shift selection in emacs)
|
|
||||||
* remove DEC test sequence when appropriate
|
|
||||||
|
|
||||||
misc
|
|
||||||
----
|
|
||||||
|
|
||||||
$ grep -nE 'XXX|TODO' st.c
|
|
||||||
|
|
@ -1,50 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copy me if you can.
|
|
||||||
* by 20h
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef ARG_H__
|
|
||||||
#define ARG_H__
|
|
||||||
|
|
||||||
extern char *argv0;
|
|
||||||
|
|
||||||
/* use main(int argc, char *argv[]) */
|
|
||||||
#define ARGBEGIN for (argv0 = *argv, argv++, argc--;\
|
|
||||||
argv[0] && argv[0][0] == '-'\
|
|
||||||
&& argv[0][1];\
|
|
||||||
argc--, argv++) {\
|
|
||||||
char argc_;\
|
|
||||||
char **argv_;\
|
|
||||||
int brk_;\
|
|
||||||
if (argv[0][1] == '-' && argv[0][2] == '\0') {\
|
|
||||||
argv++;\
|
|
||||||
argc--;\
|
|
||||||
break;\
|
|
||||||
}\
|
|
||||||
int i_;\
|
|
||||||
for (i_ = 1, brk_ = 0, argv_ = argv;\
|
|
||||||
argv[0][i_] && !brk_;\
|
|
||||||
i_++) {\
|
|
||||||
if (argv_ != argv)\
|
|
||||||
break;\
|
|
||||||
argc_ = argv[0][i_];\
|
|
||||||
switch (argc_)
|
|
||||||
|
|
||||||
#define ARGEND }\
|
|
||||||
}
|
|
||||||
|
|
||||||
#define ARGC() argc_
|
|
||||||
|
|
||||||
#define EARGF(x) ((argv[0][i_+1] == '\0' && argv[1] == NULL)?\
|
|
||||||
((x), abort(), (char *)0) :\
|
|
||||||
(brk_ = 1, (argv[0][i_+1] != '\0')?\
|
|
||||||
(&argv[0][i_+1]) :\
|
|
||||||
(argc--, argv++, argv[0])))
|
|
||||||
|
|
||||||
#define ARGF() ((argv[0][i_+1] == '\0' && argv[1] == NULL)?\
|
|
||||||
(char *)0 :\
|
|
||||||
(brk_ = 1, (argv[0][i_+1] != '\0')?\
|
|
||||||
(&argv[0][i_+1]) :\
|
|
||||||
(argc--, argv++, argv[0])))
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,28 +0,0 @@
|
|||||||
/* Terminal colors (16 first used in escape sequence) */
|
|
||||||
static const char *colorname[] = {
|
|
||||||
/* 8 normal colors */
|
|
||||||
"#161510",
|
|
||||||
"#a32810",
|
|
||||||
"#727a18",
|
|
||||||
"#a37720",
|
|
||||||
"#3d6266",
|
|
||||||
"#7a4955",
|
|
||||||
"#557a55",
|
|
||||||
"#8e8463",
|
|
||||||
|
|
||||||
/* 8 bright colors */
|
|
||||||
"#4c4635",
|
|
||||||
"#cc3214",
|
|
||||||
"#8e991e",
|
|
||||||
"#cc9528",
|
|
||||||
"#4c7b7f",
|
|
||||||
"#995b6b",
|
|
||||||
"#6b996b",
|
|
||||||
"#ccbc8e",
|
|
||||||
|
|
||||||
[255] = 0,
|
|
||||||
|
|
||||||
/* more colors can be added after 255 to use with DefaultXX */
|
|
||||||
"#cccccc",
|
|
||||||
"#555555",
|
|
||||||
};
|
|
@ -1,477 +0,0 @@
|
|||||||
/* See LICENSE file for copyright and license details. */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* appearance
|
|
||||||
*
|
|
||||||
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
|
|
||||||
*/
|
|
||||||
static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true";
|
|
||||||
static int borderpx = 2;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* What program is execed by st depends of these precedence rules:
|
|
||||||
* 1: program passed with -e
|
|
||||||
* 2: scroll and/or utmp
|
|
||||||
* 3: SHELL environment variable
|
|
||||||
* 4: value of shell in /etc/passwd
|
|
||||||
* 5: value of shell in config.h
|
|
||||||
*/
|
|
||||||
static char *shell = "/bin/sh";
|
|
||||||
char *utmp = NULL;
|
|
||||||
/* scroll program: to enable use a string like "scroll" */
|
|
||||||
char *scroll = NULL;
|
|
||||||
char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400";
|
|
||||||
|
|
||||||
/* identification sequence returned in DA and DECID */
|
|
||||||
char *vtiden = "\033[?6c";
|
|
||||||
|
|
||||||
/* Kerning / character bounding-box multipliers */
|
|
||||||
static float cwscale = 1.0;
|
|
||||||
static float chscale = 1.0;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* word delimiter string
|
|
||||||
*
|
|
||||||
* More advanced example: L" `'\"()[]{}"
|
|
||||||
*/
|
|
||||||
wchar_t *worddelimiters = L" ";
|
|
||||||
|
|
||||||
/* selection timeouts (in milliseconds) */
|
|
||||||
static unsigned int doubleclicktimeout = 300;
|
|
||||||
static unsigned int tripleclicktimeout = 600;
|
|
||||||
|
|
||||||
/* alt screens */
|
|
||||||
int allowaltscreen = 1;
|
|
||||||
|
|
||||||
/* allow certain non-interactive (insecure) window operations such as:
|
|
||||||
setting the clipboard text */
|
|
||||||
int allowwindowops = 0;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* draw latency range in ms - from new content/keypress/etc until drawing.
|
|
||||||
* within this range, st draws when content stops arriving (idle). mostly it's
|
|
||||||
* near minlatency, but it waits longer for slow updates to avoid partial draw.
|
|
||||||
* low minlatency will tear/flicker more, as it can "detect" idle too early.
|
|
||||||
*/
|
|
||||||
static double minlatency = 8;
|
|
||||||
static double maxlatency = 33;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* blinking timeout (set to 0 to disable blinking) for the terminal blinking
|
|
||||||
* attribute.
|
|
||||||
*/
|
|
||||||
static unsigned int blinktimeout = 800;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* thickness of underline and bar cursors
|
|
||||||
*/
|
|
||||||
static unsigned int cursorthickness = 2;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* bell volume. It must be a value between -100 and 100. Use 0 for disabling
|
|
||||||
* it
|
|
||||||
*/
|
|
||||||
static int bellvolume = 0;
|
|
||||||
|
|
||||||
/* default TERM value */
|
|
||||||
char *termname = "st-256color";
|
|
||||||
|
|
||||||
/*
|
|
||||||
* spaces per tab
|
|
||||||
*
|
|
||||||
* When you are changing this value, don't forget to adapt the »it« value in
|
|
||||||
* the st.info and appropriately install the st.info in the environment where
|
|
||||||
* you use this st version.
|
|
||||||
*
|
|
||||||
* it#$tabspaces,
|
|
||||||
*
|
|
||||||
* Secondly make sure your kernel is not expanding tabs. When running `stty
|
|
||||||
* -a` »tab0« should appear. You can tell the terminal to not expand tabs by
|
|
||||||
* running following command:
|
|
||||||
*
|
|
||||||
* stty tabs
|
|
||||||
*/
|
|
||||||
unsigned int tabspaces = 8;
|
|
||||||
|
|
||||||
/* Terminal colors (16 first used in escape sequence) */
|
|
||||||
static const char *colorname[] = {
|
|
||||||
/* 8 normal colors */
|
|
||||||
"black",
|
|
||||||
"red3",
|
|
||||||
"green3",
|
|
||||||
"yellow3",
|
|
||||||
"blue2",
|
|
||||||
"magenta3",
|
|
||||||
"cyan3",
|
|
||||||
"gray90",
|
|
||||||
|
|
||||||
/* 8 bright colors */
|
|
||||||
"gray50",
|
|
||||||
"red",
|
|
||||||
"green",
|
|
||||||
"yellow",
|
|
||||||
"#5c5cff",
|
|
||||||
"magenta",
|
|
||||||
"cyan",
|
|
||||||
"white",
|
|
||||||
|
|
||||||
[255] = 0,
|
|
||||||
|
|
||||||
/* more colors can be added after 255 to use with DefaultXX */
|
|
||||||
"#cccccc",
|
|
||||||
"#555555",
|
|
||||||
"gray90", /* default foreground colour */
|
|
||||||
"black", /* default background colour */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Default colors (colorname index)
|
|
||||||
* foreground, background, cursor, reverse cursor
|
|
||||||
*/
|
|
||||||
unsigned int defaultfg = 258;
|
|
||||||
unsigned int defaultbg = 259;
|
|
||||||
unsigned int defaultcs = 256;
|
|
||||||
static unsigned int defaultrcs = 257;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Default shape of cursor
|
|
||||||
* 2: Block ("█")
|
|
||||||
* 4: Underline ("_")
|
|
||||||
* 6: Bar ("|")
|
|
||||||
* 7: Snowman ("☃")
|
|
||||||
*/
|
|
||||||
static unsigned int cursorshape = 2;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Default columns and rows numbers
|
|
||||||
*/
|
|
||||||
|
|
||||||
static unsigned int cols = 80;
|
|
||||||
static unsigned int rows = 24;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Default colour and shape of the mouse cursor
|
|
||||||
*/
|
|
||||||
static unsigned int mouseshape = XC_xterm;
|
|
||||||
static unsigned int mousefg = 7;
|
|
||||||
static unsigned int mousebg = 0;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Color used to display font attributes when fontconfig selected a font which
|
|
||||||
* doesn't match the ones requested.
|
|
||||||
*/
|
|
||||||
static unsigned int defaultattr = 11;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Force mouse select/shortcuts while mask is active (when MODE_MOUSE is set).
|
|
||||||
* Note that if you want to use ShiftMask with selmasks, set this to an other
|
|
||||||
* modifier, set to 0 to not use it.
|
|
||||||
*/
|
|
||||||
static uint forcemousemod = ShiftMask;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Internal mouse shortcuts.
|
|
||||||
* Beware that overloading Button1 will disable the selection.
|
|
||||||
*/
|
|
||||||
static MouseShortcut mshortcuts[] = {
|
|
||||||
/* mask button function argument release */
|
|
||||||
{ XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 },
|
|
||||||
{ ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} },
|
|
||||||
{ XK_ANY_MOD, Button4, ttysend, {.s = "\031"} },
|
|
||||||
{ ShiftMask, Button5, ttysend, {.s = "\033[6;2~"} },
|
|
||||||
{ XK_ANY_MOD, Button5, ttysend, {.s = "\005"} },
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Internal keyboard shortcuts. */
|
|
||||||
#define MODKEY Mod1Mask
|
|
||||||
#define TERMMOD (ControlMask|ShiftMask)
|
|
||||||
|
|
||||||
static Shortcut shortcuts[] = {
|
|
||||||
/* mask keysym function argument */
|
|
||||||
{ XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} },
|
|
||||||
{ ControlMask, XK_Print, toggleprinter, {.i = 0} },
|
|
||||||
{ ShiftMask, XK_Print, printscreen, {.i = 0} },
|
|
||||||
{ XK_ANY_MOD, XK_Print, printsel, {.i = 0} },
|
|
||||||
{ TERMMOD, XK_Prior, zoom, {.f = +1} },
|
|
||||||
{ TERMMOD, XK_Next, zoom, {.f = -1} },
|
|
||||||
{ TERMMOD, XK_Home, zoomreset, {.f = 0} },
|
|
||||||
{ TERMMOD, XK_C, clipcopy, {.i = 0} },
|
|
||||||
{ TERMMOD, XK_V, clippaste, {.i = 0} },
|
|
||||||
{ TERMMOD, XK_Y, selpaste, {.i = 0} },
|
|
||||||
{ ShiftMask, XK_Insert, selpaste, {.i = 0} },
|
|
||||||
{ TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
|
|
||||||
{ MODKEY, XK_L, copyurl, {.i = 0} },
|
|
||||||
{ ShiftMask, XK_Page_Up, kscrollup, {.i = -1} },
|
|
||||||
{ ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} },
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Special keys (change & recompile st.info accordingly)
|
|
||||||
*
|
|
||||||
* Mask value:
|
|
||||||
* * Use XK_ANY_MOD to match the key no matter modifiers state
|
|
||||||
* * Use XK_NO_MOD to match the key alone (no modifiers)
|
|
||||||
* appkey value:
|
|
||||||
* * 0: no value
|
|
||||||
* * > 0: keypad application mode enabled
|
|
||||||
* * = 2: term.numlock = 1
|
|
||||||
* * < 0: keypad application mode disabled
|
|
||||||
* appcursor value:
|
|
||||||
* * 0: no value
|
|
||||||
* * > 0: cursor application mode enabled
|
|
||||||
* * < 0: cursor application mode disabled
|
|
||||||
*
|
|
||||||
* Be careful with the order of the definitions because st searches in
|
|
||||||
* this table sequentially, so any XK_ANY_MOD must be in the last
|
|
||||||
* position for a key.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If you want keys other than the X11 function keys (0xFD00 - 0xFFFF)
|
|
||||||
* to be mapped below, add them to this array.
|
|
||||||
*/
|
|
||||||
static KeySym mappedkeys[] = { -1 };
|
|
||||||
|
|
||||||
/*
|
|
||||||
* State bits to ignore when matching key or button events. By default,
|
|
||||||
* numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored.
|
|
||||||
*/
|
|
||||||
static uint ignoremod = Mod2Mask|XK_SWITCH_MOD;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This is the huge key array which defines all compatibility to the Linux
|
|
||||||
* world. Please decide about changes wisely.
|
|
||||||
*/
|
|
||||||
static Key key[] = {
|
|
||||||
/* keysym mask string appkey appcursor */
|
|
||||||
{ XK_KP_Home, ShiftMask, "\033[2J", 0, -1},
|
|
||||||
{ XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1},
|
|
||||||
{ XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1},
|
|
||||||
{ XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1},
|
|
||||||
{ XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0},
|
|
||||||
{ XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1},
|
|
||||||
{ XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1},
|
|
||||||
{ XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0},
|
|
||||||
{ XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1},
|
|
||||||
{ XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1},
|
|
||||||
{ XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0},
|
|
||||||
{ XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1},
|
|
||||||
{ XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1},
|
|
||||||
{ XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0},
|
|
||||||
{ XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1},
|
|
||||||
{ XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1},
|
|
||||||
{ XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0},
|
|
||||||
{ XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0},
|
|
||||||
{ XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0},
|
|
||||||
{ XK_KP_End, ControlMask, "\033[J", -1, 0},
|
|
||||||
{ XK_KP_End, ControlMask, "\033[1;5F", +1, 0},
|
|
||||||
{ XK_KP_End, ShiftMask, "\033[K", -1, 0},
|
|
||||||
{ XK_KP_End, ShiftMask, "\033[1;2F", +1, 0},
|
|
||||||
{ XK_KP_End, XK_ANY_MOD, "\033[4~", 0, 0},
|
|
||||||
{ XK_KP_Next, ShiftMask, "\033[6;2~", 0, 0},
|
|
||||||
{ XK_KP_Next, XK_ANY_MOD, "\033[6~", 0, 0},
|
|
||||||
{ XK_KP_Insert, ShiftMask, "\033[2;2~", +1, 0},
|
|
||||||
{ XK_KP_Insert, ShiftMask, "\033[4l", -1, 0},
|
|
||||||
{ XK_KP_Insert, ControlMask, "\033[L", -1, 0},
|
|
||||||
{ XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0},
|
|
||||||
{ XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0},
|
|
||||||
{ XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0},
|
|
||||||
{ XK_KP_Delete, ControlMask, "\033[M", -1, 0},
|
|
||||||
{ XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0},
|
|
||||||
{ XK_KP_Delete, ShiftMask, "\033[2K", -1, 0},
|
|
||||||
{ XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0},
|
|
||||||
{ XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0},
|
|
||||||
{ XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0},
|
|
||||||
{ XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0},
|
|
||||||
{ XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0},
|
|
||||||
{ XK_KP_Enter, XK_ANY_MOD, "\033OM", +2, 0},
|
|
||||||
{ XK_KP_Enter, XK_ANY_MOD, "\r", -1, 0},
|
|
||||||
{ XK_KP_Subtract, XK_ANY_MOD, "\033Om", +2, 0},
|
|
||||||
{ XK_KP_Decimal, XK_ANY_MOD, "\033On", +2, 0},
|
|
||||||
{ XK_KP_Divide, XK_ANY_MOD, "\033Oo", +2, 0},
|
|
||||||
{ XK_KP_0, XK_ANY_MOD, "\033Op", +2, 0},
|
|
||||||
{ XK_KP_1, XK_ANY_MOD, "\033Oq", +2, 0},
|
|
||||||
{ XK_KP_2, XK_ANY_MOD, "\033Or", +2, 0},
|
|
||||||
{ XK_KP_3, XK_ANY_MOD, "\033Os", +2, 0},
|
|
||||||
{ XK_KP_4, XK_ANY_MOD, "\033Ot", +2, 0},
|
|
||||||
{ XK_KP_5, XK_ANY_MOD, "\033Ou", +2, 0},
|
|
||||||
{ XK_KP_6, XK_ANY_MOD, "\033Ov", +2, 0},
|
|
||||||
{ XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0},
|
|
||||||
{ XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0},
|
|
||||||
{ XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0},
|
|
||||||
{ XK_Up, ShiftMask, "\033[1;2A", 0, 0},
|
|
||||||
{ XK_Up, Mod1Mask, "\033[1;3A", 0, 0},
|
|
||||||
{ XK_Up, ShiftMask|Mod1Mask,"\033[1;4A", 0, 0},
|
|
||||||
{ XK_Up, ControlMask, "\033[1;5A", 0, 0},
|
|
||||||
{ XK_Up, ShiftMask|ControlMask,"\033[1;6A", 0, 0},
|
|
||||||
{ XK_Up, ControlMask|Mod1Mask,"\033[1;7A", 0, 0},
|
|
||||||
{ XK_Up,ShiftMask|ControlMask|Mod1Mask,"\033[1;8A", 0, 0},
|
|
||||||
{ XK_Up, XK_ANY_MOD, "\033[A", 0, -1},
|
|
||||||
{ XK_Up, XK_ANY_MOD, "\033OA", 0, +1},
|
|
||||||
{ XK_Down, ShiftMask, "\033[1;2B", 0, 0},
|
|
||||||
{ XK_Down, Mod1Mask, "\033[1;3B", 0, 0},
|
|
||||||
{ XK_Down, ShiftMask|Mod1Mask,"\033[1;4B", 0, 0},
|
|
||||||
{ XK_Down, ControlMask, "\033[1;5B", 0, 0},
|
|
||||||
{ XK_Down, ShiftMask|ControlMask,"\033[1;6B", 0, 0},
|
|
||||||
{ XK_Down, ControlMask|Mod1Mask,"\033[1;7B", 0, 0},
|
|
||||||
{ XK_Down,ShiftMask|ControlMask|Mod1Mask,"\033[1;8B",0, 0},
|
|
||||||
{ XK_Down, XK_ANY_MOD, "\033[B", 0, -1},
|
|
||||||
{ XK_Down, XK_ANY_MOD, "\033OB", 0, +1},
|
|
||||||
{ XK_Left, ShiftMask, "\033[1;2D", 0, 0},
|
|
||||||
{ XK_Left, Mod1Mask, "\033[1;3D", 0, 0},
|
|
||||||
{ XK_Left, ShiftMask|Mod1Mask,"\033[1;4D", 0, 0},
|
|
||||||
{ XK_Left, ControlMask, "\033[1;5D", 0, 0},
|
|
||||||
{ XK_Left, ShiftMask|ControlMask,"\033[1;6D", 0, 0},
|
|
||||||
{ XK_Left, ControlMask|Mod1Mask,"\033[1;7D", 0, 0},
|
|
||||||
{ XK_Left,ShiftMask|ControlMask|Mod1Mask,"\033[1;8D",0, 0},
|
|
||||||
{ XK_Left, XK_ANY_MOD, "\033[D", 0, -1},
|
|
||||||
{ XK_Left, XK_ANY_MOD, "\033OD", 0, +1},
|
|
||||||
{ XK_Right, ShiftMask, "\033[1;2C", 0, 0},
|
|
||||||
{ XK_Right, Mod1Mask, "\033[1;3C", 0, 0},
|
|
||||||
{ XK_Right, ShiftMask|Mod1Mask,"\033[1;4C", 0, 0},
|
|
||||||
{ XK_Right, ControlMask, "\033[1;5C", 0, 0},
|
|
||||||
{ XK_Right, ShiftMask|ControlMask,"\033[1;6C", 0, 0},
|
|
||||||
{ XK_Right, ControlMask|Mod1Mask,"\033[1;7C", 0, 0},
|
|
||||||
{ XK_Right,ShiftMask|ControlMask|Mod1Mask,"\033[1;8C",0, 0},
|
|
||||||
{ XK_Right, XK_ANY_MOD, "\033[C", 0, -1},
|
|
||||||
{ XK_Right, XK_ANY_MOD, "\033OC", 0, +1},
|
|
||||||
{ XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0},
|
|
||||||
{ XK_Return, Mod1Mask, "\033\r", 0, 0},
|
|
||||||
{ XK_Return, XK_ANY_MOD, "\r", 0, 0},
|
|
||||||
{ XK_Insert, ShiftMask, "\033[4l", -1, 0},
|
|
||||||
{ XK_Insert, ShiftMask, "\033[2;2~", +1, 0},
|
|
||||||
{ XK_Insert, ControlMask, "\033[L", -1, 0},
|
|
||||||
{ XK_Insert, ControlMask, "\033[2;5~", +1, 0},
|
|
||||||
{ XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0},
|
|
||||||
{ XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0},
|
|
||||||
{ XK_Delete, ControlMask, "\033[M", -1, 0},
|
|
||||||
{ XK_Delete, ControlMask, "\033[3;5~", +1, 0},
|
|
||||||
{ XK_Delete, ShiftMask, "\033[2K", -1, 0},
|
|
||||||
{ XK_Delete, ShiftMask, "\033[3;2~", +1, 0},
|
|
||||||
{ XK_Delete, XK_ANY_MOD, "\033[P", -1, 0},
|
|
||||||
{ XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0},
|
|
||||||
{ XK_BackSpace, XK_NO_MOD, "\177", 0, 0},
|
|
||||||
{ XK_BackSpace, Mod1Mask, "\033\177", 0, 0},
|
|
||||||
{ XK_Home, ShiftMask, "\033[2J", 0, -1},
|
|
||||||
{ XK_Home, ShiftMask, "\033[1;2H", 0, +1},
|
|
||||||
{ XK_Home, XK_ANY_MOD, "\033[H", 0, -1},
|
|
||||||
{ XK_Home, XK_ANY_MOD, "\033[1~", 0, +1},
|
|
||||||
{ XK_End, ControlMask, "\033[J", -1, 0},
|
|
||||||
{ XK_End, ControlMask, "\033[1;5F", +1, 0},
|
|
||||||
{ XK_End, ShiftMask, "\033[K", -1, 0},
|
|
||||||
{ XK_End, ShiftMask, "\033[1;2F", +1, 0},
|
|
||||||
{ XK_End, XK_ANY_MOD, "\033[4~", 0, 0},
|
|
||||||
{ XK_Prior, ControlMask, "\033[5;5~", 0, 0},
|
|
||||||
{ XK_Prior, ShiftMask, "\033[5;2~", 0, 0},
|
|
||||||
{ XK_Prior, XK_ANY_MOD, "\033[5~", 0, 0},
|
|
||||||
{ XK_Next, ControlMask, "\033[6;5~", 0, 0},
|
|
||||||
{ XK_Next, ShiftMask, "\033[6;2~", 0, 0},
|
|
||||||
{ XK_Next, XK_ANY_MOD, "\033[6~", 0, 0},
|
|
||||||
{ XK_F1, XK_NO_MOD, "\033OP" , 0, 0},
|
|
||||||
{ XK_F1, /* F13 */ ShiftMask, "\033[1;2P", 0, 0},
|
|
||||||
{ XK_F1, /* F25 */ ControlMask, "\033[1;5P", 0, 0},
|
|
||||||
{ XK_F1, /* F37 */ Mod4Mask, "\033[1;6P", 0, 0},
|
|
||||||
{ XK_F1, /* F49 */ Mod1Mask, "\033[1;3P", 0, 0},
|
|
||||||
{ XK_F1, /* F61 */ Mod3Mask, "\033[1;4P", 0, 0},
|
|
||||||
{ XK_F2, XK_NO_MOD, "\033OQ" , 0, 0},
|
|
||||||
{ XK_F2, /* F14 */ ShiftMask, "\033[1;2Q", 0, 0},
|
|
||||||
{ XK_F2, /* F26 */ ControlMask, "\033[1;5Q", 0, 0},
|
|
||||||
{ XK_F2, /* F38 */ Mod4Mask, "\033[1;6Q", 0, 0},
|
|
||||||
{ XK_F2, /* F50 */ Mod1Mask, "\033[1;3Q", 0, 0},
|
|
||||||
{ XK_F2, /* F62 */ Mod3Mask, "\033[1;4Q", 0, 0},
|
|
||||||
{ XK_F3, XK_NO_MOD, "\033OR" , 0, 0},
|
|
||||||
{ XK_F3, /* F15 */ ShiftMask, "\033[1;2R", 0, 0},
|
|
||||||
{ XK_F3, /* F27 */ ControlMask, "\033[1;5R", 0, 0},
|
|
||||||
{ XK_F3, /* F39 */ Mod4Mask, "\033[1;6R", 0, 0},
|
|
||||||
{ XK_F3, /* F51 */ Mod1Mask, "\033[1;3R", 0, 0},
|
|
||||||
{ XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0},
|
|
||||||
{ XK_F4, XK_NO_MOD, "\033OS" , 0, 0},
|
|
||||||
{ XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0},
|
|
||||||
{ XK_F4, /* F28 */ ControlMask, "\033[1;5S", 0, 0},
|
|
||||||
{ XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0},
|
|
||||||
{ XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0},
|
|
||||||
{ XK_F5, XK_NO_MOD, "\033[15~", 0, 0},
|
|
||||||
{ XK_F5, /* F17 */ ShiftMask, "\033[15;2~", 0, 0},
|
|
||||||
{ XK_F5, /* F29 */ ControlMask, "\033[15;5~", 0, 0},
|
|
||||||
{ XK_F5, /* F41 */ Mod4Mask, "\033[15;6~", 0, 0},
|
|
||||||
{ XK_F5, /* F53 */ Mod1Mask, "\033[15;3~", 0, 0},
|
|
||||||
{ XK_F6, XK_NO_MOD, "\033[17~", 0, 0},
|
|
||||||
{ XK_F6, /* F18 */ ShiftMask, "\033[17;2~", 0, 0},
|
|
||||||
{ XK_F6, /* F30 */ ControlMask, "\033[17;5~", 0, 0},
|
|
||||||
{ XK_F6, /* F42 */ Mod4Mask, "\033[17;6~", 0, 0},
|
|
||||||
{ XK_F6, /* F54 */ Mod1Mask, "\033[17;3~", 0, 0},
|
|
||||||
{ XK_F7, XK_NO_MOD, "\033[18~", 0, 0},
|
|
||||||
{ XK_F7, /* F19 */ ShiftMask, "\033[18;2~", 0, 0},
|
|
||||||
{ XK_F7, /* F31 */ ControlMask, "\033[18;5~", 0, 0},
|
|
||||||
{ XK_F7, /* F43 */ Mod4Mask, "\033[18;6~", 0, 0},
|
|
||||||
{ XK_F7, /* F55 */ Mod1Mask, "\033[18;3~", 0, 0},
|
|
||||||
{ XK_F8, XK_NO_MOD, "\033[19~", 0, 0},
|
|
||||||
{ XK_F8, /* F20 */ ShiftMask, "\033[19;2~", 0, 0},
|
|
||||||
{ XK_F8, /* F32 */ ControlMask, "\033[19;5~", 0, 0},
|
|
||||||
{ XK_F8, /* F44 */ Mod4Mask, "\033[19;6~", 0, 0},
|
|
||||||
{ XK_F8, /* F56 */ Mod1Mask, "\033[19;3~", 0, 0},
|
|
||||||
{ XK_F9, XK_NO_MOD, "\033[20~", 0, 0},
|
|
||||||
{ XK_F9, /* F21 */ ShiftMask, "\033[20;2~", 0, 0},
|
|
||||||
{ XK_F9, /* F33 */ ControlMask, "\033[20;5~", 0, 0},
|
|
||||||
{ XK_F9, /* F45 */ Mod4Mask, "\033[20;6~", 0, 0},
|
|
||||||
{ XK_F9, /* F57 */ Mod1Mask, "\033[20;3~", 0, 0},
|
|
||||||
{ XK_F10, XK_NO_MOD, "\033[21~", 0, 0},
|
|
||||||
{ XK_F10, /* F22 */ ShiftMask, "\033[21;2~", 0, 0},
|
|
||||||
{ XK_F10, /* F34 */ ControlMask, "\033[21;5~", 0, 0},
|
|
||||||
{ XK_F10, /* F46 */ Mod4Mask, "\033[21;6~", 0, 0},
|
|
||||||
{ XK_F10, /* F58 */ Mod1Mask, "\033[21;3~", 0, 0},
|
|
||||||
{ XK_F11, XK_NO_MOD, "\033[23~", 0, 0},
|
|
||||||
{ XK_F11, /* F23 */ ShiftMask, "\033[23;2~", 0, 0},
|
|
||||||
{ XK_F11, /* F35 */ ControlMask, "\033[23;5~", 0, 0},
|
|
||||||
{ XK_F11, /* F47 */ Mod4Mask, "\033[23;6~", 0, 0},
|
|
||||||
{ XK_F11, /* F59 */ Mod1Mask, "\033[23;3~", 0, 0},
|
|
||||||
{ XK_F12, XK_NO_MOD, "\033[24~", 0, 0},
|
|
||||||
{ XK_F12, /* F24 */ ShiftMask, "\033[24;2~", 0, 0},
|
|
||||||
{ XK_F12, /* F36 */ ControlMask, "\033[24;5~", 0, 0},
|
|
||||||
{ XK_F12, /* F48 */ Mod4Mask, "\033[24;6~", 0, 0},
|
|
||||||
{ XK_F12, /* F60 */ Mod1Mask, "\033[24;3~", 0, 0},
|
|
||||||
{ XK_F13, XK_NO_MOD, "\033[1;2P", 0, 0},
|
|
||||||
{ XK_F14, XK_NO_MOD, "\033[1;2Q", 0, 0},
|
|
||||||
{ XK_F15, XK_NO_MOD, "\033[1;2R", 0, 0},
|
|
||||||
{ XK_F16, XK_NO_MOD, "\033[1;2S", 0, 0},
|
|
||||||
{ XK_F17, XK_NO_MOD, "\033[15;2~", 0, 0},
|
|
||||||
{ XK_F18, XK_NO_MOD, "\033[17;2~", 0, 0},
|
|
||||||
{ XK_F19, XK_NO_MOD, "\033[18;2~", 0, 0},
|
|
||||||
{ XK_F20, XK_NO_MOD, "\033[19;2~", 0, 0},
|
|
||||||
{ XK_F21, XK_NO_MOD, "\033[20;2~", 0, 0},
|
|
||||||
{ XK_F22, XK_NO_MOD, "\033[21;2~", 0, 0},
|
|
||||||
{ XK_F23, XK_NO_MOD, "\033[23;2~", 0, 0},
|
|
||||||
{ XK_F24, XK_NO_MOD, "\033[24;2~", 0, 0},
|
|
||||||
{ XK_F25, XK_NO_MOD, "\033[1;5P", 0, 0},
|
|
||||||
{ XK_F26, XK_NO_MOD, "\033[1;5Q", 0, 0},
|
|
||||||
{ XK_F27, XK_NO_MOD, "\033[1;5R", 0, 0},
|
|
||||||
{ XK_F28, XK_NO_MOD, "\033[1;5S", 0, 0},
|
|
||||||
{ XK_F29, XK_NO_MOD, "\033[15;5~", 0, 0},
|
|
||||||
{ XK_F30, XK_NO_MOD, "\033[17;5~", 0, 0},
|
|
||||||
{ XK_F31, XK_NO_MOD, "\033[18;5~", 0, 0},
|
|
||||||
{ XK_F32, XK_NO_MOD, "\033[19;5~", 0, 0},
|
|
||||||
{ XK_F33, XK_NO_MOD, "\033[20;5~", 0, 0},
|
|
||||||
{ XK_F34, XK_NO_MOD, "\033[21;5~", 0, 0},
|
|
||||||
{ XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0},
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Selection types' masks.
|
|
||||||
* Use the same masks as usual.
|
|
||||||
* Button1Mask is always unset, to make masks match between ButtonPress.
|
|
||||||
* ButtonRelease and MotionNotify.
|
|
||||||
* If no match is found, regular selection is used.
|
|
||||||
*/
|
|
||||||
static uint selmasks[] = {
|
|
||||||
[SEL_RECTANGULAR] = Mod1Mask,
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Printable characters in ASCII, used to estimate the advance width
|
|
||||||
* of single wide characters.
|
|
||||||
*/
|
|
||||||
static char ascii_printable[] =
|
|
||||||
" !\"#$%&'()*+,-./0123456789:;<=>?"
|
|
||||||
"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
|
|
||||||
"`abcdefghijklmnopqrstuvwxyz{|}~";
|
|
@ -1,445 +0,0 @@
|
|||||||
/* See LICENSE file for copyright and license details. */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
|
|
||||||
*/
|
|
||||||
#ifdef IS_PHONE
|
|
||||||
static char *font = "Monospace:pixelsize=34:antialias=true:autohint=true";
|
|
||||||
#elif ARISTOTLE
|
|
||||||
static char *font = "Fantasque Sans Mono:pixelsize=24:antialias=true:autohint=true";
|
|
||||||
#else
|
|
||||||
static char *font = "Fantasque Sans Mono:pixelsize=14:antialias=true:autohint=true";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int borderpx = 2;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* What program is execed by st depends of these precedence rules:
|
|
||||||
* 1: program passed with -e
|
|
||||||
* 2: scroll and/or utmp
|
|
||||||
* 3: SHELL environment variable
|
|
||||||
* 4: value of shell in /etc/passwd
|
|
||||||
* 5: value of shell in config.h
|
|
||||||
*/
|
|
||||||
static char *shell = "/bin/sh";
|
|
||||||
char *utmp = NULL;
|
|
||||||
/* scroll program: to enable use a string like "scroll" */
|
|
||||||
char *scroll = NULL;
|
|
||||||
char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400";
|
|
||||||
|
|
||||||
/* identification sequence returned in DA and DECID */
|
|
||||||
char *vtiden = "\033[?6c";
|
|
||||||
|
|
||||||
/* Kerning / character bounding-box multipliers */
|
|
||||||
static float cwscale = 1.0;
|
|
||||||
static float chscale = 1.0;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* word delimiter string
|
|
||||||
*
|
|
||||||
* More advanced example: L" `'\"()[]{}"
|
|
||||||
*/
|
|
||||||
wchar_t *worddelimiters = L" ";
|
|
||||||
|
|
||||||
/* selection timeouts (in milliseconds) */
|
|
||||||
static unsigned int doubleclicktimeout = 300;
|
|
||||||
static unsigned int tripleclicktimeout = 600;
|
|
||||||
|
|
||||||
/* alt screens */
|
|
||||||
int allowaltscreen = 1;
|
|
||||||
|
|
||||||
/* allow certain non-interactive (insecure) window operations such as:
|
|
||||||
setting the clipboard text */
|
|
||||||
int allowwindowops = 0;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* draw latency range in ms - from new content/keypress/etc until drawing.
|
|
||||||
* within this range, st draws when content stops arriving (idle). mostly it's
|
|
||||||
* near minlatency, but it waits longer for slow updates to avoid partial draw.
|
|
||||||
* low minlatency will tear/flicker more, as it can "detect" idle too early.
|
|
||||||
*/
|
|
||||||
static double minlatency = 8;
|
|
||||||
static double maxlatency = 33;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* blinking timeout (set to 0 to disable blinking) for the terminal blinking
|
|
||||||
* attribute.
|
|
||||||
*/
|
|
||||||
static unsigned int blinktimeout = 800;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* thickness of underline and bar cursors
|
|
||||||
*/
|
|
||||||
static unsigned int cursorthickness = 2;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* bell volume. It must be a value between -100 and 100. Use 0 for disabling
|
|
||||||
* it
|
|
||||||
*/
|
|
||||||
static int bellvolume = 0;
|
|
||||||
|
|
||||||
/* default TERM value */
|
|
||||||
char *termname = "st-256color";
|
|
||||||
|
|
||||||
/*
|
|
||||||
* spaces per tab
|
|
||||||
*
|
|
||||||
* When you are changing this value, don't forget to adapt the »it« value in
|
|
||||||
* the st.info and appropriately install the st.info in the environment where
|
|
||||||
* you use this st version.
|
|
||||||
*
|
|
||||||
* it#$tabspaces,
|
|
||||||
*
|
|
||||||
* Secondly make sure your kernel is not expanding tabs. When running `stty
|
|
||||||
* -a` »tab0« should appear. You can tell the terminal to not expand tabs by
|
|
||||||
* running following command:
|
|
||||||
*
|
|
||||||
* stty tabs
|
|
||||||
*/
|
|
||||||
unsigned int tabspaces = 8;
|
|
||||||
|
|
||||||
#include "colors.h"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Default colors (colorname index)
|
|
||||||
* foreground, background, cursor, reverse cursor
|
|
||||||
*/
|
|
||||||
unsigned int defaultfg = 7;
|
|
||||||
unsigned int defaultbg = 0;
|
|
||||||
unsigned int defaultcs = 256;
|
|
||||||
static unsigned int defaultrcs = 257;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Default shape of cursor
|
|
||||||
* 2: Block ("█")
|
|
||||||
* 4: Underline ("_")
|
|
||||||
* 6: Bar ("|")
|
|
||||||
* 7: Snowman ("☃")
|
|
||||||
*/
|
|
||||||
static unsigned int cursorshape = 2;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Default columns and rows numbers
|
|
||||||
*/
|
|
||||||
|
|
||||||
static unsigned int cols = 80;
|
|
||||||
static unsigned int rows = 24;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Default colour and shape of the mouse cursor
|
|
||||||
*/
|
|
||||||
static unsigned int mouseshape = XC_xterm;
|
|
||||||
static unsigned int mousefg = 7;
|
|
||||||
static unsigned int mousebg = 0;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Color used to display font attributes when fontconfig selected a font which
|
|
||||||
* doesn't match the ones requested.
|
|
||||||
*/
|
|
||||||
static unsigned int defaultattr = 11;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Force mouse select/shortcuts while mask is active (when MODE_MOUSE is set).
|
|
||||||
* Note that if you want to use ShiftMask with selmasks, set this to an other
|
|
||||||
* modifier, set to 0 to not use it.
|
|
||||||
*/
|
|
||||||
static uint forcemousemod = ShiftMask;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Internal mouse shortcuts.
|
|
||||||
* Beware that overloading Button1 will disable the selection.
|
|
||||||
*/
|
|
||||||
static MouseShortcut mshortcuts[] = {
|
|
||||||
/* mask button function argument release */
|
|
||||||
{ XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 },
|
|
||||||
{ ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} },
|
|
||||||
{ XK_ANY_MOD, Button4, ttysend, {.s = "\031"} },
|
|
||||||
{ ShiftMask, Button5, ttysend, {.s = "\033[6;2~"} },
|
|
||||||
{ XK_ANY_MOD, Button5, ttysend, {.s = "\005"} },
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Internal keyboard shortcuts. */
|
|
||||||
#define MODKEY Mod1Mask
|
|
||||||
#define TERMMOD (ControlMask|ShiftMask)
|
|
||||||
|
|
||||||
static Shortcut shortcuts[] = {
|
|
||||||
/* mask keysym function argument */
|
|
||||||
{ XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} },
|
|
||||||
{ MODKEY, XK_h, zoom, {.f = -1} },
|
|
||||||
{ MODKEY, XK_l, zoom, {.f = +1} },
|
|
||||||
{ MODKEY, XK_c, clipcopy, {.i = 0} },
|
|
||||||
{ MODKEY, XK_v, clippaste, {.i = 0} },
|
|
||||||
{ MODKEY, XK_k, kscrollup, {.i = -1} },
|
|
||||||
{ MODKEY, XK_j, kscrolldown, {.i = -1} },
|
|
||||||
{ MODKEY, XK_u, copyurl, {.i = 0} },
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Special keys (change & recompile st.info accordingly)
|
|
||||||
*
|
|
||||||
* Mask value:
|
|
||||||
* * Use XK_ANY_MOD to match the key no matter modifiers state
|
|
||||||
* * Use XK_NO_MOD to match the key alone (no modifiers)
|
|
||||||
* appkey value:
|
|
||||||
* * 0: no value
|
|
||||||
* * > 0: keypad application mode enabled
|
|
||||||
* * = 2: term.numlock = 1
|
|
||||||
* * < 0: keypad application mode disabled
|
|
||||||
* appcursor value:
|
|
||||||
* * 0: no value
|
|
||||||
* * > 0: cursor application mode enabled
|
|
||||||
* * < 0: cursor application mode disabled
|
|
||||||
*
|
|
||||||
* Be careful with the order of the definitions because st searches in
|
|
||||||
* this table sequentially, so any XK_ANY_MOD must be in the last
|
|
||||||
* position for a key.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If you want keys other than the X11 function keys (0xFD00 - 0xFFFF)
|
|
||||||
* to be mapped below, add them to this array.
|
|
||||||
*/
|
|
||||||
static KeySym mappedkeys[] = { -1 };
|
|
||||||
|
|
||||||
/*
|
|
||||||
* State bits to ignore when matching key or button events. By default,
|
|
||||||
* numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored.
|
|
||||||
*/
|
|
||||||
static uint ignoremod = Mod2Mask|XK_SWITCH_MOD;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This is the huge key array which defines all compatibility to the Linux
|
|
||||||
* world. Please decide about changes wisely.
|
|
||||||
*/
|
|
||||||
static Key key[] = {
|
|
||||||
/* keysym mask string appkey appcursor */
|
|
||||||
{ XK_KP_Home, ShiftMask, "\033[2J", 0, -1},
|
|
||||||
{ XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1},
|
|
||||||
{ XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1},
|
|
||||||
{ XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1},
|
|
||||||
{ XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0},
|
|
||||||
{ XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1},
|
|
||||||
{ XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1},
|
|
||||||
{ XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0},
|
|
||||||
{ XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1},
|
|
||||||
{ XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1},
|
|
||||||
{ XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0},
|
|
||||||
{ XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1},
|
|
||||||
{ XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1},
|
|
||||||
{ XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0},
|
|
||||||
{ XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1},
|
|
||||||
{ XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1},
|
|
||||||
{ XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0},
|
|
||||||
{ XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0},
|
|
||||||
{ XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0},
|
|
||||||
{ XK_KP_End, ControlMask, "\033[J", -1, 0},
|
|
||||||
{ XK_KP_End, ControlMask, "\033[1;5F", +1, 0},
|
|
||||||
{ XK_KP_End, ShiftMask, "\033[K", -1, 0},
|
|
||||||
{ XK_KP_End, ShiftMask, "\033[1;2F", +1, 0},
|
|
||||||
{ XK_KP_End, XK_ANY_MOD, "\033[4~", 0, 0},
|
|
||||||
{ XK_KP_Next, ShiftMask, "\033[6;2~", 0, 0},
|
|
||||||
{ XK_KP_Next, XK_ANY_MOD, "\033[6~", 0, 0},
|
|
||||||
{ XK_KP_Insert, ShiftMask, "\033[2;2~", +1, 0},
|
|
||||||
{ XK_KP_Insert, ShiftMask, "\033[4l", -1, 0},
|
|
||||||
{ XK_KP_Insert, ControlMask, "\033[L", -1, 0},
|
|
||||||
{ XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0},
|
|
||||||
{ XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0},
|
|
||||||
{ XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0},
|
|
||||||
{ XK_KP_Delete, ControlMask, "\033[M", -1, 0},
|
|
||||||
{ XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0},
|
|
||||||
{ XK_KP_Delete, ShiftMask, "\033[2K", -1, 0},
|
|
||||||
{ XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0},
|
|
||||||
{ XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0},
|
|
||||||
{ XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0},
|
|
||||||
{ XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0},
|
|
||||||
{ XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0},
|
|
||||||
{ XK_KP_Enter, XK_ANY_MOD, "\033OM", +2, 0},
|
|
||||||
{ XK_KP_Enter, XK_ANY_MOD, "\r", -1, 0},
|
|
||||||
{ XK_KP_Subtract, XK_ANY_MOD, "\033Om", +2, 0},
|
|
||||||
{ XK_KP_Decimal, XK_ANY_MOD, "\033On", +2, 0},
|
|
||||||
{ XK_KP_Divide, XK_ANY_MOD, "\033Oo", +2, 0},
|
|
||||||
{ XK_KP_0, XK_ANY_MOD, "\033Op", +2, 0},
|
|
||||||
{ XK_KP_1, XK_ANY_MOD, "\033Oq", +2, 0},
|
|
||||||
{ XK_KP_2, XK_ANY_MOD, "\033Or", +2, 0},
|
|
||||||
{ XK_KP_3, XK_ANY_MOD, "\033Os", +2, 0},
|
|
||||||
{ XK_KP_4, XK_ANY_MOD, "\033Ot", +2, 0},
|
|
||||||
{ XK_KP_5, XK_ANY_MOD, "\033Ou", +2, 0},
|
|
||||||
{ XK_KP_6, XK_ANY_MOD, "\033Ov", +2, 0},
|
|
||||||
{ XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0},
|
|
||||||
{ XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0},
|
|
||||||
{ XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0},
|
|
||||||
{ XK_Up, ShiftMask, "\033[1;2A", 0, 0},
|
|
||||||
{ XK_Up, Mod1Mask, "\033[1;3A", 0, 0},
|
|
||||||
{ XK_Up, ShiftMask|Mod1Mask,"\033[1;4A", 0, 0},
|
|
||||||
{ XK_Up, ControlMask, "\033[1;5A", 0, 0},
|
|
||||||
{ XK_Up, ShiftMask|ControlMask,"\033[1;6A", 0, 0},
|
|
||||||
{ XK_Up, ControlMask|Mod1Mask,"\033[1;7A", 0, 0},
|
|
||||||
{ XK_Up,ShiftMask|ControlMask|Mod1Mask,"\033[1;8A", 0, 0},
|
|
||||||
{ XK_Up, XK_ANY_MOD, "\033[A", 0, -1},
|
|
||||||
{ XK_Up, XK_ANY_MOD, "\033OA", 0, +1},
|
|
||||||
{ XK_Down, ShiftMask, "\033[1;2B", 0, 0},
|
|
||||||
{ XK_Down, Mod1Mask, "\033[1;3B", 0, 0},
|
|
||||||
{ XK_Down, ShiftMask|Mod1Mask,"\033[1;4B", 0, 0},
|
|
||||||
{ XK_Down, ControlMask, "\033[1;5B", 0, 0},
|
|
||||||
{ XK_Down, ShiftMask|ControlMask,"\033[1;6B", 0, 0},
|
|
||||||
{ XK_Down, ControlMask|Mod1Mask,"\033[1;7B", 0, 0},
|
|
||||||
{ XK_Down,ShiftMask|ControlMask|Mod1Mask,"\033[1;8B",0, 0},
|
|
||||||
{ XK_Down, XK_ANY_MOD, "\033[B", 0, -1},
|
|
||||||
{ XK_Down, XK_ANY_MOD, "\033OB", 0, +1},
|
|
||||||
{ XK_Left, ShiftMask, "\033[1;2D", 0, 0},
|
|
||||||
{ XK_Left, Mod1Mask, "\033[1;3D", 0, 0},
|
|
||||||
{ XK_Left, ShiftMask|Mod1Mask,"\033[1;4D", 0, 0},
|
|
||||||
{ XK_Left, ControlMask, "\033[1;5D", 0, 0},
|
|
||||||
{ XK_Left, ShiftMask|ControlMask,"\033[1;6D", 0, 0},
|
|
||||||
{ XK_Left, ControlMask|Mod1Mask,"\033[1;7D", 0, 0},
|
|
||||||
{ XK_Left,ShiftMask|ControlMask|Mod1Mask,"\033[1;8D",0, 0},
|
|
||||||
{ XK_Left, XK_ANY_MOD, "\033[D", 0, -1},
|
|
||||||
{ XK_Left, XK_ANY_MOD, "\033OD", 0, +1},
|
|
||||||
{ XK_Right, ShiftMask, "\033[1;2C", 0, 0},
|
|
||||||
{ XK_Right, Mod1Mask, "\033[1;3C", 0, 0},
|
|
||||||
{ XK_Right, ShiftMask|Mod1Mask,"\033[1;4C", 0, 0},
|
|
||||||
{ XK_Right, ControlMask, "\033[1;5C", 0, 0},
|
|
||||||
{ XK_Right, ShiftMask|ControlMask,"\033[1;6C", 0, 0},
|
|
||||||
{ XK_Right, ControlMask|Mod1Mask,"\033[1;7C", 0, 0},
|
|
||||||
{ XK_Right,ShiftMask|ControlMask|Mod1Mask,"\033[1;8C",0, 0},
|
|
||||||
{ XK_Right, XK_ANY_MOD, "\033[C", 0, -1},
|
|
||||||
{ XK_Right, XK_ANY_MOD, "\033OC", 0, +1},
|
|
||||||
{ XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0},
|
|
||||||
{ XK_Return, Mod1Mask, "\033\r", 0, 0},
|
|
||||||
{ XK_Return, XK_ANY_MOD, "\r", 0, 0},
|
|
||||||
{ XK_Insert, ShiftMask, "\033[4l", -1, 0},
|
|
||||||
{ XK_Insert, ShiftMask, "\033[2;2~", +1, 0},
|
|
||||||
{ XK_Insert, ControlMask, "\033[L", -1, 0},
|
|
||||||
{ XK_Insert, ControlMask, "\033[2;5~", +1, 0},
|
|
||||||
{ XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0},
|
|
||||||
{ XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0},
|
|
||||||
{ XK_Delete, ControlMask, "\033[M", -1, 0},
|
|
||||||
{ XK_Delete, ControlMask, "\033[3;5~", +1, 0},
|
|
||||||
{ XK_Delete, ShiftMask, "\033[2K", -1, 0},
|
|
||||||
{ XK_Delete, ShiftMask, "\033[3;2~", +1, 0},
|
|
||||||
{ XK_Delete, XK_ANY_MOD, "\033[P", -1, 0},
|
|
||||||
{ XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0},
|
|
||||||
{ XK_BackSpace, XK_NO_MOD, "\177", 0, 0},
|
|
||||||
{ XK_BackSpace, Mod1Mask, "\033\177", 0, 0},
|
|
||||||
{ XK_Home, ShiftMask, "\033[2J", 0, -1},
|
|
||||||
{ XK_Home, ShiftMask, "\033[1;2H", 0, +1},
|
|
||||||
{ XK_Home, XK_ANY_MOD, "\033[H", 0, -1},
|
|
||||||
{ XK_Home, XK_ANY_MOD, "\033[1~", 0, +1},
|
|
||||||
{ XK_End, ControlMask, "\033[J", -1, 0},
|
|
||||||
{ XK_End, ControlMask, "\033[1;5F", +1, 0},
|
|
||||||
{ XK_End, ShiftMask, "\033[K", -1, 0},
|
|
||||||
{ XK_End, ShiftMask, "\033[1;2F", +1, 0},
|
|
||||||
{ XK_End, XK_ANY_MOD, "\033[4~", 0, 0},
|
|
||||||
{ XK_Prior, ControlMask, "\033[5;5~", 0, 0},
|
|
||||||
{ XK_Prior, ShiftMask, "\033[5;2~", 0, 0},
|
|
||||||
{ XK_Prior, XK_ANY_MOD, "\033[5~", 0, 0},
|
|
||||||
{ XK_Next, ControlMask, "\033[6;5~", 0, 0},
|
|
||||||
{ XK_Next, ShiftMask, "\033[6;2~", 0, 0},
|
|
||||||
{ XK_Next, XK_ANY_MOD, "\033[6~", 0, 0},
|
|
||||||
{ XK_F1, XK_NO_MOD, "\033OP" , 0, 0},
|
|
||||||
{ XK_F1, /* F13 */ ShiftMask, "\033[1;2P", 0, 0},
|
|
||||||
{ XK_F1, /* F25 */ ControlMask, "\033[1;5P", 0, 0},
|
|
||||||
{ XK_F1, /* F37 */ Mod4Mask, "\033[1;6P", 0, 0},
|
|
||||||
{ XK_F1, /* F49 */ Mod1Mask, "\033[1;3P", 0, 0},
|
|
||||||
{ XK_F1, /* F61 */ Mod3Mask, "\033[1;4P", 0, 0},
|
|
||||||
{ XK_F2, XK_NO_MOD, "\033OQ" , 0, 0},
|
|
||||||
{ XK_F2, /* F14 */ ShiftMask, "\033[1;2Q", 0, 0},
|
|
||||||
{ XK_F2, /* F26 */ ControlMask, "\033[1;5Q", 0, 0},
|
|
||||||
{ XK_F2, /* F38 */ Mod4Mask, "\033[1;6Q", 0, 0},
|
|
||||||
{ XK_F2, /* F50 */ Mod1Mask, "\033[1;3Q", 0, 0},
|
|
||||||
{ XK_F2, /* F62 */ Mod3Mask, "\033[1;4Q", 0, 0},
|
|
||||||
{ XK_F3, XK_NO_MOD, "\033OR" , 0, 0},
|
|
||||||
{ XK_F3, /* F15 */ ShiftMask, "\033[1;2R", 0, 0},
|
|
||||||
{ XK_F3, /* F27 */ ControlMask, "\033[1;5R", 0, 0},
|
|
||||||
{ XK_F3, /* F39 */ Mod4Mask, "\033[1;6R", 0, 0},
|
|
||||||
{ XK_F3, /* F51 */ Mod1Mask, "\033[1;3R", 0, 0},
|
|
||||||
{ XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0},
|
|
||||||
{ XK_F4, XK_NO_MOD, "\033OS" , 0, 0},
|
|
||||||
{ XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0},
|
|
||||||
{ XK_F4, /* F28 */ ControlMask, "\033[1;5S", 0, 0},
|
|
||||||
{ XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0},
|
|
||||||
{ XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0},
|
|
||||||
{ XK_F5, XK_NO_MOD, "\033[15~", 0, 0},
|
|
||||||
{ XK_F5, /* F17 */ ShiftMask, "\033[15;2~", 0, 0},
|
|
||||||
{ XK_F5, /* F29 */ ControlMask, "\033[15;5~", 0, 0},
|
|
||||||
{ XK_F5, /* F41 */ Mod4Mask, "\033[15;6~", 0, 0},
|
|
||||||
{ XK_F5, /* F53 */ Mod1Mask, "\033[15;3~", 0, 0},
|
|
||||||
{ XK_F6, XK_NO_MOD, "\033[17~", 0, 0},
|
|
||||||
{ XK_F6, /* F18 */ ShiftMask, "\033[17;2~", 0, 0},
|
|
||||||
{ XK_F6, /* F30 */ ControlMask, "\033[17;5~", 0, 0},
|
|
||||||
{ XK_F6, /* F42 */ Mod4Mask, "\033[17;6~", 0, 0},
|
|
||||||
{ XK_F6, /* F54 */ Mod1Mask, "\033[17;3~", 0, 0},
|
|
||||||
{ XK_F7, XK_NO_MOD, "\033[18~", 0, 0},
|
|
||||||
{ XK_F7, /* F19 */ ShiftMask, "\033[18;2~", 0, 0},
|
|
||||||
{ XK_F7, /* F31 */ ControlMask, "\033[18;5~", 0, 0},
|
|
||||||
{ XK_F7, /* F43 */ Mod4Mask, "\033[18;6~", 0, 0},
|
|
||||||
{ XK_F7, /* F55 */ Mod1Mask, "\033[18;3~", 0, 0},
|
|
||||||
{ XK_F8, XK_NO_MOD, "\033[19~", 0, 0},
|
|
||||||
{ XK_F8, /* F20 */ ShiftMask, "\033[19;2~", 0, 0},
|
|
||||||
{ XK_F8, /* F32 */ ControlMask, "\033[19;5~", 0, 0},
|
|
||||||
{ XK_F8, /* F44 */ Mod4Mask, "\033[19;6~", 0, 0},
|
|
||||||
{ XK_F8, /* F56 */ Mod1Mask, "\033[19;3~", 0, 0},
|
|
||||||
{ XK_F9, XK_NO_MOD, "\033[20~", 0, 0},
|
|
||||||
{ XK_F9, /* F21 */ ShiftMask, "\033[20;2~", 0, 0},
|
|
||||||
{ XK_F9, /* F33 */ ControlMask, "\033[20;5~", 0, 0},
|
|
||||||
{ XK_F9, /* F45 */ Mod4Mask, "\033[20;6~", 0, 0},
|
|
||||||
{ XK_F9, /* F57 */ Mod1Mask, "\033[20;3~", 0, 0},
|
|
||||||
{ XK_F10, XK_NO_MOD, "\033[21~", 0, 0},
|
|
||||||
{ XK_F10, /* F22 */ ShiftMask, "\033[21;2~", 0, 0},
|
|
||||||
{ XK_F10, /* F34 */ ControlMask, "\033[21;5~", 0, 0},
|
|
||||||
{ XK_F10, /* F46 */ Mod4Mask, "\033[21;6~", 0, 0},
|
|
||||||
{ XK_F10, /* F58 */ Mod1Mask, "\033[21;3~", 0, 0},
|
|
||||||
{ XK_F11, XK_NO_MOD, "\033[23~", 0, 0},
|
|
||||||
{ XK_F11, /* F23 */ ShiftMask, "\033[23;2~", 0, 0},
|
|
||||||
{ XK_F11, /* F35 */ ControlMask, "\033[23;5~", 0, 0},
|
|
||||||
{ XK_F11, /* F47 */ Mod4Mask, "\033[23;6~", 0, 0},
|
|
||||||
{ XK_F11, /* F59 */ Mod1Mask, "\033[23;3~", 0, 0},
|
|
||||||
{ XK_F12, XK_NO_MOD, "\033[24~", 0, 0},
|
|
||||||
{ XK_F12, /* F24 */ ShiftMask, "\033[24;2~", 0, 0},
|
|
||||||
{ XK_F12, /* F36 */ ControlMask, "\033[24;5~", 0, 0},
|
|
||||||
{ XK_F12, /* F48 */ Mod4Mask, "\033[24;6~", 0, 0},
|
|
||||||
{ XK_F12, /* F60 */ Mod1Mask, "\033[24;3~", 0, 0},
|
|
||||||
{ XK_F13, XK_NO_MOD, "\033[1;2P", 0, 0},
|
|
||||||
{ XK_F14, XK_NO_MOD, "\033[1;2Q", 0, 0},
|
|
||||||
{ XK_F15, XK_NO_MOD, "\033[1;2R", 0, 0},
|
|
||||||
{ XK_F16, XK_NO_MOD, "\033[1;2S", 0, 0},
|
|
||||||
{ XK_F17, XK_NO_MOD, "\033[15;2~", 0, 0},
|
|
||||||
{ XK_F18, XK_NO_MOD, "\033[17;2~", 0, 0},
|
|
||||||
{ XK_F19, XK_NO_MOD, "\033[18;2~", 0, 0},
|
|
||||||
{ XK_F20, XK_NO_MOD, "\033[19;2~", 0, 0},
|
|
||||||
{ XK_F21, XK_NO_MOD, "\033[20;2~", 0, 0},
|
|
||||||
{ XK_F22, XK_NO_MOD, "\033[21;2~", 0, 0},
|
|
||||||
{ XK_F23, XK_NO_MOD, "\033[23;2~", 0, 0},
|
|
||||||
{ XK_F24, XK_NO_MOD, "\033[24;2~", 0, 0},
|
|
||||||
{ XK_F25, XK_NO_MOD, "\033[1;5P", 0, 0},
|
|
||||||
{ XK_F26, XK_NO_MOD, "\033[1;5Q", 0, 0},
|
|
||||||
{ XK_F27, XK_NO_MOD, "\033[1;5R", 0, 0},
|
|
||||||
{ XK_F28, XK_NO_MOD, "\033[1;5S", 0, 0},
|
|
||||||
{ XK_F29, XK_NO_MOD, "\033[15;5~", 0, 0},
|
|
||||||
{ XK_F30, XK_NO_MOD, "\033[17;5~", 0, 0},
|
|
||||||
{ XK_F31, XK_NO_MOD, "\033[18;5~", 0, 0},
|
|
||||||
{ XK_F32, XK_NO_MOD, "\033[19;5~", 0, 0},
|
|
||||||
{ XK_F33, XK_NO_MOD, "\033[20;5~", 0, 0},
|
|
||||||
{ XK_F34, XK_NO_MOD, "\033[21;5~", 0, 0},
|
|
||||||
{ XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0},
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Selection types' masks.
|
|
||||||
* Use the same masks as usual.
|
|
||||||
* Button1Mask is always unset, to make masks match between ButtonPress.
|
|
||||||
* ButtonRelease and MotionNotify.
|
|
||||||
* If no match is found, regular selection is used.
|
|
||||||
*/
|
|
||||||
static uint selmasks[] = {
|
|
||||||
[SEL_RECTANGULAR] = Mod1Mask,
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Printable characters in ASCII, used to estimate the advance width
|
|
||||||
* of single wide characters.
|
|
||||||
*/
|
|
||||||
static char ascii_printable[] =
|
|
||||||
" !\"#$%&'()*+,-./0123456789:;<=>?"
|
|
||||||
"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
|
|
||||||
"`abcdefghijklmnopqrstuvwxyz{|}~";
|
|
@ -1,36 +0,0 @@
|
|||||||
# st version
|
|
||||||
VERSION = 0.8.5
|
|
||||||
|
|
||||||
# Customize below to fit your system
|
|
||||||
|
|
||||||
# paths
|
|
||||||
PREFIX = $(HOME)/.local
|
|
||||||
MANPREFIX = $(PREFIX)/share/man
|
|
||||||
|
|
||||||
X11INC = /usr/X11R6/include
|
|
||||||
X11LIB = /usr/X11R6/lib
|
|
||||||
|
|
||||||
PKG_CONFIG = pkg-config
|
|
||||||
|
|
||||||
# includes and libs
|
|
||||||
INCS = -I$(X11INC) \
|
|
||||||
`$(PKG_CONFIG) --cflags fontconfig` \
|
|
||||||
`$(PKG_CONFIG) --cflags freetype2`
|
|
||||||
LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft \
|
|
||||||
`$(PKG_CONFIG) --libs fontconfig` \
|
|
||||||
`$(PKG_CONFIG) --libs freetype2`
|
|
||||||
|
|
||||||
# flags
|
|
||||||
STCPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600
|
|
||||||
STCFLAGS = $(INCS) $(STCPPFLAGS) $(CPPFLAGS) $(CFLAGS)
|
|
||||||
STLDFLAGS = $(LIBS) $(LDFLAGS)
|
|
||||||
|
|
||||||
# OpenBSD:
|
|
||||||
#CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
|
|
||||||
#LIBS = -L$(X11LIB) -lm -lX11 -lutil -lXft \
|
|
||||||
# `$(PKG_CONFIG) --libs fontconfig` \
|
|
||||||
# `$(PKG_CONFIG) --libs freetype2`
|
|
||||||
#MANPREFIX = ${PREFIX}/man
|
|
||||||
|
|
||||||
# compiler and linker
|
|
||||||
# CC = c99
|
|
@ -1,20 +0,0 @@
|
|||||||
/* Terminal colors (16 first used in escape sequence) */
|
|
||||||
static const char *colorname[] = {
|
|
||||||
/* solarized light */
|
|
||||||
"#eee8d5", /* 0: black */
|
|
||||||
"#dc322f", /* 1: red */
|
|
||||||
"#859900", /* 2: green */
|
|
||||||
"#b58900", /* 3: yellow */
|
|
||||||
"#268bd2", /* 4: blue */
|
|
||||||
"#d33682", /* 5: magenta */
|
|
||||||
"#2aa198", /* 6: cyan */
|
|
||||||
"#073642", /* 7: white */
|
|
||||||
"#fdf6e3", /* 8: brblack */
|
|
||||||
"#cb4b16", /* 9: brred */
|
|
||||||
"#93a1a1", /* 10: brgreen */
|
|
||||||
"#839496", /* 11: bryellow */
|
|
||||||
"#657b83", /* 12: brblue */
|
|
||||||
"#6c71c4", /* 13: brmagenta*/
|
|
||||||
"#586e75", /* 14: brcyan */
|
|
||||||
"#002b36", /* 15: brwhite */
|
|
||||||
};
|
|
180
builds/st/st.1
180
builds/st/st.1
@ -1,180 +0,0 @@
|
|||||||
.TH ST 1 st\-VERSION
|
|
||||||
.SH NAME
|
|
||||||
st \- simple terminal
|
|
||||||
.SH SYNOPSIS
|
|
||||||
.B st
|
|
||||||
.RB [ \-aivp ]
|
|
||||||
.RB [ \-c
|
|
||||||
.IR class ]
|
|
||||||
.RB [ \-f
|
|
||||||
.IR font ]
|
|
||||||
.RB [ \-g
|
|
||||||
.IR geometry ]
|
|
||||||
.RB [ \-n
|
|
||||||
.IR name ]
|
|
||||||
.RB [ \-o
|
|
||||||
.IR iofile ]
|
|
||||||
.RB [ \-T
|
|
||||||
.IR title ]
|
|
||||||
.RB [ \-t
|
|
||||||
.IR title ]
|
|
||||||
.RB [ \-l
|
|
||||||
.IR line ]
|
|
||||||
.RB [ \-w
|
|
||||||
.IR windowid ]
|
|
||||||
.RB [[ \-e ]
|
|
||||||
.IR command
|
|
||||||
.RI [ arguments ...]]
|
|
||||||
.PP
|
|
||||||
.B st
|
|
||||||
.RB [ \-aivp ]
|
|
||||||
.RB [ \-c
|
|
||||||
.IR class ]
|
|
||||||
.RB [ \-f
|
|
||||||
.IR font ]
|
|
||||||
.RB [ \-g
|
|
||||||
.IR geometry ]
|
|
||||||
.RB [ \-n
|
|
||||||
.IR name ]
|
|
||||||
.RB [ \-o
|
|
||||||
.IR iofile ]
|
|
||||||
.RB [ \-T
|
|
||||||
.IR title ]
|
|
||||||
.RB [ \-t
|
|
||||||
.IR title ]
|
|
||||||
.RB [ \-w
|
|
||||||
.IR windowid ]
|
|
||||||
.RB \-l
|
|
||||||
.IR line
|
|
||||||
.RI [ stty_args ...]
|
|
||||||
.SH DESCRIPTION
|
|
||||||
.B st
|
|
||||||
is a simple terminal emulator.
|
|
||||||
.SH OPTIONS
|
|
||||||
.TP
|
|
||||||
.B \-a
|
|
||||||
disable alternate screens in terminal
|
|
||||||
.TP
|
|
||||||
.BI \-c " class"
|
|
||||||
defines the window class (default $TERM).
|
|
||||||
.TP
|
|
||||||
.BI \-f " font"
|
|
||||||
defines the
|
|
||||||
.I font
|
|
||||||
to use when st is run.
|
|
||||||
.TP
|
|
||||||
.BI \-g " geometry"
|
|
||||||
defines the X11 geometry string.
|
|
||||||
The form is [=][<cols>{xX}<rows>][{+-}<xoffset>{+-}<yoffset>]. See
|
|
||||||
.BR XParseGeometry (3)
|
|
||||||
for further details.
|
|
||||||
.TP
|
|
||||||
.B \-i
|
|
||||||
will fixate the position given with the -g option.
|
|
||||||
.TP
|
|
||||||
.BI \-n " name"
|
|
||||||
defines the window instance name (default $TERM).
|
|
||||||
.TP
|
|
||||||
.BI \-o " iofile"
|
|
||||||
writes all the I/O to
|
|
||||||
.I iofile.
|
|
||||||
This feature is useful when recording st sessions. A value of "-" means
|
|
||||||
standard output.
|
|
||||||
.TP
|
|
||||||
.BI \-p
|
|
||||||
enters pixel-perfect mode, where -g requests specific pixels instead of characters
|
|
||||||
.TP
|
|
||||||
.BI \-T " title"
|
|
||||||
defines the window title (default 'st').
|
|
||||||
.TP
|
|
||||||
.BI \-t " title"
|
|
||||||
defines the window title (default 'st').
|
|
||||||
.TP
|
|
||||||
.BI \-w " windowid"
|
|
||||||
embeds st within the window identified by
|
|
||||||
.I windowid
|
|
||||||
.TP
|
|
||||||
.BI \-l " line"
|
|
||||||
use a tty
|
|
||||||
.I line
|
|
||||||
instead of a pseudo terminal.
|
|
||||||
.I line
|
|
||||||
should be a (pseudo-)serial device (e.g. /dev/ttyS0 on Linux for serial port
|
|
||||||
0).
|
|
||||||
When this flag is given
|
|
||||||
remaining arguments are used as flags for
|
|
||||||
.BR stty(1).
|
|
||||||
By default st initializes the serial line to 8 bits, no parity, 1 stop bit
|
|
||||||
and a 38400 baud rate. The speed is set by appending it as last argument
|
|
||||||
(e.g. 'st -l /dev/ttyS0 115200'). Arguments before the last one are
|
|
||||||
.BR stty(1)
|
|
||||||
flags. If you want to set odd parity on 115200 baud use for example 'st -l
|
|
||||||
/dev/ttyS0 parenb parodd 115200'. Set the number of bits by using for
|
|
||||||
example 'st -l /dev/ttyS0 cs7 115200'. See
|
|
||||||
.BR stty(1)
|
|
||||||
for more arguments and cases.
|
|
||||||
.TP
|
|
||||||
.B \-v
|
|
||||||
prints version information to stderr, then exits.
|
|
||||||
.TP
|
|
||||||
.BI \-e " command " [ " arguments " "... ]"
|
|
||||||
st executes
|
|
||||||
.I command
|
|
||||||
instead of the shell. If this is used it
|
|
||||||
.B must be the last option
|
|
||||||
on the command line, as in xterm / rxvt.
|
|
||||||
This option is only intended for compatibility,
|
|
||||||
and all the remaining arguments are used as a command
|
|
||||||
even without it.
|
|
||||||
.SH SHORTCUTS
|
|
||||||
.TP
|
|
||||||
.B Break
|
|
||||||
Send a break in the serial line.
|
|
||||||
Break key is obtained in PC keyboards
|
|
||||||
pressing at the same time control and pause.
|
|
||||||
.TP
|
|
||||||
.B Ctrl-Print Screen
|
|
||||||
Toggle if st should print to the
|
|
||||||
.I iofile.
|
|
||||||
.TP
|
|
||||||
.B Shift-Print Screen
|
|
||||||
Print the full screen to the
|
|
||||||
.I iofile.
|
|
||||||
.TP
|
|
||||||
.B Print Screen
|
|
||||||
Print the selection to the
|
|
||||||
.I iofile.
|
|
||||||
.TP
|
|
||||||
.B Ctrl-Shift-Page Up
|
|
||||||
Increase font size.
|
|
||||||
.TP
|
|
||||||
.B Ctrl-Shift-Page Down
|
|
||||||
Decrease font size.
|
|
||||||
.TP
|
|
||||||
.B Ctrl-Shift-Home
|
|
||||||
Reset to default font size.
|
|
||||||
.TP
|
|
||||||
.B Ctrl-Shift-y
|
|
||||||
Paste from primary selection (middle mouse button).
|
|
||||||
.TP
|
|
||||||
.B Ctrl-Shift-c
|
|
||||||
Copy the selected text to the clipboard selection.
|
|
||||||
.TP
|
|
||||||
.B Ctrl-Shift-v
|
|
||||||
Paste from the clipboard selection.
|
|
||||||
.SH CUSTOMIZATION
|
|
||||||
.B st
|
|
||||||
can be customized by creating a custom config.h and (re)compiling the source
|
|
||||||
code. This keeps it fast, secure and simple.
|
|
||||||
.SH AUTHORS
|
|
||||||
See the LICENSE file for the authors.
|
|
||||||
.SH LICENSE
|
|
||||||
See the LICENSE file for the terms of redistribution.
|
|
||||||
.SH SEE ALSO
|
|
||||||
.BR tabbed (1),
|
|
||||||
.BR utmp (1),
|
|
||||||
.BR stty (1),
|
|
||||||
.BR scroll (1)
|
|
||||||
.SH BUGS
|
|
||||||
See the TODO file in the distribution.
|
|
||||||
|
|
2918
builds/st/st.c
2918
builds/st/st.c
File diff suppressed because it is too large
Load Diff
131
builds/st/st.h
131
builds/st/st.h
@ -1,131 +0,0 @@
|
|||||||
/* See LICENSE for license details. */
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
|
|
||||||
/* macros */
|
|
||||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
|
||||||
#define MAX(a, b) ((a) < (b) ? (b) : (a))
|
|
||||||
#define LEN(a) (sizeof(a) / sizeof(a)[0])
|
|
||||||
#define BETWEEN(x, a, b) ((a) <= (x) && (x) <= (b))
|
|
||||||
#define DIVCEIL(n, d) (((n) + ((d) - 1)) / (d))
|
|
||||||
#define DEFAULT(a, b) (a) = (a) ? (a) : (b)
|
|
||||||
#define LIMIT(x, a, b) (x) = (x) < (a) ? (a) : (x) > (b) ? (b) : (x)
|
|
||||||
#define ATTRCMP(a, b) ((a).mode != (b).mode || (a).fg != (b).fg || \
|
|
||||||
(a).bg != (b).bg)
|
|
||||||
#define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + \
|
|
||||||
(t1.tv_nsec-t2.tv_nsec)/1E6)
|
|
||||||
#define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit)))
|
|
||||||
|
|
||||||
#define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b))
|
|
||||||
#define IS_TRUECOL(x) (1 << 24 & (x))
|
|
||||||
|
|
||||||
enum glyph_attribute {
|
|
||||||
ATTR_NULL = 0,
|
|
||||||
ATTR_BOLD = 1 << 0,
|
|
||||||
ATTR_FAINT = 1 << 1,
|
|
||||||
ATTR_ITALIC = 1 << 2,
|
|
||||||
ATTR_UNDERLINE = 1 << 3,
|
|
||||||
ATTR_BLINK = 1 << 4,
|
|
||||||
ATTR_REVERSE = 1 << 5,
|
|
||||||
ATTR_INVISIBLE = 1 << 6,
|
|
||||||
ATTR_STRUCK = 1 << 7,
|
|
||||||
ATTR_WRAP = 1 << 8,
|
|
||||||
ATTR_WIDE = 1 << 9,
|
|
||||||
ATTR_WDUMMY = 1 << 10,
|
|
||||||
ATTR_BOLD_FAINT = ATTR_BOLD | ATTR_FAINT,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum selection_mode {
|
|
||||||
SEL_IDLE = 0,
|
|
||||||
SEL_EMPTY = 1,
|
|
||||||
SEL_READY = 2
|
|
||||||
};
|
|
||||||
|
|
||||||
enum selection_type {
|
|
||||||
SEL_REGULAR = 1,
|
|
||||||
SEL_RECTANGULAR = 2
|
|
||||||
};
|
|
||||||
|
|
||||||
enum selection_snap {
|
|
||||||
SNAP_WORD = 1,
|
|
||||||
SNAP_LINE = 2
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef unsigned char uchar;
|
|
||||||
typedef unsigned int uint;
|
|
||||||
typedef unsigned long ulong;
|
|
||||||
typedef unsigned short ushort;
|
|
||||||
|
|
||||||
typedef uint_least32_t Rune;
|
|
||||||
|
|
||||||
#define Glyph Glyph_
|
|
||||||
typedef struct {
|
|
||||||
Rune u; /* character code */
|
|
||||||
ushort mode; /* attribute flags */
|
|
||||||
uint32_t fg; /* foreground */
|
|
||||||
uint32_t bg; /* background */
|
|
||||||
} Glyph;
|
|
||||||
|
|
||||||
typedef Glyph *Line;
|
|
||||||
|
|
||||||
typedef union {
|
|
||||||
int i;
|
|
||||||
uint ui;
|
|
||||||
float f;
|
|
||||||
const void *v;
|
|
||||||
const char *s;
|
|
||||||
} Arg;
|
|
||||||
|
|
||||||
void die(const char *, ...);
|
|
||||||
void die_error(int err, const char *, ...);
|
|
||||||
void redraw(void);
|
|
||||||
void draw(void);
|
|
||||||
|
|
||||||
void externalpipe(const Arg *);
|
|
||||||
void kscrolldown(const Arg *);
|
|
||||||
void kscrollup(const Arg *);
|
|
||||||
void printscreen(const Arg *);
|
|
||||||
void printsel(const Arg *);
|
|
||||||
void sendbreak(const Arg *);
|
|
||||||
void toggleprinter(const Arg *);
|
|
||||||
void copyurl(const Arg *);
|
|
||||||
|
|
||||||
int tattrset(int);
|
|
||||||
void tnew(int, int);
|
|
||||||
void tresize(int, int);
|
|
||||||
void tsetdirtattr(int);
|
|
||||||
void ttyhangup(void);
|
|
||||||
int ttynew(const char *, char *, const char *, char **);
|
|
||||||
size_t ttyread(void);
|
|
||||||
void ttyresize(int, int);
|
|
||||||
void ttywrite(const char *, size_t, int);
|
|
||||||
|
|
||||||
void resettitle(void);
|
|
||||||
|
|
||||||
void selclear(void);
|
|
||||||
void selinit(void);
|
|
||||||
void selstart(int, int, int);
|
|
||||||
void selextend(int, int, int, int);
|
|
||||||
int selected(int, int);
|
|
||||||
char *getsel(void);
|
|
||||||
|
|
||||||
size_t utf8encode(Rune, char *);
|
|
||||||
|
|
||||||
void *xmalloc(size_t);
|
|
||||||
void *xrealloc(void *, size_t);
|
|
||||||
char *xstrdup(const char *);
|
|
||||||
|
|
||||||
/* config.h globals */
|
|
||||||
extern char *utmp;
|
|
||||||
extern char *scroll;
|
|
||||||
extern char *stty_args;
|
|
||||||
extern char *vtiden;
|
|
||||||
extern wchar_t *worddelimiters;
|
|
||||||
extern int allowaltscreen;
|
|
||||||
extern int allowwindowops;
|
|
||||||
extern char *termname;
|
|
||||||
extern unsigned int tabspaces;
|
|
||||||
extern unsigned int defaultfg;
|
|
||||||
extern unsigned int defaultbg;
|
|
||||||
extern unsigned int defaultcs;
|
|
@ -1,239 +0,0 @@
|
|||||||
st-mono| simpleterm monocolor,
|
|
||||||
acsc=+C\,D-A.B0E``aaffgghFiGjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
|
|
||||||
am,
|
|
||||||
bce,
|
|
||||||
bel=^G,
|
|
||||||
blink=\E[5m,
|
|
||||||
bold=\E[1m,
|
|
||||||
cbt=\E[Z,
|
|
||||||
cvvis=\E[?25h,
|
|
||||||
civis=\E[?25l,
|
|
||||||
clear=\E[H\E[2J,
|
|
||||||
cnorm=\E[?12l\E[?25h,
|
|
||||||
colors#2,
|
|
||||||
cols#80,
|
|
||||||
cr=^M,
|
|
||||||
csr=\E[%i%p1%d;%p2%dr,
|
|
||||||
cub=\E[%p1%dD,
|
|
||||||
cub1=^H,
|
|
||||||
cud1=^J,
|
|
||||||
cud=\E[%p1%dB,
|
|
||||||
cuf1=\E[C,
|
|
||||||
cuf=\E[%p1%dC,
|
|
||||||
cup=\E[%i%p1%d;%p2%dH,
|
|
||||||
cuu1=\E[A,
|
|
||||||
cuu=\E[%p1%dA,
|
|
||||||
dch=\E[%p1%dP,
|
|
||||||
dch1=\E[P,
|
|
||||||
dim=\E[2m,
|
|
||||||
dl=\E[%p1%dM,
|
|
||||||
dl1=\E[M,
|
|
||||||
ech=\E[%p1%dX,
|
|
||||||
ed=\E[J,
|
|
||||||
el=\E[K,
|
|
||||||
el1=\E[1K,
|
|
||||||
enacs=\E)0,
|
|
||||||
flash=\E[?5h$<80/>\E[?5l,
|
|
||||||
fsl=^G,
|
|
||||||
home=\E[H,
|
|
||||||
hpa=\E[%i%p1%dG,
|
|
||||||
hs,
|
|
||||||
ht=^I,
|
|
||||||
hts=\EH,
|
|
||||||
ich=\E[%p1%d@,
|
|
||||||
il1=\E[L,
|
|
||||||
il=\E[%p1%dL,
|
|
||||||
ind=^J,
|
|
||||||
indn=\E[%p1%dS,
|
|
||||||
invis=\E[8m,
|
|
||||||
is2=\E[4l\E>\E[?1034l,
|
|
||||||
it#8,
|
|
||||||
kel=\E[1;2F,
|
|
||||||
ked=\E[1;5F,
|
|
||||||
ka1=\E[1~,
|
|
||||||
ka3=\E[5~,
|
|
||||||
kc1=\E[4~,
|
|
||||||
kc3=\E[6~,
|
|
||||||
kbs=\177,
|
|
||||||
kcbt=\E[Z,
|
|
||||||
kb2=\EOu,
|
|
||||||
kcub1=\EOD,
|
|
||||||
kcud1=\EOB,
|
|
||||||
kcuf1=\EOC,
|
|
||||||
kcuu1=\EOA,
|
|
||||||
kDC=\E[3;2~,
|
|
||||||
kent=\EOM,
|
|
||||||
kEND=\E[1;2F,
|
|
||||||
kIC=\E[2;2~,
|
|
||||||
kNXT=\E[6;2~,
|
|
||||||
kPRV=\E[5;2~,
|
|
||||||
kHOM=\E[1;2H,
|
|
||||||
kLFT=\E[1;2D,
|
|
||||||
kRIT=\E[1;2C,
|
|
||||||
kind=\E[1;2B,
|
|
||||||
kri=\E[1;2A,
|
|
||||||
kclr=\E[3;5~,
|
|
||||||
kdl1=\E[3;2~,
|
|
||||||
kdch1=\E[3~,
|
|
||||||
kich1=\E[2~,
|
|
||||||
kend=\E[4~,
|
|
||||||
kf1=\EOP,
|
|
||||||
kf2=\EOQ,
|
|
||||||
kf3=\EOR,
|
|
||||||
kf4=\EOS,
|
|
||||||
kf5=\E[15~,
|
|
||||||
kf6=\E[17~,
|
|
||||||
kf7=\E[18~,
|
|
||||||
kf8=\E[19~,
|
|
||||||
kf9=\E[20~,
|
|
||||||
kf10=\E[21~,
|
|
||||||
kf11=\E[23~,
|
|
||||||
kf12=\E[24~,
|
|
||||||
kf13=\E[1;2P,
|
|
||||||
kf14=\E[1;2Q,
|
|
||||||
kf15=\E[1;2R,
|
|
||||||
kf16=\E[1;2S,
|
|
||||||
kf17=\E[15;2~,
|
|
||||||
kf18=\E[17;2~,
|
|
||||||
kf19=\E[18;2~,
|
|
||||||
kf20=\E[19;2~,
|
|
||||||
kf21=\E[20;2~,
|
|
||||||
kf22=\E[21;2~,
|
|
||||||
kf23=\E[23;2~,
|
|
||||||
kf24=\E[24;2~,
|
|
||||||
kf25=\E[1;5P,
|
|
||||||
kf26=\E[1;5Q,
|
|
||||||
kf27=\E[1;5R,
|
|
||||||
kf28=\E[1;5S,
|
|
||||||
kf29=\E[15;5~,
|
|
||||||
kf30=\E[17;5~,
|
|
||||||
kf31=\E[18;5~,
|
|
||||||
kf32=\E[19;5~,
|
|
||||||
kf33=\E[20;5~,
|
|
||||||
kf34=\E[21;5~,
|
|
||||||
kf35=\E[23;5~,
|
|
||||||
kf36=\E[24;5~,
|
|
||||||
kf37=\E[1;6P,
|
|
||||||
kf38=\E[1;6Q,
|
|
||||||
kf39=\E[1;6R,
|
|
||||||
kf40=\E[1;6S,
|
|
||||||
kf41=\E[15;6~,
|
|
||||||
kf42=\E[17;6~,
|
|
||||||
kf43=\E[18;6~,
|
|
||||||
kf44=\E[19;6~,
|
|
||||||
kf45=\E[20;6~,
|
|
||||||
kf46=\E[21;6~,
|
|
||||||
kf47=\E[23;6~,
|
|
||||||
kf48=\E[24;6~,
|
|
||||||
kf49=\E[1;3P,
|
|
||||||
kf50=\E[1;3Q,
|
|
||||||
kf51=\E[1;3R,
|
|
||||||
kf52=\E[1;3S,
|
|
||||||
kf53=\E[15;3~,
|
|
||||||
kf54=\E[17;3~,
|
|
||||||
kf55=\E[18;3~,
|
|
||||||
kf56=\E[19;3~,
|
|
||||||
kf57=\E[20;3~,
|
|
||||||
kf58=\E[21;3~,
|
|
||||||
kf59=\E[23;3~,
|
|
||||||
kf60=\E[24;3~,
|
|
||||||
kf61=\E[1;4P,
|
|
||||||
kf62=\E[1;4Q,
|
|
||||||
kf63=\E[1;4R,
|
|
||||||
khome=\E[1~,
|
|
||||||
kil1=\E[2;5~,
|
|
||||||
krmir=\E[2;2~,
|
|
||||||
knp=\E[6~,
|
|
||||||
kmous=\E[M,
|
|
||||||
kpp=\E[5~,
|
|
||||||
lines#24,
|
|
||||||
mir,
|
|
||||||
msgr,
|
|
||||||
npc,
|
|
||||||
op=\E[39;49m,
|
|
||||||
pairs#64,
|
|
||||||
mc0=\E[i,
|
|
||||||
mc4=\E[4i,
|
|
||||||
mc5=\E[5i,
|
|
||||||
rc=\E8,
|
|
||||||
rev=\E[7m,
|
|
||||||
ri=\EM,
|
|
||||||
rin=\E[%p1%dT,
|
|
||||||
ritm=\E[23m,
|
|
||||||
rmacs=\E(B,
|
|
||||||
rmcup=\E[?1049l\E[23;0;0t,
|
|
||||||
rmir=\E[4l,
|
|
||||||
rmkx=\E[?1l\E>,
|
|
||||||
rmso=\E[27m,
|
|
||||||
rmul=\E[24m,
|
|
||||||
rs1=\Ec,
|
|
||||||
rs2=\E[4l\E>\E[?1034l,
|
|
||||||
sc=\E7,
|
|
||||||
sitm=\E[3m,
|
|
||||||
sgr0=\E[0m,
|
|
||||||
smacs=\E(0,
|
|
||||||
smcup=\E[?1049h\E[22;0;0t,
|
|
||||||
smir=\E[4h,
|
|
||||||
smkx=\E[?1h\E=,
|
|
||||||
smso=\E[7m,
|
|
||||||
smul=\E[4m,
|
|
||||||
tbc=\E[3g,
|
|
||||||
tsl=\E]0;,
|
|
||||||
xenl,
|
|
||||||
vpa=\E[%i%p1%dd,
|
|
||||||
# XTerm extensions
|
|
||||||
rmxx=\E[29m,
|
|
||||||
smxx=\E[9m,
|
|
||||||
# disabled rep for now: causes some issues with older ncurses versions.
|
|
||||||
# rep=%p1%c\E[%p2%{1}%-%db,
|
|
||||||
# tmux extensions, see TERMINFO EXTENSIONS in tmux(1)
|
|
||||||
Tc,
|
|
||||||
Ms=\E]52;%p1%s;%p2%s\007,
|
|
||||||
Se=\E[2 q,
|
|
||||||
Ss=\E[%p1%d q,
|
|
||||||
|
|
||||||
st| simpleterm,
|
|
||||||
use=st-mono,
|
|
||||||
colors#8,
|
|
||||||
setab=\E[4%p1%dm,
|
|
||||||
setaf=\E[3%p1%dm,
|
|
||||||
setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
|
|
||||||
setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
|
|
||||||
sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m,
|
|
||||||
|
|
||||||
st-256color| simpleterm with 256 colors,
|
|
||||||
use=st,
|
|
||||||
ccc,
|
|
||||||
colors#256,
|
|
||||||
oc=\E]104\007,
|
|
||||||
pairs#32767,
|
|
||||||
# Nicked from xterm-256color
|
|
||||||
initc=\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\,
|
|
||||||
setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
|
|
||||||
setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
|
|
||||||
|
|
||||||
st-meta| simpleterm with meta key,
|
|
||||||
use=st,
|
|
||||||
km,
|
|
||||||
rmm=\E[?1034l,
|
|
||||||
smm=\E[?1034h,
|
|
||||||
rs2=\E[4l\E>\E[?1034h,
|
|
||||||
is2=\E[4l\E>\E[?1034h,
|
|
||||||
|
|
||||||
st-meta-256color| simpleterm with meta key and 256 colors,
|
|
||||||
use=st-256color,
|
|
||||||
km,
|
|
||||||
rmm=\E[?1034l,
|
|
||||||
smm=\E[?1034h,
|
|
||||||
rs2=\E[4l\E>\E[?1034h,
|
|
||||||
is2=\E[4l\E>\E[?1034h,
|
|
||||||
|
|
||||||
st-bs| simpleterm with backspace as backspace,
|
|
||||||
use=st,
|
|
||||||
kbs=\010,
|
|
||||||
kdch1=\177,
|
|
||||||
|
|
||||||
st-bs-256color| simpleterm with backspace as backspace and 256colors,
|
|
||||||
use=st-256color,
|
|
||||||
kbs=\010,
|
|
||||||
kdch1=\177,
|
|
@ -1,43 +0,0 @@
|
|||||||
/* See LICENSE for license details. */
|
|
||||||
|
|
||||||
enum win_mode {
|
|
||||||
MODE_VISIBLE = 1 << 0,
|
|
||||||
MODE_FOCUSED = 1 << 1,
|
|
||||||
MODE_APPKEYPAD = 1 << 2,
|
|
||||||
MODE_MOUSEBTN = 1 << 3,
|
|
||||||
MODE_MOUSEMOTION = 1 << 4,
|
|
||||||
MODE_REVERSE = 1 << 5,
|
|
||||||
MODE_KBDLOCK = 1 << 6,
|
|
||||||
MODE_HIDE = 1 << 7,
|
|
||||||
MODE_APPCURSOR = 1 << 8,
|
|
||||||
MODE_MOUSESGR = 1 << 9,
|
|
||||||
MODE_8BIT = 1 << 10,
|
|
||||||
MODE_BLINK = 1 << 11,
|
|
||||||
MODE_FBLINK = 1 << 12,
|
|
||||||
MODE_FOCUS = 1 << 13,
|
|
||||||
MODE_MOUSEX10 = 1 << 14,
|
|
||||||
MODE_MOUSEMANY = 1 << 15,
|
|
||||||
MODE_BRCKTPASTE = 1 << 16,
|
|
||||||
MODE_NUMLOCK = 1 << 17,
|
|
||||||
MODE_MOUSE = MODE_MOUSEBTN|MODE_MOUSEMOTION|MODE_MOUSEX10\
|
|
||||||
|MODE_MOUSEMANY,
|
|
||||||
};
|
|
||||||
|
|
||||||
void xbell(void);
|
|
||||||
void xclipcopy(void);
|
|
||||||
void xdrawcursor(int, int, Glyph, int, int, Glyph);
|
|
||||||
void xdrawline(Line, int, int, int);
|
|
||||||
void xfinishdraw(void);
|
|
||||||
void xloadcols(void);
|
|
||||||
int xsetcolorname(int, const char *);
|
|
||||||
int xgetcolor(int, unsigned char *, unsigned char *, unsigned char *);
|
|
||||||
void xseticontitle(char *);
|
|
||||||
void xfreetitlestack(void);
|
|
||||||
void xsettitle(char *, int);
|
|
||||||
void xpushtitle(void);
|
|
||||||
int xsetcursor(int);
|
|
||||||
void xsetmode(int, unsigned int);
|
|
||||||
void xsetpointermotion(int);
|
|
||||||
void xsetsel(char *);
|
|
||||||
int xstartdraw(void);
|
|
||||||
void xximspot(int, int);
|
|
2147
builds/st/x.c
2147
builds/st/x.c
File diff suppressed because it is too large
Load Diff
@ -1,2 +0,0 @@
|
|||||||
{ pkgs ? import <nixpkgs> {} }:
|
|
||||||
pkgs.callPackage ./derivation.nix {}
|
|
@ -1,10 +0,0 @@
|
|||||||
{ lib, python3Packages }:
|
|
||||||
with python3Packages;
|
|
||||||
buildPythonApplication {
|
|
||||||
pname = "statusbar";
|
|
||||||
version = "1.0";
|
|
||||||
|
|
||||||
propagatedBuildInputs = [ ];
|
|
||||||
|
|
||||||
src = ./.;
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
from setuptools import setup, find_packages
|
|
||||||
|
|
||||||
setup(
|
|
||||||
name = 'pystatus',
|
|
||||||
version = '1.0.0',
|
|
||||||
author = 'stupidcomputer',
|
|
||||||
author_email = 'ryan@beepboop.systems',
|
|
||||||
url = 'https://git.beepboop.systems/stupidcomputer/dot_testing',
|
|
||||||
description = 'simple statusbar content program',
|
|
||||||
license = 'GPLv3',
|
|
||||||
entry_points = {
|
|
||||||
'console_scripts': [
|
|
||||||
'statusbar = statusbar.statusbar:main'
|
|
||||||
]
|
|
||||||
},
|
|
||||||
classifiers = (
|
|
||||||
"Programming Language :: Python :: 3",
|
|
||||||
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
|
|
||||||
"Operating System :: POSIX :: Linux",
|
|
||||||
"Environment :: Console"
|
|
||||||
),
|
|
||||||
zip_safe = False
|
|
||||||
)
|
|
1
builds/statusbar/statusbar/.gitignore
vendored
1
builds/statusbar/statusbar/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
__pycache__/
|
|
@ -1,215 +0,0 @@
|
|||||||
from multiprocessing import Process, Queue
|
|
||||||
from collections import defaultdict
|
|
||||||
from sys import argv, stdout
|
|
||||||
from math import floor
|
|
||||||
from socket import gethostname
|
|
||||||
import datetime
|
|
||||||
import signal
|
|
||||||
import subprocess
|
|
||||||
import re
|
|
||||||
|
|
||||||
import os, socket, time
|
|
||||||
|
|
||||||
def find_all_belonging_to_monitor(splitted, monitor):
|
|
||||||
splitted = [i[1:] if i[1:] == monitor else i for i in splitted]
|
|
||||||
our_monitor = splitted.index(monitor)
|
|
||||||
next_monitor = None
|
|
||||||
for i in range(our_monitor, len(splitted)):
|
|
||||||
if splitted[i][0].lower() == "m":
|
|
||||||
next_monitor = i
|
|
||||||
break
|
|
||||||
|
|
||||||
if not next_monitor:
|
|
||||||
next_monitor = len(splitted) - 1
|
|
||||||
|
|
||||||
return splitted[our_monitor:next_monitor]
|
|
||||||
|
|
||||||
def generate_desktop_string(monitor_array):
|
|
||||||
output = []
|
|
||||||
for i in monitor_array:
|
|
||||||
if i[0] == "O":
|
|
||||||
output.append("*{}".format(i[1:]))
|
|
||||||
|
|
||||||
if i[0] == "o":
|
|
||||||
output.append("{}".format(i[1:]))
|
|
||||||
|
|
||||||
if i[0] == "F":
|
|
||||||
output.append("*{}".format(i[1:]))
|
|
||||||
|
|
||||||
return ' '.join(output)
|
|
||||||
|
|
||||||
def filemodfactory(filename: str, modname: str):
|
|
||||||
def filemod(queue, _):
|
|
||||||
orig = 0
|
|
||||||
while True:
|
|
||||||
new = os.path.getmtime(filename)
|
|
||||||
if(new > orig):
|
|
||||||
with open(filename, 'r') as f:
|
|
||||||
queue.put({
|
|
||||||
"module": modname,
|
|
||||||
"data": f.read().rstrip()
|
|
||||||
})
|
|
||||||
orig = new
|
|
||||||
time.sleep(0.1)
|
|
||||||
|
|
||||||
return filemod
|
|
||||||
|
|
||||||
def new_mail(queue, _):
|
|
||||||
while True:
|
|
||||||
try:
|
|
||||||
dir_output = os.listdir("/home/usr/Mail/main/INBOX/new")
|
|
||||||
except FileNotFoundError: # we're on the phone, no mail here
|
|
||||||
return
|
|
||||||
dir_output = len(dir_output)
|
|
||||||
queue.put({
|
|
||||||
"module": "newmail",
|
|
||||||
"data": str(dir_output)
|
|
||||||
})
|
|
||||||
time.sleep(20)
|
|
||||||
|
|
||||||
def bspwm(queue, monitor):
|
|
||||||
client = socket.socket(
|
|
||||||
socket.AF_UNIX,
|
|
||||||
socket.SOCK_STREAM
|
|
||||||
)
|
|
||||||
try:
|
|
||||||
client.connect("/tmp/bspwm_1_0-socket")
|
|
||||||
except: # perhaps we're on the phone?
|
|
||||||
client.connect("/data/data/com.termux/files/usr/tmp/bspwm_1_0-socket")
|
|
||||||
|
|
||||||
message = "subscribe\0".encode()
|
|
||||||
client.send(message)
|
|
||||||
while True:
|
|
||||||
resp = client.recv(1024).decode().rstrip()
|
|
||||||
splitted = resp[1:].split(":")
|
|
||||||
if not monitor == "all":
|
|
||||||
monitor_array = find_all_belonging_to_monitor(splitted, monitor)
|
|
||||||
else:
|
|
||||||
monitor_array = splitted
|
|
||||||
queue.put({
|
|
||||||
"module": "bspwm",
|
|
||||||
"data": generate_desktop_string(monitor_array)
|
|
||||||
})
|
|
||||||
|
|
||||||
client.close()
|
|
||||||
|
|
||||||
def clock(queue, _):
|
|
||||||
while True:
|
|
||||||
queue.put({
|
|
||||||
"module": "clock",
|
|
||||||
"data": datetime.datetime.now().strftime("%d/%m | %H:%M")
|
|
||||||
})
|
|
||||||
|
|
||||||
time.sleep(60)
|
|
||||||
|
|
||||||
def filecheckerfactory(filename: str, modname: str, timeout=60):
|
|
||||||
def filechecker(queue, _):
|
|
||||||
while True:
|
|
||||||
try:
|
|
||||||
file = open(filename)
|
|
||||||
buf = file.read(128).rstrip()
|
|
||||||
queue.put({
|
|
||||||
"module": modname,
|
|
||||||
"data": buf
|
|
||||||
})
|
|
||||||
|
|
||||||
except FileNotFoundError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
time.sleep(timeout)
|
|
||||||
|
|
||||||
return filechecker
|
|
||||||
|
|
||||||
battery = filecheckerfactory("/sys/class/power_supply/BAT0/capacity", "bat")
|
|
||||||
batterystatus = filecheckerfactory("/sys/class/power_supply/BAT0/status", "batstat")
|
|
||||||
sxhkdmode = filemodfactory("/home/usr/.cache/statusbar/sxhkd_mode", "sxhkdmode")
|
|
||||||
|
|
||||||
def render(modules) -> str:
|
|
||||||
columns, _ = os.get_terminal_size(0)
|
|
||||||
|
|
||||||
left = "{} | {}({})".format(modules["clock"], modules["bspwm"], modules["sxhkdmode"])
|
|
||||||
right = "{} {}({})".format(modules["newmail"], modules["bat"], modules["batstat"])
|
|
||||||
padding = " " * (columns - len(left) - len(right) - 0)
|
|
||||||
|
|
||||||
output = left + padding + right
|
|
||||||
|
|
||||||
# special battery trickery
|
|
||||||
try:
|
|
||||||
batt_percentage = int(modules["bat"]) / 100
|
|
||||||
except ValueError:
|
|
||||||
batt_percentage = 1
|
|
||||||
|
|
||||||
highlighted = floor(columns * batt_percentage)
|
|
||||||
|
|
||||||
output = "\033[?25l\033[2J\033[H\033[4m" + \
|
|
||||||
output[:highlighted] + \
|
|
||||||
"\033[24m" + \
|
|
||||||
output[highlighted:]
|
|
||||||
|
|
||||||
print(output, end='')
|
|
||||||
stdout.flush()
|
|
||||||
|
|
||||||
def start_statusbars():
|
|
||||||
# is there an actually good xrandr library?
|
|
||||||
xrandr = subprocess.Popen(['xrandr'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
|
||||||
output = list(xrandr.stdout)
|
|
||||||
output = [i.decode("utf-8") for i in output if " connected" in i.decode("utf-8")]
|
|
||||||
serialized = []
|
|
||||||
for i in output:
|
|
||||||
splitted = i.split(' ')
|
|
||||||
print(splitted)
|
|
||||||
displayname = splitted[0]
|
|
||||||
geometry = splitted[2]
|
|
||||||
if geometry == "primary":
|
|
||||||
geometry = splitted[3]
|
|
||||||
|
|
||||||
try:
|
|
||||||
geometry_splitted = [int(i) for i in geometry.replace('x', '+').split('+')]
|
|
||||||
except ValueError:
|
|
||||||
continue
|
|
||||||
geometry_splitted[1] = 20
|
|
||||||
print(displayname, geometry_splitted)
|
|
||||||
os.system("st -c statusbar -p -g {}x{}+{}+{} -e statusbar {} & disown".format(
|
|
||||||
*map(str, geometry_splitted),
|
|
||||||
displayname
|
|
||||||
))
|
|
||||||
|
|
||||||
def main():
|
|
||||||
try:
|
|
||||||
os.mkdir("/home/usr/.cache/statusbar")
|
|
||||||
except FileExistsError:
|
|
||||||
pass
|
|
||||||
except FileNotFoundError:
|
|
||||||
# we're on the phone
|
|
||||||
try:
|
|
||||||
os.mkdir("/data/data/com.termux/files/home/.cache/statusbar")
|
|
||||||
except FileExistsError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
if argv[1] == "start_statusbars":
|
|
||||||
hostname = gethostname()
|
|
||||||
|
|
||||||
if not hostname == "localhost": # if we're not the phone
|
|
||||||
start_statusbars()
|
|
||||||
else:
|
|
||||||
# we are the phone
|
|
||||||
os.system("/data/data/com.termux/files/usr/bin/bash -c 'st -c statusbar -p -g {}x{}+{}+{} -e termux-statusbar-polyfill {} & disown'".format(
|
|
||||||
1920, 50, 0, 980,
|
|
||||||
"VNC-0"
|
|
||||||
))
|
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
queue = Queue()
|
|
||||||
modules = [bspwm, clock, battery, batterystatus, sxhkdmode, new_mail]
|
|
||||||
[Process(target=module, args=(queue, argv[1])).start() for module in modules]
|
|
||||||
|
|
||||||
module_outputs = defaultdict(lambda: "")
|
|
||||||
|
|
||||||
while True:
|
|
||||||
result = queue.get()
|
|
||||||
module_outputs[result["module"]] = result["data"]
|
|
||||||
render(module_outputs)
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
python3 ~/dot_testing/builds/statusbar/statusbar/statusbar.py $@
|
|
@ -1,44 +0,0 @@
|
|||||||
{ stdenv
|
|
||||||
, lib
|
|
||||||
# shell scripts stuff
|
|
||||||
, makeWrapper
|
|
||||||
, sshuttle
|
|
||||||
, scrcpy
|
|
||||||
, sxhkd
|
|
||||||
, bash
|
|
||||||
, feh
|
|
||||||
, jq
|
|
||||||
, fzy
|
|
||||||
, figlet
|
|
||||||
, curl
|
|
||||||
, ytfzf
|
|
||||||
, xrandr
|
|
||||||
, xrectsel
|
|
||||||
, ffcast
|
|
||||||
, svkbd
|
|
||||||
, xkbset
|
|
||||||
, rbw
|
|
||||||
, xclip
|
|
||||||
, x11vnc
|
|
||||||
, xmessage
|
|
||||||
, imagemagick
|
|
||||||
}:
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
pname = "utils";
|
|
||||||
version = "1.01";
|
|
||||||
|
|
||||||
src = ./utils;
|
|
||||||
|
|
||||||
nativeBuildInputs = [ makeWrapper ];
|
|
||||||
buildInputs = [ bash feh xrandr jq curl fzy ytfzf sshuttle svkbd scrcpy rbw xclip ffcast xkbset xmessage imagemagick x11vnc ];
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/bin
|
|
||||||
|
|
||||||
for i in $(ls $src/); do
|
|
||||||
cp $src/$i $out/bin
|
|
||||||
wrapProgram $out/bin/$i --prefix PATH : ${lib.makeBinPath [ sxhkd bash feh xrandr jq figlet curl fzy xkbset ytfzf sshuttle svkbd scrcpy xrectsel ffcast xmessage imagemagick x11vnc ]}
|
|
||||||
done
|
|
||||||
'';
|
|
||||||
}
|
|
@ -1,55 +0,0 @@
|
|||||||
# when there's an open anki window, and we're entering conjugations for verbs
|
|
||||||
# or whatever, it's nice to automatically advance the conjugation form.
|
|
||||||
|
|
||||||
# for instance, if your card key is:
|
|
||||||
# What is the yo form conjugation for ir in the imperfect?
|
|
||||||
# Your next one will naturally be
|
|
||||||
# What is the tú form conjugation for ir in the imperfect?
|
|
||||||
|
|
||||||
sleep 0.25
|
|
||||||
|
|
||||||
# firstly, get the card key text
|
|
||||||
xdotool sleep 0.2 key ctrl+a ctrl+c
|
|
||||||
|
|
||||||
sleep 0.25
|
|
||||||
|
|
||||||
# now the key is in our clipboard
|
|
||||||
text=$(xclip -out -selection clipboard)
|
|
||||||
form=$(echo "$text" | sed '
|
|
||||||
s/.*\( yo \).*/\1/;
|
|
||||||
s/.*\( tú \).*/\1/;
|
|
||||||
s/.*\( él\/ella\/usted \).*/\1/;
|
|
||||||
s/.*\( nosotros \).*/\1/;
|
|
||||||
s/.*\( vosotros \).*/\1/;
|
|
||||||
s/.*\( ustedes \).*/\1/
|
|
||||||
')
|
|
||||||
|
|
||||||
case "$form" in
|
|
||||||
" yo ")
|
|
||||||
next="tú"
|
|
||||||
;;
|
|
||||||
" tú ")
|
|
||||||
next="él/ella/usted"
|
|
||||||
;;
|
|
||||||
" él/ella/usted ")
|
|
||||||
next="nosotros"
|
|
||||||
;;
|
|
||||||
" nosotros ")
|
|
||||||
next="vosotros"
|
|
||||||
;;
|
|
||||||
" vosotros ")
|
|
||||||
next="ustedes"
|
|
||||||
;;
|
|
||||||
" ustedes ")
|
|
||||||
next="yo"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
printf "text: %s\n" "$text"
|
|
||||||
printf "form: %s\n" "$form"
|
|
||||||
printf "next: %s\n" "$next"
|
|
||||||
|
|
||||||
new_text=$(echo "$text" | sed "s|$form| $next |g")
|
|
||||||
|
|
||||||
echo -n "$new_text" | xclip -in -selection clipboard
|
|
||||||
xdotool key ctrl+a ctrl+v
|
|
@ -1,30 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
"start")
|
|
||||||
printf "[] starting paperless\n"
|
|
||||||
systemctl start redis-paperless paperless-scheduler
|
|
||||||
;;
|
|
||||||
"stop")
|
|
||||||
printf "[] stopping paperless\n"
|
|
||||||
systemctl stop paperless-web paperless-task-queue paperless-scheduler paperless-consumer redis-paperless
|
|
||||||
;;
|
|
||||||
"query")
|
|
||||||
exit $([ $(systemctl | grep -c paperless) -gt 0 ])
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
cat <<EOF
|
|
||||||
paperless -- start and stop the paperless web service easily
|
|
||||||
|
|
||||||
paperless start
|
|
||||||
start the paperless systemd services if they haven't already
|
|
||||||
been started
|
|
||||||
|
|
||||||
paperless stop
|
|
||||||
stop the paperless systemd services
|
|
||||||
|
|
||||||
paperless query
|
|
||||||
return 0 if paperless is running, 1 if not
|
|
||||||
EOF
|
|
||||||
;;
|
|
||||||
esac
|
|
@ -1,164 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# try to load the sleep builtin dynamically, because otherwise there's
|
|
||||||
# a *lot* of overhead (in terms of PID count)
|
|
||||||
if [[ $(</proc/cmdline) = *"nixos-system"* ]]; then
|
|
||||||
enable -f /run/current-system/sw/lib/bash/sleep sleep
|
|
||||||
else
|
|
||||||
enable -f /lib/bash/sleep sleep
|
|
||||||
fi
|
|
||||||
|
|
||||||
get_schedule_info () {
|
|
||||||
if [ -z "$schedule_state" ]; then
|
|
||||||
schedule_state="needs_init"
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$schedule_state" in
|
|
||||||
"needs_init")
|
|
||||||
readarray -t lines < <(
|
|
||||||
khal list today 1d --format '{categories}|{title}|{start-time}|{end-time}' |
|
|
||||||
grep '^school.*' |
|
|
||||||
sed 's/school|//g'
|
|
||||||
)
|
|
||||||
|
|
||||||
# calculate the start-of-date time without shelling out to the date utility
|
|
||||||
printf -v unix '%(%s)T'
|
|
||||||
printf -v hours '%(%H)T'
|
|
||||||
printf -v mins '%(%M)T'
|
|
||||||
printf -v seconds '%(%S)T'
|
|
||||||
hours=$((10#$hours))
|
|
||||||
mins=$((10#$mins))
|
|
||||||
seconds=$((10#$seconds))
|
|
||||||
today_offset=$((hours * 60 * 60 + mins * 60 + seconds))
|
|
||||||
today=$((unix - today_offset))
|
|
||||||
|
|
||||||
for ((i=0; i < ${#lines[@]}; i++)); do
|
|
||||||
readarray -t -d'|' line <<<"${lines[i]}"
|
|
||||||
class_names+=("${line[0]}")
|
|
||||||
starts=${line[1]}
|
|
||||||
ends=${line[2]}
|
|
||||||
|
|
||||||
# convert to unix time
|
|
||||||
class_starts_hours=${starts%%:*}
|
|
||||||
class_starts_hours=$((10#$class_starts_hours))
|
|
||||||
class_starts_hours=$((class_starts_hours * 3600))
|
|
||||||
class_starts_minutes=${starts##*:}
|
|
||||||
class_starts_minutes=$((10#$class_starts_minutes))
|
|
||||||
class_starts_minutes=$((class_starts_minutes * 60))
|
|
||||||
class_starts_offset=$((class_starts_hours + class_starts_minutes))
|
|
||||||
class_starts_final=$((today + class_starts_offset))
|
|
||||||
|
|
||||||
class_ends_hours=${ends%%:*}
|
|
||||||
class_ends_hours=$((10#$class_ends_hours))
|
|
||||||
class_ends_hours=$((class_ends_hours * 3600))
|
|
||||||
class_ends_minutes=${ends##*:}
|
|
||||||
class_ends_minutes=$((10#$class_ends_minutes))
|
|
||||||
class_ends_minutes=$((class_ends_minutes * 60))
|
|
||||||
class_ends_offset=$((class_ends_hours + class_ends_minutes))
|
|
||||||
class_ends_final=$((today + class_ends_offset))
|
|
||||||
|
|
||||||
class_starts+=("$class_starts_final")
|
|
||||||
class_ends+=("$class_ends_final")
|
|
||||||
done
|
|
||||||
|
|
||||||
schedule_state="needs_recalc"
|
|
||||||
;;
|
|
||||||
"needs_recalc")
|
|
||||||
schedule_enabled="no"
|
|
||||||
printf -v ctime '%(%s)T' -1
|
|
||||||
for ((i=0; i < ${#class_names[@]}; i++)); do
|
|
||||||
if [ $ctime -lt ${class_starts[$i]} ] && [ $ctime -gt ${class_ends[$(($i - 1))]} ]; then
|
|
||||||
class_secs_left=$((${class_starts[$i]} - $ctime))
|
|
||||||
current_class_until_event="$class_secs_left"
|
|
||||||
current_class_name="${class_names[$i]}"
|
|
||||||
current_class_status="waiting"
|
|
||||||
schedule_enabled="yes"
|
|
||||||
elif [ $ctime -gt ${class_starts[$i]} ] && [ $ctime -lt ${class_ends[$i]} ]; then
|
|
||||||
class_secs_left=$((${class_ends[$i]} - $ctime))
|
|
||||||
current_class_until_event="$class_secs_left"
|
|
||||||
current_class_name="${class_names[$i]}"
|
|
||||||
current_class_status="inside"
|
|
||||||
schedule_enabled="yes"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ "$schedule_enabled" = "no" ]; then
|
|
||||||
current_class_status="finished"
|
|
||||||
fi
|
|
||||||
|
|
||||||
schedule_state="needs_dec"
|
|
||||||
;;
|
|
||||||
"needs_dec")
|
|
||||||
if [ "$current_class_status" = "inside" ]; then
|
|
||||||
if [ "$((current_class_until_event / 60))" -le 5 ]; then
|
|
||||||
printf -v schedule_status "%02d:%02d left in %s/" "$((current_class_until_event / 60))" "$((current_class_until_event % 60))" "$current_class_name"
|
|
||||||
else
|
|
||||||
printf -v schedule_status "%s minutes left in %s/" "$((current_class_until_event / 60))" "$current_class_name"
|
|
||||||
fi
|
|
||||||
elif [ "$current_class_status" = "outside" ]; then
|
|
||||||
if [ "$((current_class_until_event / 60))" -le 5 ]; then
|
|
||||||
printf -v schedule_status "%02d:%02d until %s/" "$((current_class_until_event / 60))" "$((current_class_until_event % 60))" "$current_class_name"
|
|
||||||
else
|
|
||||||
printf -v schedule_status "%s minutes until %s/" "$((current_class_until_event / 60))" "$current_class_name"
|
|
||||||
fi
|
|
||||||
elif [ "$current_class_status" = "finished" ]; then
|
|
||||||
printf -v schedule_status ""
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
current_class_until_event=$((current_class_until_event - 1))
|
|
||||||
if [ "$current_class_until_event" -eq 0 ]; then
|
|
||||||
schedule_state="needs_recalc"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
get_loadavg_info () {
|
|
||||||
loadavg_status="$(</proc/loadavg)/"
|
|
||||||
}
|
|
||||||
|
|
||||||
get_cmus_info () {
|
|
||||||
if [ /dev/shm/status/cmus -nt /dev/shm/status/modified ]; then
|
|
||||||
cmus_status="$(</dev/shm/status/cmus)/"
|
|
||||||
touch /dev/shm/status/modified
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
get_days_until_21 () {
|
|
||||||
if [ -z "$birthday" ]; then
|
|
||||||
birthday=$(cat ~/.config/birthdate)
|
|
||||||
twenty_one=$((birthday + (21 * 365 * 24 * 60 * 60)))
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf -v now "%(%s)T"
|
|
||||||
|
|
||||||
days_until_21_status=$(((twenty_one - now) / 24 / 60 / 60))
|
|
||||||
days_until_21_status="$days_until_21_status/"
|
|
||||||
}
|
|
||||||
|
|
||||||
get_battery_info () {
|
|
||||||
battery_status=$(</sys/class/power_supply/BAT0/capacity)
|
|
||||||
}
|
|
||||||
|
|
||||||
get_time_info () {
|
|
||||||
printf -v date_status '%(%d(%a)-%m(%b)-%y)T %(%H)T:%(%M)T:%(%S)T/' -1
|
|
||||||
}
|
|
||||||
|
|
||||||
while true; do
|
|
||||||
# use /dev/shm to minimize the amount of i/o on disk
|
|
||||||
if [ ! -d /dev/shm/status ]; then
|
|
||||||
mkdir -p /dev/shm/status
|
|
||||||
touch /dev/shm/status/modified
|
|
||||||
fi
|
|
||||||
|
|
||||||
get_time_info
|
|
||||||
get_loadavg_info
|
|
||||||
get_days_until_21
|
|
||||||
get_battery_info
|
|
||||||
get_cmus_info
|
|
||||||
get_schedule_info
|
|
||||||
|
|
||||||
printf "%s%s%s%s%s%s\n" "$schedule_status" "$cmus_status" "$loadavg_status" "$days_until_21_status" "$date_status" "$battery_status"
|
|
||||||
sleep 1
|
|
||||||
done | dwm-setstatus
|
|
@ -1,48 +0,0 @@
|
|||||||
# splash screen for bspwm on copernicus
|
|
||||||
|
|
||||||
set -x
|
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
|
||||||
st -g 78x11+0+0 -c st-gpg-menu -e bspwm-copernicus-welcome inner & disown
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
"helptext")
|
|
||||||
cat | less <<EOF
|
|
||||||
welcome to x11, usr!
|
|
||||||
this is copernicus, the tower computer.
|
|
||||||
|
|
||||||
if you're a new user of this system, open a terminal (win+enter) and run \`man
|
|
||||||
stupidsystem\` for more information. if you don't know what man pages are, try
|
|
||||||
\`man man-intro\` first so you're not lost.
|
|
||||||
|
|
||||||
this window will close automatically when scrcpy and x11vnc connections are
|
|
||||||
established to phone and aristotle, respectively. to close this window now,
|
|
||||||
press win+q.
|
|
||||||
EOF
|
|
||||||
exit
|
|
||||||
;;
|
|
||||||
"run-scrcpy")
|
|
||||||
while true; do
|
|
||||||
if ! pkill -c scrcpy; then
|
|
||||||
nohup scrcpy -Sw --window-title="phonercon" > /dev/null &
|
|
||||||
sleep 1
|
|
||||||
num_jobs=$(jobs | wc -l)
|
|
||||||
if [ $num_jobs -gt 0 ]; then
|
|
||||||
# scrcpy started successfully
|
|
||||||
disown %-
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
exit
|
|
||||||
;;
|
|
||||||
"inner")
|
|
||||||
tmux \
|
|
||||||
new-session "bspwm-copernicus-welcome run-scrcpy" \; \
|
|
||||||
split-window "bspwm-copernicus-welcome run-x11vnc" \; \
|
|
||||||
new-window "bspwm-copernicus-welcome helptext" \; \
|
|
||||||
set -g status off
|
|
||||||
;;
|
|
||||||
esac
|
|
@ -1,28 +0,0 @@
|
|||||||
PADDING=50
|
|
||||||
|
|
||||||
eval $(
|
|
||||||
xdotool getwindowgeometry --shell $(
|
|
||||||
xdotool getactivewindow
|
|
||||||
) | \
|
|
||||||
xargs printf "export %s\n"
|
|
||||||
)
|
|
||||||
|
|
||||||
eval $(
|
|
||||||
xdotool getmouselocation --shell | \
|
|
||||||
xargs printf "export MOUSE%s\n"
|
|
||||||
)
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
"top")
|
|
||||||
xdotool mousemove $MOUSEX $(($Y + $PADDING))
|
|
||||||
;;
|
|
||||||
"bottom")
|
|
||||||
xdotool mousemove $MOUSEX $(($Y + $HEIGHT - $PADDING))
|
|
||||||
;;
|
|
||||||
"left")
|
|
||||||
xdotool mousemove $(($X + $PADDING)) $MOUSEY
|
|
||||||
;;
|
|
||||||
"right")
|
|
||||||
xdotool mousemove $(($X + $WIDTH - $PADDING)) $MOUSEY
|
|
||||||
;;
|
|
||||||
esac
|
|
@ -1,39 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
display=$(xrandr \
|
|
||||||
| grep ' connected' \
|
|
||||||
| awk -F ' ' '{print $1}' \
|
|
||||||
| sed '1i select rectangle' \
|
|
||||||
| fzy)
|
|
||||||
|
|
||||||
case "$display" in
|
|
||||||
"select"*)
|
|
||||||
geom=$(xrectsel)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
geom=$(xrandr \
|
|
||||||
| grep "$display" \
|
|
||||||
| awk -F ' ' '{print $3 " " $4}' \
|
|
||||||
| sed 's/primary //g' \
|
|
||||||
| awk -F ' ' '{print $1}' \
|
|
||||||
| grep '[[:digit:]]'
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
printf "[] selected geometry is %s\n" "$geom"
|
|
||||||
|
|
||||||
medium=$(
|
|
||||||
printf ".mp4\n.png\n" | fzy
|
|
||||||
)
|
|
||||||
|
|
||||||
printf "[] capturing in medium %s\n" "$medium"
|
|
||||||
|
|
||||||
case "$medium" in
|
|
||||||
*"mp4"*)
|
|
||||||
ffcast -g $geom rec $HOME/output.mp4
|
|
||||||
;;
|
|
||||||
*"png"*)
|
|
||||||
ffcast -g $geom png
|
|
||||||
;;
|
|
||||||
esac
|
|
@ -1,34 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# see original at
|
|
||||||
# https://github.com/cmus/cmus/blob/master/cmus-status-display
|
|
||||||
|
|
||||||
output()
|
|
||||||
{
|
|
||||||
printf "%s" "$*" > /dev/shm/status/cmus 2>&1
|
|
||||||
}
|
|
||||||
|
|
||||||
while test $# -ge 2
|
|
||||||
do
|
|
||||||
eval _$1='$2'
|
|
||||||
shift
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
|
|
||||||
if test "$_status" = "playing"; then _status=">"; else _status="="; fi
|
|
||||||
if test -n "$_file"
|
|
||||||
then
|
|
||||||
h=$(($_duration / 3600))
|
|
||||||
m=$(($_duration % 3600))
|
|
||||||
|
|
||||||
duration=""
|
|
||||||
test $h -gt 0 && dur="$h:"
|
|
||||||
duration="$dur$(printf '%02d:%02d' $(($m / 60)) $(($m % 60)))"
|
|
||||||
|
|
||||||
output "${_status}$_artist($_album)-$_title"
|
|
||||||
elif test -n "$_url"
|
|
||||||
then
|
|
||||||
output "${_status}$_url-$_title"
|
|
||||||
else
|
|
||||||
output "${_status}"
|
|
||||||
fi
|
|
@ -1,20 +0,0 @@
|
|||||||
# insert special characters universally in xorg
|
|
||||||
|
|
||||||
(
|
|
||||||
dmenu <<DONE
|
|
||||||
í i-acute
|
|
||||||
Í I-acute
|
|
||||||
ó o-acute
|
|
||||||
Ó O-acute
|
|
||||||
á a-acute
|
|
||||||
Á a-acute
|
|
||||||
é e-acute
|
|
||||||
É e-acute
|
|
||||||
ú u-acute
|
|
||||||
Ú U-acute
|
|
||||||
ñ n-tilde
|
|
||||||
Ñ N-tilde
|
|
||||||
DONE
|
|
||||||
) | awk -F' ' '{print $1}' \
|
|
||||||
| tr -d '\n' \
|
|
||||||
| xclip -in -selection clipboard
|
|
@ -1,64 +0,0 @@
|
|||||||
# fm-mass-rename
|
|
||||||
# rename files programmatically or systematically with the help of
|
|
||||||
# $EDITOR
|
|
||||||
|
|
||||||
# ls isn't safe, but if filenames contain newlines we have bigger
|
|
||||||
# problems
|
|
||||||
originals=$(mktemp)
|
|
||||||
ls > "$originals"
|
|
||||||
|
|
||||||
modified=$(mktemp)
|
|
||||||
cat > "$modified" <<EOF
|
|
||||||
# generated by fm-mass-rename
|
|
||||||
# edit the filenames using your text editor -- make sure that
|
|
||||||
# the number of files remain the same
|
|
||||||
#
|
|
||||||
# of course, if you have files with newlines in their names or
|
|
||||||
# files with hashes in front stuff will break, so be careful
|
|
||||||
#
|
|
||||||
# to abort, just delete some lines and save and quit
|
|
||||||
#
|
|
||||||
# good luck!
|
|
||||||
EOF
|
|
||||||
cat < "$originals" >> "$modified"
|
|
||||||
|
|
||||||
${EDITOR:-nvim} "$modified"
|
|
||||||
|
|
||||||
# remove comments from $modified
|
|
||||||
sed -i /^#/d "$modified"
|
|
||||||
|
|
||||||
# check if both are the same length -- if not, something's wrong
|
|
||||||
original_len=$(wc -l $originals | cut -d' ' -f1)
|
|
||||||
modified_len=$(wc -l $modified | cut -d' ' -f1)
|
|
||||||
|
|
||||||
if [ "$original_len" -ne "$modified_len" ]; then
|
|
||||||
cat <<EOF
|
|
||||||
It seems that you've omitted or deleted some lines -- this is
|
|
||||||
unsafe and so I'm stopping. Make sure you don't delete any lines
|
|
||||||
and try again.
|
|
||||||
EOF
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
combined=$(paste "$originals" "$modified" -d'|')
|
|
||||||
|
|
||||||
paste "$originals" "$modified" -d'|' | while read input; do
|
|
||||||
orig="${input%%|*}"
|
|
||||||
dest="${input#*|}"
|
|
||||||
[ "$orig" = "$dest" ] && continue
|
|
||||||
if [ -f "$dest" ]; then
|
|
||||||
printf "clobber destination file '%s' with contents of '%s'? (y/n)\n" "$dest" "$orig"
|
|
||||||
|
|
||||||
read result
|
|
||||||
if [ x"$result" = "xy" ]; then
|
|
||||||
printf "clobbering '%s'\n" "$dest"
|
|
||||||
mv "$orig" "$dest"
|
|
||||||
continue
|
|
||||||
else
|
|
||||||
printf "skipping copying '%s' to '%s'\n" "$orig" "$dest"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf "moving '%s' to '%s'\n" "$orig" "$dest"
|
|
||||||
mv "$orig" "$dest"
|
|
||||||
done
|
|
@ -1,52 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
print_help() {
|
|
||||||
echo "
|
|
||||||
khal-template -- a tool for automatically making calendar templates
|
|
||||||
and events on certain days
|
|
||||||
|
|
||||||
usage: khal-template <template_name> [template_time]
|
|
||||||
|
|
||||||
to add the regular schedule for today:
|
|
||||||
$ khal-template regular
|
|
||||||
|
|
||||||
to add the regular schedule for tomorrow:
|
|
||||||
$ khal-template regular tomorrow
|
|
||||||
|
|
||||||
templates:
|
|
||||||
- regular -- regular schedule
|
|
||||||
- late -- late start schedule
|
|
||||||
"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
"regular")
|
|
||||||
khal new -g school -a home $2 07:40 08:27 AP Computer Science
|
|
||||||
khal new -g school -a home $2 08:34 09:19 Chemistry I H
|
|
||||||
khal new -g school -a home $2 09:29 10:14 AP Precalculus
|
|
||||||
khal new -g school -a home $2 10:21 11:06 AP European History
|
|
||||||
khal new -g school -a home $2 11:06 11:08 Flex Check time
|
|
||||||
khal new -g school -a home $2 11:15 12:05 Wind Ensemble H
|
|
||||||
khal new -g school -a home $2 12:12 12:37 SAIL
|
|
||||||
khal new -g school -a home $2 12:37 13:02 Lunch
|
|
||||||
khal new -g school -a home $2 13:09 13:54 English II H
|
|
||||||
khal new -g school -a home $2 14:01 14:47 Spanish III H
|
|
||||||
;;
|
|
||||||
"late")
|
|
||||||
khal new -g school -a home $2 08:25 09:08 AP Computer Science
|
|
||||||
khal new -g school -a home $2 09:15 09:56 Chemistry I H
|
|
||||||
khal new -g school -a home $2 10:06 10:47 AP Precalculus
|
|
||||||
khal new -g school -a home $2 10:54 11:33 AP European History
|
|
||||||
khal new -g school -a home $2 11:33 11:35 Flex Check time
|
|
||||||
khal new -g school -a home $2 11:41 12:22 Wind Ensemble H
|
|
||||||
khal new -g school -a home $2 12:29 13:10 Lunch
|
|
||||||
khal new -g school -a home $2 13:17 13:58 English II H
|
|
||||||
khal new -g school -a home $2 14:05 14:47 Spanish III H
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
print_help
|
|
||||||
;;
|
|
||||||
"help")
|
|
||||||
print_help
|
|
||||||
;;
|
|
||||||
esac
|
|
@ -1,8 +0,0 @@
|
|||||||
if [ "$(hostname)" = "localhost" ]; then
|
|
||||||
mbsync --config=$HOME/.config/isync/phone-config
|
|
||||||
else
|
|
||||||
mbsync --config=$HOME/.config/isync/config main
|
|
||||||
fi
|
|
||||||
|
|
||||||
vdirsyncer sync
|
|
||||||
rbw sync
|
|
@ -1,11 +0,0 @@
|
|||||||
# wrapper around rbw
|
|
||||||
|
|
||||||
if [ "$HOSTNAME" != "aristotle" ]; then
|
|
||||||
rbw-x11-prompt
|
|
||||||
fi
|
|
||||||
|
|
||||||
resp=$(rbw list | dmenu)
|
|
||||||
|
|
||||||
rbw get "$resp" | xclip -selection clipboard
|
|
||||||
sleep 15
|
|
||||||
echo "cleared" | xclip -selection clipboard
|
|
@ -1,20 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
[ -z "$1" ] && exit 1
|
|
||||||
|
|
||||||
# wrap rbw get $1 --full to output in the git credential helper
|
|
||||||
# format
|
|
||||||
|
|
||||||
if [ "$HOSTNAME" != "aristotle" ]; then
|
|
||||||
rbw-x11-prompt
|
|
||||||
fi
|
|
||||||
|
|
||||||
# username=yourusername
|
|
||||||
# password=yourpassword
|
|
||||||
|
|
||||||
output=$(rbw get $1 --full)
|
|
||||||
echo "$output" | \
|
|
||||||
sed '1{s/^/password=/}' | \
|
|
||||||
sed 's/Username: /username=/g' | \
|
|
||||||
grep -E 'username|password' | \
|
|
||||||
tac
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user