Compare commits

...

17 commits

Author SHA1 Message Date
Geoffrey Frogeye ee178b7d57
nix: Make nix the root
Which means now I'll have to think about real prefixes in commit names.
2023-11-26 23:58:22 +01:00
Geoffrey Frogeye 550eed06e0
nix: Various fixes frobar, autorandr and automatrop 2023-11-26 23:47:15 +01:00
Geoffrey Frogeye 24dd21368f
nix: Integrate root-level files 2023-11-26 22:45:07 +01:00
Geoffrey Frogeye 1f61ceb395
nix: Migrate scripts
They're a bit slower to start :(.
Hopefully this is something that flakes will help with,
otherwise I'll find another way.
2023-11-26 21:04:58 +01:00
Geoffrey Frogeye 33945f865f Merge remote-tracking branch 'origin/master' into nix 2023-11-23 22:59:32 +01:00
Geoffrey Frogeye ca4c74e236
python scripts: isort & black pass 2023-11-23 22:59:09 +01:00
Geoffrey Frogeye 5c274bbfe9
nix: Fix typos 2023-11-23 22:54:20 +01:00
Geoffrey Frogeye 80b92cfab3
Merge remote-tracking branch 'origin/master' into nix 2023-11-23 22:54:11 +01:00
Geoffrey Frogeye 58b4fbcdf0 Merge remote-tracking branch 'origin/master' 2023-11-23 22:41:45 +01:00
Geoffrey Frogeye 65d1594ec9
bsh: Duplicate source files and optimize
A step back... but hopefully so we can take a step forward?
2023-11-23 22:39:33 +01:00
Geoffrey Frogeye dcb8e62df2
Suspend even though other "people" are connected
Other "people" being me in disguise, sooo
2023-11-23 20:38:17 +01:00
Geoffrey Frogeye 86f225ea67
nix: Remove ability to build pindakaas SD image
The idea to create an image burnable on a SD card that is already
configured is a nice one, however I encountered many issues:

- Used something that was designed to be an installer:
    - Cannot change from unencrypted ext4 partition (AFAICS)
    - Comes with installer tools (i.e. tools for various filesystems),
      which creates conflicts
- Takes a lot of space and time to build, had to put /tmp on a non-tmpfs
- Has to extend the filesystem manually afterwards
- I think it rebuilt the full system on nixos-rebuilt anyways. Maybe
  because I used binfmt compilation? Could also be because installer has
  some overlays.

Since I had nix on Manjaro already, I surely could have built the
system directly on the SD card from there. Maybe that's what I will do
to test the partitionning/boot scheme setup actually.
2023-11-23 13:42:52 +01:00
Geoffrey Frogeye 55f2304223
nix: Various fixes
So that explains why quick-scope didn't work so far... but not why it
built without it.
2023-11-23 13:36:03 +01:00
Geoffrey Frogeye 42954e7214
nix: Move unfree allowing into os config
Might need the same for HM config?
2023-11-23 13:21:29 +01:00
Geoffrey Frogeye 63b5e9c252
nix: Fix wireless config 2023-11-23 13:20:44 +01:00
Geoffrey Frogeye dc6af1cb63 Merge remote-tracking branch 'origin' 2023-11-17 19:58:09 +01:00
Geoffrey Frogeye 6046cb2df7
Add git difftool: meld 2023-11-17 19:56:56 +01:00
222 changed files with 726 additions and 1951 deletions

3
.gitignore vendored
View file

@ -1 +1,2 @@
__pycache__ *.qcow2
result

View file

@ -10,7 +10,6 @@ then
exec nix-shell -p nix-output-monitor --run $0 exec nix-shell -p nix-output-monitor --run $0
fi fi
export NIXPKGS_ALLOW_UNFREE=1
if [ "$(uname -m)" == "x86_64" ] if [ "$(uname -m)" == "x86_64" ]
then then
config=./curacao.nix config=./curacao.nix

@ -1 +0,0 @@
Subproject commit 592c6d9841674211f904cf9ea2a951fca3fd5a80

@ -1 +0,0 @@
Subproject commit 435f8e6aea0ba9be482c4409db380868a23fea9c

View file

@ -1,26 +0,0 @@
---
- name: Ensure directories for applications are present
ansible.builtin.file:
state: directory
path: "{{ ansible_user_dir }}/{{ item }}"
mode: u=rwx,g=rx,o=rx
with_items:
- .cache/zsh
- .cache/mpd
- .ssh
- .local/bin
- .ansible/collections/ansible_collections/geoffreyfrogeye
- name: Install dotfiles repository
ansible.builtin.git:
repo: "{% if has_forge_access %}git@git.frogeye.fr:{% else %}https://git.frogeye.fr/{% endif %}geoffrey/dotfiles.git"
dest: "{{ ansible_user_dir }}/.dotfiles"
update: true
notify: install dotfiles
tags: dotfiles_repo
# TODO Put actual dotfiles in a subdirectory of the repo, so we don't have to put everything in config
- name: Install python dependencies for scripts
ansible.builtin.pip:
requirements: "{{ ansible_user_dir }}/.dotfiles/config/scripts/requirements.txt"
extra_args: --break-system-packages # It's fine, it's local anyways

View file

@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://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.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View file

@ -1,126 +0,0 @@
# Ansible AUR helper
Ansible module to use some Arch User Repository (AUR) helpers as well as makepkg.
The following helpers are supported and automatically selected, if present, in the order listed below:
- [yay](https://github.com/Jguer/yay)
- [paru](https://github.com/Morganamilo/paru)
- [pacaur](https://github.com/E5ten/pacaur)
- [trizen](https://github.com/trizen/trizen)
- [pikaur](https://github.com/actionless/pikaur)
- [aurman](https://github.com/polygamma/aurman) (discontinued)
*makepkg* will be used if no helper was found or if it is explicitly specified:
- [makepkg](https://wiki.archlinux.org/index.php/makepkg)
## Options
|Parameter |Choices/**Default** |Comments|
|--- |--- |---|
|name | |Name or list of names of the package(s) to install or upgrade.|
|state |**present**, latest |Desired state of the package, 'present' skips operations if the package is already installed.|
|upgrade |yes, **no** |Whether or not to upgrade whole system.|
|use |**auto**, yay, paru, pacaur, trizen, pikaur, aurman, makepkg |The tool to use, 'auto' uses the first known helper found and makepkg as a fallback.|
|extra_args |**null** |A list of additional arguments to pass directly to the tool. Cannot be used in 'auto' mode.|
|aur_only |yes, **no** |Limit helper operation to the AUR.|
|local_pkgbuild |Local directory with PKGBUILD, **null** |Only valid with makepkg or pikaur. Don't download the package from AUR. Build the package using a local PKGBUILD and the other build files.|
|skip_pgp_check |yes, **no** |Only valid with makepkg. Skip PGP signatures verification of source file, useful when installing packages without GnuPG properly configured.|
|ignore_arch |yes, **no** |Only valid with makepkg. Ignore a missing or incomplete arch field, useful when the PKGBUILD does not have the arch=('yourarch') field.|
### Note
* Either *name* or *upgrade* is required, both cannot be used together.
* In the *use*=*auto* mode, makepkg is used as a fallback if no known helper is found.
## Installing
### AUR package
The [ansible-aur-git](https://aur.archlinux.org/packages/ansible-aur-git) package is available in the AUR.
Note: The module is installed in `/usr/share/ansible/plugins/modules` which is one of the default module library paths.
### Manual installation
Just clone the *ansible-aur* repository into your user custom-module directory:
```
git clone https://github.com/kewlfft/ansible-aur.git ~/.ansible/plugins/modules/aur
```
### Ansible Galaxy
*ansible-aur* is available in Galaxy which is a hub for sharing Ansible content. To download it, use:
```
ansible-galaxy install kewlfft.aur
```
Note: If this module is installed from Ansible Galaxy, you will need to list it explicitly in your playbook:
```
# playbook.yml
- hosts: localhost
roles:
- kewlfft.aur
tasks:
- aur: name=package_name
```
or in your role:
```
# meta/main.yml
dependencies:
- kewlfft.aur
```
```
# tasks/main.yml
- aur: name=package_name
```
## Usage
### Notes
* The scope of this module is installation and update from the AUR; for package removal or for updates from the repositories, it is recommended to use the official *pacman* module.
* The *--needed* parameter of the helper is systematically used, it means if a package is up-to-date, it is not built and reinstalled.
### Create the "aur_builder" user
While Ansible expects to SSH as root, makepkg or AUR helpers do not allow executing operations as root, they fail with "you cannot perform this operation as root". It is therefore recommended to create a user, which is non-root but has no need for password with pacman in sudoers, let's call it *aur_builder*.
This user can be created in an Ansible task with the following actions:
```
- user:
name: aur_builder
create_home: no
group: wheel
- lineinfile:
path: /etc/sudoers.d/11-install-aur_builder
line: 'aur_builder ALL=(ALL) NOPASSWD: /usr/bin/pacman'
create: yes
validate: 'visudo -cf %s'
```
### Examples
Use it in a task, as in the following examples:
```
# Install trizen using makepkg, skip if it is already installed
- aur: name=trizen use=makepkg state=present
become: yes
become_user: aur_builder
# Install package_name using the first known helper found
- aur: name=package_name
become: yes
become_user: aur_builder
# Install package_name_1 and package_name_2 using yay
- aur:
use: yay
name:
- package_name_1
- package_name_2
# Upgrade the system using yay, only act on AUR packages.
# Note: Dependency resolving will still include repository packages.
- aur: upgrade=yes use=yay aur_only=yes
# Install gnome-shell-extension-caffeine-git using pikaur and a local PKGBUILD.
# Skip if it is already installed
- aur:
name: gnome-shell-extension-caffeine-git
use: pikaur
local_pkgbuild: {{ role_path }}/files/gnome-shell-extension-caffeine-git
state: present
become: yes
become_user: aur_builder
```

View file

@ -1,397 +0,0 @@
#!/usr/bin/python
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import open_url
import json
import shlex
import tarfile
import os
import os.path
import shutil
import tempfile
import urllib.parse
DOCUMENTATION = '''
---
module: aur
short_description: Manage packages from the AUR
description:
- Manage packages from the Arch User Repository (AUR)
author:
- Kewl <xrjy@nygb.rh.bet(rot13)>
options:
name:
description:
- Name or list of names of the package(s) to install or upgrade.
state:
description:
- Desired state of the package.
default: present
choices: [ present, latest ]
upgrade:
description:
- Whether or not to upgrade whole system.
default: no
type: bool
use:
description:
- The tool to use, 'auto' uses the first known helper found and makepkg as a fallback.
default: auto
choices: [ auto, yay, paru, pacaur, trizen, pikaur, aurman, makepkg ]
extra_args:
description:
- Arguments to pass to the tool.
Requires that the 'use' option be set to something other than 'auto'.
type: str
skip_pgp_check:
description:
- Only valid with makepkg.
Skip PGP signatures verification of source file.
This is useful when installing packages without GnuPG (properly) configured.
Cannot be used unless use is set to 'makepkg'.
type: bool
default: no
ignore_arch:
description:
- Only valid with makepkg.
Ignore a missing or incomplete arch field, useful when the PKGBUILD does not have the arch=('yourarch') field.
Cannot be used unless use is set to 'makepkg'.
type: bool
default: no
aur_only:
description:
- Limit helper operation to the AUR.
type: bool
default: no
local_pkgbuild:
description:
- Only valid with makepkg or pikaur.
Directory with PKGBUILD and build files.
Cannot be used unless use is set to 'makepkg' or 'pikaur'.
type: path
default: no
notes:
- When used with a `loop:` each package will be processed individually,
it is much more efficient to pass the list directly to the `name` option.
'''
RETURN = '''
msg:
description: action that has been taken
helper:
the helper that was actually used
'''
EXAMPLES = '''
- name: Install trizen using makepkg, skip if trizen is already installed
aur: name=trizen use=makepkg state=present
become: yes
become_user: aur_builder
'''
def_lang = ['env', 'LC_ALL=C']
use_cmd = {
'yay': ['yay', '-S', '--noconfirm', '--needed', '--cleanafter'],
'paru': ['paru', '-S', '--noconfirm', '--needed', '--cleanafter'],
'pacaur': ['pacaur', '-S', '--noconfirm', '--noedit', '--needed'],
'trizen': ['trizen', '-S', '--noconfirm', '--noedit', '--needed'],
'pikaur': ['pikaur', '-S', '--noconfirm', '--noedit', '--needed'],
'aurman': ['aurman', '-S', '--noconfirm', '--noedit', '--needed', '--skip_news', '--pgp_fetch', '--skip_new_locations'],
'makepkg': ['makepkg', '--syncdeps', '--install', '--noconfirm', '--needed']
}
use_cmd_local_pkgbuild = {
'pikaur': ['pikaur', '-P', '--noconfirm', '--noedit', '--needed', '--install'],
'makepkg': ['makepkg', '--syncdeps', '--install', '--noconfirm', '--needed']
}
has_aur_option = ['yay', 'paru', 'pacaur', 'trizen', 'pikaur', 'aurman']
def package_installed(module, package):
"""
Determine if the package is already installed
"""
rc, _, _ = module.run_command(['pacman', '-Q', package], check_rc=False)
return rc == 0
def check_packages(module, packages):
"""
Inform the user what would change if the module were run
"""
would_be_changed = []
diff = {
'before': '',
'after': '',
}
for package in packages:
installed = package_installed(module, package)
if not installed:
would_be_changed.append(package)
if module._diff:
diff['after'] += package + "\n"
if would_be_changed:
status = True
if len(packages) > 1:
message = '{} package(s) would be installed'.format(len(would_be_changed))
else:
message = 'package would be installed'
else:
status = False
if len(packages) > 1:
message = 'all packages are already installed'
else:
message = 'package is already installed'
module.exit_json(changed=status, msg=message, diff=diff)
def build_command_prefix(use, extra_args, skip_pgp_check=False, ignore_arch=False, aur_only=False, local_pkgbuild=None):
"""
Create the prefix of a command that can be used by the install and upgrade functions.
"""
if local_pkgbuild:
command = def_lang + use_cmd_local_pkgbuild[use]
else:
command = def_lang + use_cmd[use]
if skip_pgp_check:
command.append('--skippgpcheck')
if ignore_arch:
command.append('--ignorearch')
if aur_only and use in has_aur_option:
command.append('--aur')
if local_pkgbuild and use != 'makepkg':
command.append(local_pkgbuild)
if extra_args:
command += shlex.split(extra_args)
return command
def install_with_makepkg(module, package, extra_args, skip_pgp_check, ignore_arch, local_pkgbuild=None):
"""
Install the specified package or a local PKGBUILD with makepkg
"""
if not local_pkgbuild:
module.get_bin_path('fakeroot', required=True)
f = open_url('https://aur.archlinux.org/rpc/?v=5&type=info&arg={}'.format(urllib.parse.quote(package)))
result = json.loads(f.read().decode('utf8'))
if result['resultcount'] != 1:
return (1, '', 'package {} not found'.format(package))
result = result['results'][0]
f = open_url('https://aur.archlinux.org/{}'.format(result['URLPath']))
with tempfile.TemporaryDirectory() as tmpdir:
if local_pkgbuild:
shutil.copytree(local_pkgbuild, tmpdir, dirs_exist_ok=True)
command = build_command_prefix('makepkg', extra_args)
rc, out, err = module.run_command(command, cwd=tmpdir, check_rc=True)
else:
tar = tarfile.open(mode='r|*', fileobj=f)
tar.extractall(tmpdir)
tar.close()
command = build_command_prefix('makepkg', extra_args, skip_pgp_check=skip_pgp_check, ignore_arch=ignore_arch)
rc, out, err = module.run_command(command, cwd=os.path.join(tmpdir, result['Name']), check_rc=True)
return (rc, out, err)
def install_local_package(module, package, use, extra_args, local_pkgbuild):
"""
Install the specified package with a local PKGBUILD
"""
with tempfile.TemporaryDirectory() as tmpdir:
shutil.copytree(local_pkgbuild, tmpdir, dirs_exist_ok=True)
command = build_command_prefix(use, extra_args, local_pkgbuild=tmpdir + '/PKGBUILD')
rc, out, err = module.run_command(command, check_rc=True)
return (rc, out, err)
def check_upgrade(module, use):
"""
Inform user how many packages would be upgraded
"""
rc, stdout, stderr = module.run_command([use, '-Qu'], check_rc=True)
data = stdout.split('\n')
data.remove('')
module.exit_json(
changed=len(data) > 0,
msg="{} package(s) would be upgraded".format(len(data)),
helper=use,
)
def upgrade(module, use, extra_args, aur_only):
"""
Upgrade the whole system
"""
assert use in use_cmd
command = build_command_prefix(use, extra_args, aur_only=aur_only)
command.append('-u')
rc, out, err = module.run_command(command, check_rc=True)
module.exit_json(
changed=not (out == '' or 'nothing to do' in out or 'No AUR updates found' in out),
msg='upgraded system',
helper=use,
)
def install_packages(module, packages, use, extra_args, state, skip_pgp_check, ignore_arch, aur_only, local_pkgbuild):
"""
Install the specified packages
"""
if local_pkgbuild:
assert use in use_cmd_local_pkgbuild
else:
assert use in use_cmd
changed_iter = False
for package in packages:
if state == 'present':
if package_installed(module, package):
rc = 0
continue
if use == 'makepkg':
rc, out, err = install_with_makepkg(module, package, extra_args, skip_pgp_check, ignore_arch, local_pkgbuild)
elif local_pkgbuild:
rc, out, err = install_local_package(module, package, use, extra_args, local_pkgbuild)
else:
command = build_command_prefix(use, extra_args, aur_only=aur_only)
command.append(package)
rc, out, err = module.run_command(command, check_rc=True)
changed_iter = changed_iter or not (out == '' or '-- skipping' in out or 'nothing to do' in out)
message = 'installed package(s)' if changed_iter else 'package(s) already installed'
module.exit_json(
changed=changed_iter,
msg=message if not rc else err,
helper=use,
rc=rc,
)
def make_module():
module = AnsibleModule(
argument_spec={
'name': {
'type': 'list',
},
'state': {
'default': 'present',
'choices': ['present', 'latest'],
},
'upgrade': {
'type': 'bool',
},
'use': {
'default': 'auto',
'choices': ['auto'] + list(use_cmd.keys()),
},
'extra_args': {
'default': None,
'type': 'str',
},
'skip_pgp_check': {
'default': False,
'type': 'bool',
},
'ignore_arch': {
'default': False,
'type': 'bool',
},
'aur_only': {
'default': False,
'type': 'bool',
},
'local_pkgbuild': {
'default': None,
'type': 'path',
},
},
mutually_exclusive=[['name', 'upgrade']],
required_one_of=[['name', 'upgrade']],
supports_check_mode=True
)
params = module.params
use = params['use']
if params['name'] == []:
module.fail_json(msg="'name' cannot be empty.")
if use == 'auto':
if params['extra_args'] is not None:
module.fail_json(msg="'extra_args' cannot be used with 'auto', a tool must be specified.")
use = 'makepkg'
# auto: select the first helper for which the bin is found
for k in use_cmd:
if module.get_bin_path(k):
use = k
break
if use != 'makepkg' and (params['skip_pgp_check'] or params['ignore_arch']):
module.fail_json(msg="This option is only available with 'makepkg'.")
if not (use in use_cmd_local_pkgbuild) and params['local_pkgbuild']:
module.fail_json(msg="This option is not available with '%s'" % use)
if params['local_pkgbuild'] and not os.path.isdir(params['local_pkgbuild']):
module.fail_json(msg="Directory %s not found" % (params['local_pkgbuild']))
if params['local_pkgbuild'] and not os.access(params['local_pkgbuild'] + '/PKGBUILD', os.R_OK):
module.fail_json(msg="PKGBUILD inside %s not readable" % (params['local_pkgbuild']))
if params.get('upgrade', False) and use == 'makepkg':
module.fail_json(msg="The 'upgrade' action cannot be used with 'makepkg'.")
return module, use
def apply_module(module, use):
params = module.params
if params.get('upgrade', False):
if module.check_mode:
check_upgrade(module, use)
else:
upgrade(module, use, params['extra_args'], params['aur_only'])
else:
if module.check_mode:
check_packages(module, params['name'])
else:
install_packages(module,
params['name'],
use,
params['extra_args'],
params['state'],
params['skip_pgp_check'],
params['ignore_arch'],
params['aur_only'],
params['local_pkgbuild'])
def main():
module, use = make_module()
apply_module(module, use)
if __name__ == '__main__':
main()

View file

@ -1,2 +0,0 @@
install_date: Sun Feb 21 21:18:27 2021
version: master

View file

@ -1,17 +0,0 @@
galaxy_info:
author: kewlfft
role_name: aur
description: Ansible module to use some Arch User Repository (AUR) helpers as well as makepkg.
license: GPL-3.0-or-later
min_ansible_version: 2.0
# https://galaxy.ansible.com/api/v1/platforms/
platforms:
- name: ArchLinux
versions:
- any
galaxy_tags:
- aur
dependencies: []

@ -1 +0,0 @@
Subproject commit a977bb298fb9e1c057e0b2587dbd4d047e13f5bd

View file

@ -1,2 +0,0 @@
*.qcow2
result

View file

@ -1,23 +0,0 @@
#/usr/bin/env sh
# Build a disk image for testing on pindakaas via sd card
if ! command -v nom-build
then
exec nix-shell -p nix-output-monitor --run $0
fi
export NIXPKGS_ALLOW_UNFREE=1
extra=""
if [ "$(uname -m)" != "aarch64" ]
then
if [ ! -f /proc/sys/fs/binfmt_misc/qemu-aarch64 ]
then
echo "Use binfmt QEMU!"
echo "https://nixos.wiki/wiki/NixOS_on_ARM#Compiling_through_binfmt_QEMU"
exit 1
fi
extra="--argstr system aarch64-linux"
fi
nom-build '<nixpkgs/nixos>' -A config.system.build.sdImage \
-I nixos-config=./pindakaas.nix $extra --show-trace

View file

@ -1,21 +0,0 @@
#!/usr/bin/env bash
set -e
if [ $USER != root ]
then
echo "This script should be run as root."
exit 1
fi
if ! pacman -Qq pacman-mirrorlist &> /dev/null
then
pacman -S pacman-mirrorlist
fi
if [ ! -f /etc/pacman.d/mirrorlist.pacnew ]
then
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.pacnew
fi
egrep -o 'Server = .+' /etc/pacman.d/mirrorlist.pacnew | /usr/bin/rankmirrors -n 6 - > /etc/pacman.d/mirrorlist

View file

@ -1,10 +0,0 @@
#!/usr/bin/env bash
cd ~/.dotfiles/config/automatrop
if [ -f ~/.config/automatrop/self_name ]
then
hostname=$(cat ~/.config/automatrop/self_name)
else
hostname="$HOSTNAME"
fi
ansible-playbook --diff playbooks/default.yml --limit $hostname --connection local "$@"

View file

@ -1,3 +0,0 @@
#!/usr/bin/env sh
play -n synth sine E5 sine A4 remix 1-2 fade 0.5 1.2 0.5 2> /dev/null
# echo 

View file

@ -1,62 +0,0 @@
#!/usr/bin/env bash
# TODO Do not dupplicate trimmed.bash
CACHE_DIR="${XDG_CACHE_DIR:-$HOME/.cache}/bsh"
FOLDER_NAME="geoffrey"
mkdir -p "$CACHE_DIR"
if [ ! -f "${CACHE_DIR}/cmd" ]
then
# Preparation
WORK="${CACHE_DIR}/${FOLDER_NAME}"
DEST="/tmp/${FOLDER_NAME}"
rm -rf "$WORK" # DEBUG
mkdir "$WORK"
# Copying files
grep -o '^[^#]*' ~/.config/shell/trimmed.bash > "${WORK}/.bashrc"
grep -o '^[^#]*' ~/.config/inputrc > "${WORK}/.inputrc"
# grep -o '^[^"]*' ~/.config/vim/vimconfig.vim > "${WORK}/.vimrc"
# TODO Above file doesn't work anymore with automatrop
#mkdir -p "${WORK}/terminfo/${TERM:0:1}"
#if [ -f "/usr/share/terminfo/${TERM:0:1}/${TERM}" ]
#then
# cp "/usr/share/terminfo/${TERM:0:1}/${TERM}" "${WORK}/terminfo/${TERM:0:1}/${TERM}"
#elif [ -f "$HOME/.config/terminfo/${TERM:0:1}/${TERM}" ]
#then
# cp "$HOME/.config/terminfo/${TERM:0:1}/${TERM}" "${WORK}/terminfo/${TERM:0:1}/${TERM}"
#fi
# Extra configuration
echo "alias s='sudo -s -E bash --rcfile ${DEST}/.bashrc'" >> "${WORK}/.bashrc"
echo "export VIMINIT='source ${DEST}/.vimrc'" >> "${WORK}/.bashrc"
#echo "export TERMINFO=${DEST}/terminfo" >> "${WORK}/.bashrc"
echo "export INPUTRC=${DEST}/.inputrc" >> "${WORK}/.bashrc"
# TODO Maybe we should just set HOME there…
# Crafting command
b64="$(cd "$CACHE_DIR"; tar czf - "$FOLDER_NAME" | base64 -w 0)"
echo "echo '$b64' | base64 -d | tar xzf - -C /tmp" > "${CACHE_DIR}/cmd"
echo "bash --rcfile ${DEST}/.bashrc" >> "${CACHE_DIR}/cmd"
echo "rm -rf ${DEST}" >> "${CACHE_DIR}/cmd"
# TODO Do not remove unless last one connected
# Cleanup
# rm -rf "$WORK"
fi
# To keep until https://github.com/openssh/openssh-portable/commit/f64f8c00d158acc1359b8a096835849b23aa2e86
# is merged
function _ssh {
if [ "${TERM}" = "alacritty" ]
then
TERM=xterm-256color ssh "$@"
else
ssh "$@"
fi
}
alias ssh='_ssh'
_ssh -t "$@" "$(cat "${CACHE_DIR}/cmd")"

View file

@ -1,190 +0,0 @@
#!/usr/bin/env bash
# Handles dotfiles
# Yes there are tons of similar scipts yet I wanted no more nor less than what I needed
# Config
if [ -z "$DOTHOME" ]; then
DOTHOME="$HOME"
fi
if [ -z "$DOTREPO" ]; then
DOTREPO="$HOME/.dotfiles"
fi
# Common functions
# From http://stackoverflow.com/a/12498485
function relativePath {
# both $1 and $2 are absolute paths beginning with /
# returns relative path to $2/$target from $1/$source
source=$1
target=$2
common_part=$source # for now
result="" # for now
while [[ "${target#$common_part}" == "${target}" ]]; do
# no match, means that candidate common part is not correct
# go up one level (reduce common part)
common_part="$(dirname $common_part)"
# and record that we went back, with correct / handling
if [[ -z $result ]]; then
result=".."
else
result="../$result"
fi
done
if [[ $common_part == "/" ]]; then
# special case for root (no common path)
result="$result/"
fi
# since we now have identified the common part,
# compute the non-common part
forward_part="${target#$common_part}"
# and now stick all parts together
if [[ -n $result ]] && [[ -n $forward_part ]]; then
result="$result$forward_part"
elif [[ -n $forward_part ]]; then
# extra slash removal
# result="${forward_part:1}" # Removes the . in the beginning...
result="${forward_part#/}"
fi
echo "$result"
}
# Script common functions
function _dotfiles-install-dir { # dir
local dir
local absSource
local absTarget
local relTarget
dir="${1%/}"
dir="${dir#/}"
ls -A "$DOTREPO/$dir" | while read file; do
if [[ -z "$dir" && $(echo $file | grep '^\(\.\|LICENSE\|README\)') ]]; then
continue
fi
if [[ $(echo $file | grep '^.dfrecur$') ]]; then
continue
fi
if [ -z "$dir" ]; then
absSource="$DOTHOME/.$file"
absTarget="$DOTREPO/$file"
else
absSource="$DOTHOME/.$dir/$file"
absTarget="$DOTREPO/$dir/$file"
fi
relTarget="$(relativePath "$DOTHOME/$dir" "$absTarget")"
recurIndicator="$absTarget/.dfrecur"
if [[ -h "$absTarget" ]]; then
if [ -e "$absSource" ]; then
if [ -h "$absSource" ]; then
cmd="cp --no-dereference --force $absTarget $absSource"
if [ $DRY_RUN ]; then
echo $cmd
else
yes | $cmd
fi
else
echo "[ERROR] $absSource already exists, but is not a link"
fi
else
cmd="cp --no-dereference --force $absTarget $absSource"
if [ $DRY_RUN ]; then
echo $cmd
else
yes | $cmd
fi
fi
elif [[ -f "$absTarget" || ( -d $absTarget && ! -f $recurIndicator ) ]]; then
if [ -e "$absSource" ]; then
if [ -h "$absSource" ]; then
cmd="ln --symbolic --no-dereference --force $relTarget $absSource"
if [ $DRY_RUN ]; then
echo $cmd
else
$cmd
fi
else
echo "[ERROR] $absSource already exists, but is not a symbolic link"
fi
else
cmd="ln --symbolic --no-dereference $relTarget $absSource"
if [ $DRY_RUN ]; then
echo $cmd
else
$cmd
fi
fi
elif [[ -d "$absTarget" && -f $recurIndicator ]]; then
if [ -e "$absSource" ]; then
if [ -d "$absSource" ]; then
# echo "Directory $absSource already exists"
_dotfiles-install-dir $dir/$file
else
echo "[ERROR] $absSource already exists, but is not a directory"
fi
else
cmd="mkdir $absSource"
if [ $DRY_RUN ]; then
echo $cmd
else
$cmd
fi
_dotfiles-install-dir $dir/$file
fi
else
echo "[WARNING] Skipped $absTarget"
fi
done
}
# Script functions
function dotfiles_install {
_dotfiles-install-dir /
}
function dotfiles_help {
command="$1"
if [ -n "$command" ]; then
if type "dotfiles_${command}_help" &> /dev/null; then
shift
"dotfiles_${command}_help" "$@"
return $?
fi
fi
echo "Usage: $0 COMMAND"
echo
echo "Commands:"
echo " install Install dotfiles from repository"
echo " help Get help with commands"
echo
echo "Environment variables:"
echo " DOTHOME Where to install dotfiles"
echo " DOTREPO Where do the dotfiles comes from"
return 0
}
# MAIN
command="$1"
shift
if type "dotfiles_$command" &> /dev/null; then
"dotfiles_$command" "$@"
else
dotfiles_help
fi

View file

@ -1,13 +0,0 @@
#!/usr/bin/env bash
# Clears everything it can to save space
rm -rf $HOME/.cache
if which pacman &> /dev/null; then
sudo pacman -Scc
elif which apt-get &> /deb/null; then
sudo apt-get clean
fi
if which journalctl &> /dev/null; then
sudo journalctl --vacuum-size=100M
fi

View file

@ -1,10 +0,0 @@
#!/usr/bin/env bash
# Return a list of packages sorted by size
(echo PACKAGE SIZE; \
for A in /var/lib/pacman/local/*/desc; do
(sed -n 2p $A; (grep '^%SIZE%$' $A -A1 | tail -1)) | tr '\n' ' '; echo
done \
| sort -nrk2) \
| column -t

View file

@ -1,2 +0,0 @@
#!/usr/bin/env bash
find -type f -printf '%T+ %p\n' | sort | tail "$@"

View file

@ -1,3 +0,0 @@
#!/usr/bin/env bash
play -c 2 -n synth ${1}noise

View file

@ -1,2 +0,0 @@
#!/usr/bin/env bash
find -type f -printf '%T+ %p\n' | sort | head "$@"

View file

@ -1,61 +0,0 @@
#!/usr/bin/env python3
import os
import ovh
import xdg.BaseDirectory
import urllib.request
from pprint import pprint
import json
import logging
import coloredlogs
import argparse
coloredlogs.install(level="DEBUG", fmt="%(levelname)s %(message)s")
log = logging.getLogger()
debug = None
class OvhCli:
ROOT = "https://api.ovh.com/1.0?null"
def __init__(self):
self.cacheDir = os.path.join(xdg.BaseDirectory.xdg_cache_home, "ovhcli")
# TODO Corner cases: links, cache dir not done, configurable cache
if not os.path.isdir(self.cacheDir):
assert not os.path.exists(self.cacheDir)
os.makedirs(self.cacheDir)
def updateCache(self):
log.info("Downloading the API description")
rootJsonPath = os.path.join(self.cacheDir, "root.json")
log.debug(f"{self.ROOT} -> {rootJsonPath}")
urllib.request.urlretrieve(self.ROOT, rootJsonPath)
with open(rootJsonPath, "rt") as rootJson:
root = json.load(rootJson)
basePath = root["basePath"]
for apiRoot in root["apis"]:
fmt = "json"
assert fmt in apiRoot["format"]
path = apiRoot["path"]
schema = apiRoot["schema"].format(format=fmt, path=path)
apiJsonPath = os.path.join(self.cacheDir, schema[1:])
apiJsonUrl = basePath + schema
log.debug(f"{apiJsonUrl} -> {apiJsonPath}")
apiJsonPathDir = os.path.dirname(apiJsonPath)
if not os.path.isdir(apiJsonPathDir):
os.makedirs(apiJsonPathDir)
urllib.request.urlretrieve(apiJsonUrl, apiJsonPath)
def createParser(self):
parser = argparse.ArgumentParser(description="Access the OVH API")
return parser
if __name__ == "__main__":
cli = OvhCli()
# cli.updateCache()
parser = cli.createParser()
args = parser.parse_args()
print(args)

View file

@ -1,9 +0,0 @@
#!/usr/bin/env bash
# Generate strong enough password(s)
# This generates a password with ln((26*2+10)**32)/ln(2) ≅ 190 bits of entropy,
# which is a bit above the recommended standars (128 bits) while still having
# a 0 probability that the service will break because of incompatible character
pwgen 32 -y

View file

@ -1,7 +0,0 @@
coloredlogs>=10.0<11
progressbar2>=3.47.0<4
yt-dlp>=2021.10.22
ConfigArgParse>=1.5<2
asyncinotify
ffmpeg
r128gain

View file

@ -1,2 +0,0 @@
#!/usr/bin/env bash
find . -name "*.sync-conflict-*" -delete

View file

@ -1,47 +0,0 @@
#!/usr/bin/env bash
# Rename a list of files with a sed pattern
usage() {
echo "Usage: $0 PATTERN [-d] < filelist"
echo
echo "Arguments:"
echo " PATTERN Sed pattern to apply"
echo
echo "Options:"
echo " -d Dry run"
exit 1
}
if [[ -z "$1" ]]; then
usage
fi
pattern="$1"
dry=1
if [[ -n "$2" ]]; then
if [[ "$2" = '-d' ]]; then
dry=0
else
usage
fi
fi
while read src
do
dst="$(echo "$src" | sed "$pattern")"
if [[ $? != 0 ]]; then
echo "ERREUR Invalid sed pattern"
exit 2
fi
if [[ $dry == 0 ]]; then
echo "$src" → "$dst"
else
mv -- "$src" "$dst"
fi
done

View file

@ -1,2 +0,0 @@
#!/usr/bin/env sh
strace -f -t -e trace=file $@

View file

@ -1,20 +0,0 @@
#!/usr/bin/env sh
if [ $# -eq 0 ]
then
echo -e "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
return 1
fi
tmpfile=$( mktemp -t transferXXX )
if tty -s
then
basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g')
curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile
else
curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile
fi
cat $tmpfile
rm -f $tmpfile

View file

@ -1,18 +0,0 @@
#!/usr/bin/env python3
# Compresses video using FFMPEG using
# FFMPEG's reasonable default settings
import os
import sys
import subprocess
files = sys.argv[1:]
remove = False
if "-r" in files:
files.remove("-r")
remove = True
for f in files:
print(os.path.splitext(f))

View file

View file

@ -1,79 +0,0 @@
#!/usr/bin/env bash
# Geoffrey's trimmed and condensed shell configuration file,
# with an healthy and safe dose of aliases and config.
# Can be embedded to any server
# Prefered programs environment variables
export PAGER=less
if [ -x "$(command -v nvim)" ]
then
export EDITOR=nvim
alias vi=nvim
elif [ -x "$(command -v vim)" ]
then
export EDITOR=vim
alias vi=vim
else
export EDITOR=vi
fi
# Completion for existing commands
alias ls='ls -h --color=auto'
alias mkdir='mkdir -v'
alias cp="cp -i"
alias mv="mv -iv"
alias free='free -h'
alias df='df -h'
# Advanced completions
# (not busybox compatible)
alias cp="cp -i --reflink=auto"
alias grep="grep --color=auto"
alias dd='dd status=progress'
alias rm='rm -v --one-file-system'
alias free='free -m'
alias diff='diff --color=auto'
alias dmesg='dmesg --ctime'
# Frequent mistakes
alias sl=ls
alias al=la
alias mdkir=mkdir
alias systemclt=systemctl
alias please=sudo
# Shortcuts for commonly used commands
alias ll="ls -l"
alias la="ls -la"
alias s='sudo -s -E'
# Bash options
shopt -s expand_aliases
shopt -s histappend
HISTCONTROL=ignoreboth:erasedups
# Program configuration
export TIME_STYLE='+%Y-%m-%d %H:%M:%S'
export LESS=-R
export LESS_TERMCAP_mb=$'\E[1;31m' # begin blink
export LESS_TERMCAP_md=$'\E[1;36m' # begin bold
export LESS_TERMCAP_me=$'\E[0m' # reset bold/blink
export LESS_TERMCAP_so=$'\E[01;44;33m' # begin reverse video
export LESS_TERMCAP_se=$'\E[0m' # reset reverse video
export LESS_TERMCAP_us=$'\E[1;32m' # begin underline
export LESS_TERMCAP_ue=$'\E[0m' # reset underline
# from $(dircolors --sh)
LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:';
export LS_COLORS
# Prompt
if [[ $USER == 'root' ]]; then
col=31;
elif [[ $USER == 'geoffrey' ]]; then
col=32;
else
col=33;
fi
export PS1="\[\e]2;\u@\H \w\a\]\[\e[0;37m\][\[\e[0;${col}m\]\u\[\e[0;37m\]@\[\e[0;34m\]\h \[\e[0;36m\]\W\[\e[0;37m\]]\$\[\e[0m\] "

View file

@ -10,9 +10,9 @@
frogeye.extra = true; frogeye.extra = true;
frogeye.desktop.xorg = true; frogeye.desktop.xorg = true;
frogeye.desktop.nixGLIntel = true; frogeye.desktop.nixGLIntel = true;
frogeye.dev.ansible.enable = true; frogeye.dev.ansible = true;
frogeye.dev.c.enable = true; frogeye.dev.c = true;
frogeye.dev.docker.enable = true; frogeye.dev.docker = true;
frogeye.dev.fpga.enable = true; frogeye.dev.fpga = true;
frogeye.dev.python.enable = true; frogeye.dev.python = true;
} }

BIN
face

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

View file

@ -16,7 +16,6 @@ let
YARN_CACHE_FOLDER = "${config.xdg.cacheHome}/yarn"; YARN_CACHE_FOLDER = "${config.xdg.cacheHome}/yarn";
# TODO Some of that stuff is not really relavant any more # TODO Some of that stuff is not really relavant any more
}; };
dotfilesPath = "$HOME/.dotfiles"; # FIXME I think we want it in ~/.config/dotfiles, also, should be an option
in in
{ {
@ -133,6 +132,18 @@ in
diff = "diff --color=auto"; diff = "diff --color=auto";
dmesg = "dmesg --ctime"; dmesg = "dmesg --ctime";
wget = "wget --hsts-file ${config.xdg.cacheHome}/wget-hsts"; wget = "wget --hsts-file ${config.xdg.cacheHome}/wget-hsts";
# Imported from scripts
rms = ''${pkgs.findutils}/bin/find . -name "*.sync-conflict-*" -delete''; # Remove syncthing conflict files
pw = ''${pkgs.pwgen}/bin/pwgen 32 -y''; # Generate passwords. ln((26*2+10)**32)/ln(2) ≅ 190 bits of entropy
newestFile = ''${pkgs.findutils}/bin/find -type f -printf '%T+ %p\n' | sort | tail'';
oldestFile = ''${pkgs.findutils}/bin/find -type f -printf '%T+ %p\n' | sort | head'';
tracefiles = ''${pkgs.strace}/bin/strace -f -t -e trace=file'';
} // lib.optionalAttrs config.frogeye.desktop.xorg {
noise = ''${pkgs.sox}/bin/play -c 2 -n synth $'' + ''{1}noise'';
beep = ''${pkgs.sox}/bin/play -n synth sine E5 sine A4 remix 1-2 fade 0.5 1.2 0.5 2> /dev/null'';
# FIXME ALSA lib dlmisc.c:337:(snd_dlobj_cache_get0) Cannot open shared library libasound_module_pcm_pulse.so (/nix/store/9b06fxbvm07iy9f9dvi5vk2iy9pk8hyz-alsa-lib-1.2.8/lib/alsa-lib/libasound_module_pcm_pulse.so: cannot open shared object file: No such file or directory)
} // lib.attrsets.mergeAttrsList (map (p: { "${p}" = "HOME=${config.xdg.cacheHome}/junkhome ${p}"; }) treatsHomeAsJunk); } // lib.attrsets.mergeAttrsList (map (p: { "${p}" = "HOME=${config.xdg.cacheHome}/junkhome ${p}"; }) treatsHomeAsJunk);
# TODO Maybe make nixpkg wrapper instead? So it also works from dmenu # TODO Maybe make nixpkg wrapper instead? So it also works from dmenu
# Could also accept my fate... Home-manager doesn't necessarily make it easy to put things out of the home directory # Could also accept my fate... Home-manager doesn't necessarily make it easy to put things out of the home directory
@ -278,6 +289,11 @@ in
pull = { pull = {
ff = "only"; ff = "only";
}; };
} // lib.optionalAttrs config.frogeye.desktop.xorg {
diff.tool = "meld";
difftool.prompt = false;
"difftool \"meld\"".cmd = "${pkgs.meld}/bin/meld \"$LOCAL\" \"$REMOTE\"";
# This escapes quotes, which isn't the case in the original, hoping this isn't an issue.
}; };
# TODO Delta syntax highlighter... and other cool-looking options? # TODO Delta syntax highlighter... and other cool-looking options?
}; };
@ -381,7 +397,7 @@ in
stateVersion = "23.05"; stateVersion = "23.05";
language = { language = {
base = "en_US.UTF-8"; base = "en_US.UTF-8";
time = "en_DK.UTF-8"; # time = "en_DK.UTF-8"; # FIXME Disabled because complaints during nixos-rebuild switch
}; };
packages = with pkgs; [ packages = with pkgs; [
# dotfiles dependencies # dotfiles dependencies
@ -394,6 +410,7 @@ in
wget wget
curl curl
python3Packages.pip python3Packages.pip
rename
# shell # shell
zsh-completions zsh-completions
@ -420,9 +437,6 @@ in
ncdu ncdu
jdupes jdupes
duperemove duperemove
optipng
libjpeg
# FIXME reflac not available (but also a dumb shell script)
# local monitoring # local monitoring
htop htop
@ -456,6 +470,8 @@ in
todoman todoman
syncthing syncthing
# TODO Lots of redundancy with other way things are defined here
]; ];
sessionVariables = { sessionVariables = {
# Favourite commands # Favourite commands
@ -485,9 +501,14 @@ in
} // direnv; } // direnv;
# TODO Session variables only get reloaded on login I think. # TODO Session variables only get reloaded on login I think.
sessionPath = [ sessionPath = [
"$HOME/.local/bin" "${config.home.homeDirectory}/.local/bin"
"${config.home.sessionVariables.GOPATH}" "${config.home.sessionVariables.GOPATH}"
"${dotfilesPath}/config/scripts" "${config.frogeye.dotfiles.path}/scripts"
]; ];
file = {
".face" = {
source = pkgs.runCommand "face.png" { } "${pkgs.inkscape}/bin/inkscape ${./face.svg} -w 1024 -o $out";
};
};
}; };
} }

View file

@ -57,7 +57,7 @@
{ {
modifier = "Mod1"; # FIXME Mod1 for VM, Mod4 for not VM modifier = "Mod1"; # FIXME Mod1 for VM, Mod4 for not VM
terminal = "alacritty"; terminal = "alacritty";
# bars = []; # FIXME lemonbar bars = []; # Using frobar
colors = let ignore = "#ff00ff"; in colors = let ignore = "#ff00ff"; in
with config.lib.stylix.colors.withHashtag; lib.mkForce { with config.lib.stylix.colors.withHashtag; lib.mkForce {
focused = { border = base0B; background = base0B; text = base00; indicator = base00; childBorder = base0B; }; focused = { border = base0B; background = base0B; text = base00; indicator = base00; childBorder = base0B; };
@ -229,7 +229,7 @@
"${mode_system}" = { "${mode_system}" = {
"l" = "exec --no-startup-id exec ${locker}, mode default"; "l" = "exec --no-startup-id exec ${locker}, mode default";
"e" = "exit, mode default"; "e" = "exit, mode default";
"s" = "exec --no-startup-id exec ${locker} & ${pkgs.systemd}/bin/systemctl suspend, mode default"; "s" = "exec --no-startup-id exec ${locker} & ${pkgs.systemd}/bin/systemctl suspend --check-inhibitors=no, mode default";
"h" = "exec --no-startup-id exec ${locker} & ${pkgs.systemd}/bin/systemctl hibernate, mode default"; "h" = "exec --no-startup-id exec ${locker} & ${pkgs.systemd}/bin/systemctl hibernate, mode default";
"r" = "exec --no-startup-id ${pkgs.systemd}/bin/systemctl reboot, mode default"; "r" = "exec --no-startup-id ${pkgs.systemd}/bin/systemctl reboot, mode default";
"p" = "exec --no-startup-id ${pkgs.systemd}/bin/systemctl poweroff -i, mode default"; "p" = "exec --no-startup-id ${pkgs.systemd}/bin/systemctl poweroff -i, mode default";
@ -453,7 +453,17 @@
matching = "regex"; matching = "regex";
}; };
}; };
autorandr.enable = true; autorandr = {
enable = true;
hooks.postswitch =
let
frobar = (pkgs.callPackage (import ./frobar) { });
in
{
"background" = "${pkgs.feh}/bin/feh --no-fehbg --bg-fill ${config.stylix.image}";
"frobar" = "${pkgs.i3}/bin/i3-msg exec ${frobar}/bin/frobar_launcher";
};
};
mpv = { mpv = {
enable = true; enable = true;
config = { config = {
@ -524,6 +534,18 @@
action = clipboard action = clipboard
''; '';
}; };
"vimpc/vimpcrc" = {
text = ''
map FF :browse<C-M>gg/
map à :set add next<C-M>a:set add end<C-M>
map @ :set add next<C-M>a:set add end<C-M>:next<C-M>
map ° D:browse<C-M>A:shuffle<C-M>:play<C-M>:playlist<C-M>
set songformat {%a - %b: %t}|{%f}$E$R $H[$H%l$H]$H
set libraryformat %n \| {%t}|{%f}$E$R $H[$H%l$H]$H
set ignorecase
set sort library
'';
};
}; };
}; };
services = { services = {
@ -605,7 +627,6 @@
twemoji-color-font twemoji-color-font
gnome.gedit gnome.gedit
feh feh
zathura
zbar zbar
zathura zathura
meld meld
@ -621,7 +642,6 @@
xorg.xinit xorg.xinit
xorg.xbacklight xorg.xbacklight
# TODO Make this clean. Service? # TODO Make this clean. Service?
(callPackage (import ./frobar) { }) # FIXME Call it where needed
# organisation # organisation

192
hm/face.svg Normal file
View file

@ -0,0 +1,192 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
version="1.1"
id="svg2"
xml:space="preserve"
width="500"
height="500"
viewBox="0 0 500 500.00002"
enable-background="new"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata
id="metadata8"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
id="defs6"><linearGradient
id="Gradient_1"
gradientUnits="userSpaceOnUse"
x1="559.79999"
y1="0.0125"
x2="559.79999"
y2="834.88751"
spreadMethod="pad"><stop
offset="0%"
stop-color="#CCE474"
id="stop2" /><stop
offset="21.96078431372549%"
stop-color="#CBE372"
id="stop4-3" /><stop
offset="29.80392156862745%"
stop-color="#C8E26B"
id="stop6-6" /><stop
offset="35.68627450980392%"
stop-color="#C3DE60"
id="stop8" /><stop
offset="40%"
stop-color="#BBD94F"
id="stop10" /><stop
offset="43.92156862745098%"
stop-color="#B1D339"
id="stop12" /><stop
offset="47.450980392156865%"
stop-color="#A4CB1E"
id="stop14" /><stop
offset="49.80392156862745%"
stop-color="#99C405"
id="stop16" /><stop
offset="54.11764705882353%"
stop-color="#A2CC18"
id="stop18-7" /><stop
offset="59.21568627450981%"
stop-color="#AAD329"
id="stop20-5" /><stop
offset="65.49019607843137%"
stop-color="#B0D834"
id="stop22" /><stop
offset="74.90196078431373%"
stop-color="#B3DB3B"
id="stop24-3" /><stop
offset="100%"
stop-color="#B4DC3D"
id="stop26" /></linearGradient><linearGradient
xlink:href="#Gradient_1"
id="linearGradient15891"
gradientUnits="userSpaceOnUse"
x1="559.79999"
y1="0.0125"
x2="559.79999"
y2="834.88751"
spreadMethod="pad"
gradientTransform="translate(-2962.3062,128.19426)" /><filter
style="color-interpolation-filters:sRGB"
id="filter1"
x="0"
y="0"
width="1.0052697"
height="1.0081699"><feComponentTransfer
id="feComponentTransfer1"><feFuncR
id="feFuncR1"
type="discrete"
tableValues="1" /><feFuncG
id="feFuncG1"
type="discrete"
tableValues="1" /><feFuncB
id="feFuncB1"
type="discrete"
tableValues="1" /><feFuncA
id="feFuncA1"
type="identity"
tableValues="1" /></feComponentTransfer><feOffset
dx="2.4500000000000002"
dy="2.4500000000000002"
id="feOffset1"
result="result1" /><feBlend
mode="normal"
id="feBlend1"
in2="result1"
in="SourceGraphic" /></filter></defs><g
transform="translate(559.2858,-691.3027)"
style="display:inline"
id="g61596"><g
style="display:inline"
transform="matrix(0.44656812,0,0,0.59890998,763.58571,614.52588)"
id="g38-5"><g
id="g36"><g
id="use34"><path
style="fill:url(#linearGradient15891);stroke:none"
id="path15887"
d="m -1842.6562,963.04426 v -834.85 h -1119.65 v 834.85 z" /></g></g></g></g><g
transform="translate(559.2858,-691.3027)"
style="display:inline;filter:url(#filter1)"
id="g16328"><g
transform="matrix(0.57741006,0,0,-0.57741006,-278.83618,862.3163)"
id="g16254"><path
id="path16252"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c -2.947,15.294 -22.128,72.379 -143.132,56.208 21.015,2.281 100.452,4.552 139.645,-83.752 -9.586,20.819 -37.7,69.634 -93.652,78.608 -71.51,11.466 -109.919,-12.516 -136.312,-22.286 -26.394,-9.772 -106.737,-56.449 -132.625,-65.167 -14.994,-5.05 -44.693,-18.094 -68.81,-38.721 16.273,14.494 39.126,29.005 71.287,42.604 52.334,22.129 161.277,95.281 248.44,95.186 C -31.643,62.588 -4.91,28.398 0,0" /></g><g
transform="matrix(0.57741006,0,0,-0.57741006,-109.48077,846.84748)"
id="g16262"><path
id="path16260"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c -7.293,-7.944 -11.633,-18.825 -10.715,-29.12 1.233,-13.799 13.076,-25.783 27.153,-25.487 7.211,0.153 13.912,3.428 18.067,8.137 13.956,15.822 -13.806,41.482 -22.333,11.651 -0.174,-0.603 -0.086,-1.489 0.197,-1.977 0.28,-0.488 0.649,-0.394 0.822,0.208 7.996,27.984 33.536,3.09 19.366,-8.968 -3.861,-3.283 -9.493,-5.549 -15.237,-5.999 -12.719,-0.989 -24.767,8.662 -26.664,21.394 -1.507,10.111 3.291,20.939 11.032,28.634 26.329,26.17 64.196,-2.748 57.46,-35.583 -4.432,-21.636 -21.984,-31.551 -41.565,-35.563 -3.841,-0.787 -7.749,-1.345 -11.638,-1.718 -3.883,-0.371 -7.767,-0.561 -11.561,-0.61 -0.023,0.003 -0.045,0.004 -0.068,0.003 h -0.004 v -0.004 c -0.518,-0.007 -0.21,-2.813 0.173,-2.809 h 0.006 l 0.008,0.001 v -0.006 l 0.006,0.001 0.037,0.005 c 3.808,0.051 7.701,0.241 11.603,0.614 3.928,0.375 7.855,0.935 11.69,1.72 19.902,4.081 37.779,14.33 42.407,36.89 C 67.324,-4.044 28.104,30.604 0,0" /></g><g
transform="matrix(0.57741006,0,0,-0.57741006,-478.09959,997.90223)"
id="g16266"><path
id="path16264"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 2.649,73.746 -37.597,74.47 V 63.625 l 28.439,2.892 c -1.126,-3.375 -2.694,-6.71 -4.7,-10 -2.011,-3.296 -4.178,-6.35 -6.506,-9.161 -2.333,-2.812 -4.698,-5.342 -7.111,-7.59 -2.409,-2.248 -4.578,-4.098 -6.507,-5.542 -0.962,-0.802 -2.734,-1.768 -5.301,-2.893 -2.572,-1.122 -5.626,-1.566 -9.158,-1.327 -3.536,0.243 -7.35,1.49 -11.448,3.736 -4.096,2.254 -8.235,6.267 -12.412,12.05 -6.589,8.355 -11.687,16.749 -15.303,25.187 -3.615,8.434 -6.067,16.626 -7.35,24.582 -1.288,7.952 -1.566,15.543 -0.843,22.773 0.722,7.229 2.206,13.936 4.458,20.123 2.248,6.183 5.02,11.647 8.314,16.388 3.292,4.737 6.868,8.634 10.724,11.689 4.339,5.46 8.835,9.437 13.496,11.929 4.659,2.489 9.318,3.935 13.978,4.338 4.658,0.399 9.317,0.038 13.978,-1.085 4.658,-1.125 9.159,-2.651 13.495,-4.578 6.269,-2.733 10.443,-6.428 12.533,-11.086 2.087,-4.662 2.893,-9.361 2.411,-14.099 -0.484,-4.741 -1.808,-9.157 -3.976,-13.255 -0.426,-0.8 7.949,-2.648 9.279,0.242 2.248,4.898 3.855,10.08 4.819,15.543 0.482,3.534 -0.283,7.51 -2.29,11.931 -2.011,4.416 -5.022,8.593 -9.037,12.531 -4.018,3.935 -8.88,7.23 -14.58,9.881 -5.705,2.652 -12.014,4.015 -18.919,4.097 -6.91,0.079 -14.218,-1.567 -21.931,-4.94 -7.711,-3.374 -15.586,-9.08 -23.618,-17.111 -7.874,-8.036 -13.617,-17.231 -17.232,-27.595 -3.615,-10.362 -5.543,-20.929 -5.783,-31.691 -0.242,-10.765 1.001,-21.369 3.735,-31.813 2.73,-10.445 6.465,-19.802 11.206,-28.075 4.738,-8.277 10.322,-15.142 16.75,-20.605 6.424,-5.461 13.255,-8.596 20.485,-9.401 7.067,-0.802 13.092,-0.558 18.074,0.722 4.98,1.288 9.196,3.296 12.655,6.025 3.451,2.738 6.385,5.99 8.794,9.763 2.412,3.772 4.58,7.832 6.509,12.17 0.321,0.641 0.362,-0.806 0.118,-4.338 C -7.591,42.496 -7.916,37.996 -8.314,32.535 -8.717,27.076 -9.158,21.25 -9.641,15.064 -10.123,8.879 -10.446,3.537 -10.605,-0.963 l -16.387,-2.17 v -8.435 l 40.248,4.34 v 9.399 z" /></g><g
transform="matrix(0.57741006,0,0,-0.57741006,-476.29293,884.2114)"
id="g16270"><path
id="path16268"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 h 88.931 v -24.1 h -6.99 l 0.723,14.219 -26.992,0.964 c -3.375,0.158 -6.711,0.279 -10.002,0.361 -3.294,0.08 -6.229,0.2 -8.795,0.362 -2.573,0.158 -4.663,0.279 -6.266,0.362 -1.607,0.078 -2.493,0.12 -2.651,0.12 -0.161,0 -0.241,-1.167 -0.241,-3.495 0,-2.331 0.038,-5.422 0.121,-9.278 0.079,-3.856 0.158,-8.236 0.239,-13.135 0.081,-4.903 0.2,-9.922 0.362,-15.062 0.32,-12.05 0.724,-25.629 1.206,-40.73 l 15.182,0.242 -0.482,13.497 7.473,0.722 2.889,-32.295 -11.086,-0.481 v 9.64 l -13.495,-0.964 1.205,-54.466 53.504,2.409 2.409,17.835 h 7.469 l -2.893,-30.124 -90.372,-1.205 v 6.505 l 18.555,4.58 L 18.559,-7.472 0,-6.266 Z" /></g><g
transform="matrix(0.57741006,0,0,-0.57741006,-398.22755,907.86829)"
id="g16274"><path
id="path16272"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c -8.035,-13.013 -12.892,-26.592 -14.578,-40.728 -1.689,-14.141 0.361,-28.521 6.142,-43.139 2.734,-6.748 6.426,-12.212 11.089,-16.387 4.657,-4.182 9.88,-6.87 15.666,-8.075 5.783,-1.205 11.808,-0.805 18.073,1.205 6.266,2.008 12.293,5.823 18.075,11.447 6.266,6.104 10.564,13.334 12.893,21.69 2.328,8.354 3.213,17.072 2.651,26.149 -0.565,9.076 -2.33,17.992 -5.302,26.752 -2.973,8.754 -6.627,16.587 -10.964,23.497 -6.108,9.64 -11.568,16.184 -16.389,19.641 -4.82,3.453 -9.362,4.617 -13.616,3.494 C 19.481,24.421 15.462,21.488 11.688,16.75 7.912,12.01 4.015,6.424 0,0 m 25.307,-118.331 c -5.626,-0.321 -10.725,-0.12 -15.305,0.604 -4.577,0.722 -8.797,2.567 -12.652,5.541 -3.855,2.972 -7.352,7.473 -10.484,13.497 -3.133,6.025 -6.066,14.255 -8.796,24.702 -1.927,6.906 -2.771,14.581 -2.529,23.017 0.24,8.434 1.241,16.869 3.012,25.304 1.766,8.435 4.174,16.629 7.23,24.582 3.049,7.954 6.542,14.98 10.485,21.087 3.934,6.105 8.15,11.003 12.65,14.702 4.497,3.694 9.075,5.543 13.738,5.543 6.905,0 13.256,-2.132 19.037,-6.387 5.786,-4.259 10.927,-9.843 15.424,-16.749 4.497,-6.91 8.235,-14.664 11.206,-23.257 2.974,-8.596 5.099,-17.231 6.387,-25.907 2.088,-13.82 2.851,-25.547 2.292,-35.186 -0.565,-9.639 -2.049,-17.634 -4.459,-23.979 -2.411,-6.349 -5.507,-11.29 -9.28,-14.822 -3.777,-3.537 -7.872,-6.188 -12.29,-7.953 -4.42,-1.769 -8.837,-2.891 -13.255,-3.375 -4.42,-0.482 -8.557,-0.804 -12.411,-0.964" /></g><g
transform="matrix(0.57741006,0,0,-0.57741006,-308.19442,972.57512)"
id="g16278"><path
id="path16276"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 13.495,0.963 0.482,139.54 -16.388,-4.579 0.483,7.471 c 5.782,2.085 12.773,4.537 20.965,7.35 8.195,2.809 16.667,5.219 25.427,7.23 8.755,2.007 17.351,3.292 25.786,3.855 8.435,0.562 15.786,-0.281 22.053,-2.529 2.409,-0.644 4.134,-2.091 5.181,-4.339 1.041,-2.251 1.362,-4.62 0.966,-7.109 -0.404,-2.493 -1.449,-4.699 -3.134,-6.628 -1.688,-1.927 -3.976,-2.891 -6.87,-2.891 -3.215,0 -5.784,0.519 -7.712,1.566 -1.927,1.043 -3.215,2.328 -3.854,3.856 -0.646,1.525 -0.723,3.254 -0.243,5.181 0.482,1.929 1.447,3.774 2.892,5.544 -7.07,-0.324 -13.617,-1.006 -19.642,-2.049 -6.026,-1.047 -11.447,-2.169 -16.267,-3.374 -4.82,-1.205 -8.918,-2.372 -12.293,-3.495 -3.372,-1.126 -6.023,-2.01 -7.953,-2.65 l 0.483,-70.373 20.003,1.206 0.722,11.086 h 7.231 c 0.16,0 -0.479,-10.446 -1.928,-31.331 H 43.378 L 43.86,63.864 23.617,63.141 22.411,0.963 36.873,3.132 36.391,-6.99 0,-8.677 Z" /></g><g
transform="matrix(0.57741006,0,0,-0.57741006,-219.83209,884.2114)"
id="g16282"><path
id="path16280"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 h 49.885 l 10.47,-9.084 -4.684,0.167 c -3.375,0.158 -6.71,0.279 -10.002,0.361 -3.295,0.08 -6.23,0.2 -8.796,0.362 -2.573,0.158 -4.664,0.279 -6.266,0.362 -1.607,0.078 -2.493,0.12 -2.652,0.12 -0.159,0 -0.24,-1.167 -0.24,-3.495 0,-2.331 0.038,-5.422 0.122,-9.278 0.076,-3.856 0.155,-8.236 0.238,-13.135 0.081,-4.903 0.2,-9.922 0.361,-15.062 0.321,-12.05 0.723,-25.629 1.206,-40.73 l 15.183,0.242 -0.482,13.497 7.471,0.722 2.891,-32.295 -11.085,-0.481 v 9.64 l -13.496,-0.964 1.205,-54.466 53.503,2.409 2.409,17.835 h 7.471 l -2.89,-30.124 -90.376,-1.205 v 6.505 l 18.556,4.58 L 18.558,-7.472 0,-6.266 Z" /></g><g
transform="matrix(0.57741006,0,0,-0.57741006,-159.16119,886.15987)"
id="g16286"><path
id="path16284"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 29.401,8.676 0.483,-9.639 -7.712,-2.411 22.894,-59.526 21.933,54.225 -8.678,2.169 v 5.061 l 30.126,-1.688 -2.652,-9.398 -10.603,1.686 -26.028,-61.454 0.723,-94.954 h 13.496 v -7.953 l -33.982,0.962 v 7.715 l 9.158,-0.724 0.482,97.605 L 12.29,-4.337 3.132,-6.266 Z" /></g><g
transform="matrix(0.57741006,0,0,-0.57741006,-184.16345,869.72649)"
id="g16290"><path
id="path16288"
style="fill:none;stroke:#000000;stroke-width:5.647;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 0,0 c 1.893,-1.663 16.513,-5.652 12.795,-16.931 7.208,6.008 9.155,15.147 18.24,21.18 -2.542,-6.545 -0.932,-20.71 -9.036,-24.252 11.145,-1.657 12.241,4.784 27.421,1.396 -7.338,-5.168 -15.408,-8.757 -24.21,-10.77 8.244,-3.75 11.209,-12.681 13.916,-20.437 -5.719,4.094 -19.832,6.022 -21.26,14.763 1.331,-4.41 1.125,-6.078 -0.617,-5.001 3.59,-8.32 -0.205,-16.921 -3.404,-24.493 -2.058,8.77 -8.713,18.589 -6.417,28.009 -2.685,-8.641 -11.243,-12.684 -18.585,-16.313 5.516,10.125 5.512,15.098 12.813,23.587 -8.9,-1.635 -16.451,4.071 -23.071,8.895 7.009,-0.121 19.761,6.331 25.879,-0.055 C 0.182,-14.278 -1.308,-7.472 0,0" /></g><g
transform="matrix(0.57741006,0,0,-0.57741006,-305.49907,981.53571)"
id="g16294"><path
id="path16292"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 4.755,-1.007 9.469,-2.193 14.142,-3.511 18.184,-5.283 36.631,-12.659 50.298,-26.651 13.577,-13.793 18.948,-35.559 11.741,-53.607 -3.405,-8.812 -11.209,-15.85 -20.306,-18.239 -4.448,-1.356 -9.171,-2.15 -13.873,-1.612 -4.68,0.483 -9.287,2.654 -12.342,6.294 -6.202,7.472 -5.775,18.259 -2.063,26.611 3.757,8.577 11.085,15.316 19.656,18.967 13.895,5.885 29.805,4.483 43.718,-0.444 14.039,-5.036 26.726,-13.3 37.762,-23.199 11.003,-9.955 20.529,-21.65 27.404,-34.873 3.433,-6.603 6.135,-13.624 7.679,-20.959 1.556,-7.374 1.301,-15.12 -0.717,-22.381 -3.793,-14.55 -15.627,-27.205 -30.63,-30.362 -15.067,-3.389 -29.951,1.978 -43.591,7.065 -13.71,5.469 -27.918,9.745 -42.643,11.184 -7.147,0.483 -15.263,0.852 -21.09,-3.774 -2.829,-2.373 -3.799,-6.282 -3.476,-9.914 0.293,-3.682 1.477,-7.252 2.897,-10.672 -1.924,4.724 -3.719,9.79 -2.941,14.925 0.672,5.35 5.812,8.763 10.638,9.733 12.215,2.447 24.69,-0.243 36.711,-2.968 12.161,-3.008 23.569,-8.292 35.511,-11.566 11.773,-3.388 24.812,-4.314 35.771,1.339 10.95,5.406 18.599,16.416 21.09,28.382 2.791,12.091 -0.594,24.631 -5.799,35.877 -5.281,11.297 -12.677,21.57 -21.175,30.663 -16.995,17.892 -39.089,32.508 -63.608,34.736 -8.876,0.628 -18.068,-0.611 -26.043,-4.697 -7.959,-3.998 -14.476,-10.99 -17.419,-19.42 -2.984,-8.196 -2.421,-18.538 4.076,-24.726 6.573,-6.263 16.747,-5.526 24.808,-2.541 8.456,2.659 15.134,9.372 18.084,17.577 3.065,8.171 3.194,17.283 1.317,25.756 -0.948,4.243 -2.427,8.376 -4.499,12.153 -2.107,3.701 -4.737,7.398 -7.56,10.558 -5.797,6.443 -13.188,11.342 -20.911,15.385 -16.578,8.404 -35.09,13.086 -53.696,16.241 -18.649,3.069 -37.696,4.515 -56.594,4.735 -18.966,0.245 -38.159,0.008 -56.93,3.326 -9.339,1.681 -18.627,4.286 -26.987,8.839 -8.35,4.489 -15.53,11.324 -19.688,19.679 -1.085,2.044 -3.255,7.268 -4.193,12.679 -1.099,5.378 -1.149,10.774 -1.314,12.744 0.548,-8.169 2.38,-16.405 6.301,-23.647 3.86,-7.274 9.967,-13.184 17.134,-17.276 14.518,-8.204 31.899,-10.19 48.906,-11.124 C -87.282,6.4 -69.918,7.266 -52.275,6.453 -34.79,5.628 -17.177,3.708 0,0" /></g><g
transform="matrix(0.57741006,0,0,-0.57741006,-359.11142,1021.4165)"
id="g16298"><path
id="path16296"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 3.397,-1.412 6.911,-2.492 10.495,-3.112 13.817,-2.814 28.983,4.758 36.493,16.6 3.674,5.884 5.109,13.63 2.693,20.016 -2.589,6.435 -9.718,10.167 -16.77,10.812 C 26.011,44.98 18.542,43.211 13.303,38.429 10.719,36.058 8.704,32.941 8.271,29.442 7.827,25.944 8.977,22.371 10.779,19.267 14.497,13.021 20.21,8.135 26.107,3.844 c 5.962,-4.275 12.381,-7.919 19.004,-11.087 5.305,-2.511 10.732,-4.793 16.311,-6.534 5.52,-1.641 11.504,-2.247 17.196,-3.632 11.493,-2.481 22.909,-5.584 33.808,-10.138 10.873,-4.554 21.226,-10.576 30.164,-18.351 8.97,-7.728 16.514,-17.027 22.62,-27.121 13.462,-19.712 16.185,-45.646 9.357,-68.252 -3.434,-11.303 -9.591,-22.087 -18.893,-29.615 -9.24,-7.611 -21.479,-10.945 -33.257,-10.132 8.222,-0.491 16.481,1.343 23.432,4.909 8.62,4.291 15.564,11.512 20.362,19.887 4.839,8.399 7.685,17.926 8.945,27.625 1.221,9.714 0.868,19.697 -1.296,29.29 -1.977,9.663 -6.729,18.435 -11.973,26.911 -10.449,16.917 -25.416,30.976 -43.197,39.774 -17.714,9.06 -37.179,13.361 -56.267,17.515 -13.645,4.57 -26.488,11.216 -38.145,19.552 -5.706,4.275 -11.3,9.056 -14.891,15.437 -1.74,3.166 -2.795,6.927 -2.143,10.646 0.644,3.72 2.849,6.944 5.537,9.429 5.525,4.988 13.191,7.011 20.497,6.485 C 40.482,45.91 48.312,42.526 51.883,35.432 55.271,28.342 54.19,20.204 50.949,13.501 47.602,6.759 42.062,1.368 35.701,-2.395 28.977,-6.342 20.977,-8.77 12.849,-7.928 4.939,-7.2 -2.636,-4.423 -9.455,-0.626 c -13.7,7.705 -24.68,19.052 -34.056,31.104 -18.53,24.412 -31.581,52.29 -39.022,80.488 -1.085,3.501 -3.356,17.301 -3.598,20.435 2.238,-12.869 6.646,-25.442 11.748,-37.818 C -69.21,81.217 -63.119,69.065 -56.134,57.36 -49.122,45.684 -41.241,34.39 -32.056,24.283 -22.903,14.246 -12.326,5.164 0,0" /></g><g
transform="matrix(0.57741006,0,0,-0.57741006,-496.15832,937.16902)"
id="g16302"><path
id="path16300"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
d="m 0,0 c -0.977,-2.42 -2.724,-3.975 -5.139,-3.018 -2.419,0.957 -3.087,3.466 -2.009,7.53 2.051,6.483 8.06,10.28 14.171,15.72 C 9.03,12.7 11.041,5.17 8.991,-1.316 8.786,-4.605 5.396,-6.064 3.751,-5.978 1.336,-5.021 0.564,-4.154 0,0 m -15.43,17.332 c -3.287,0.177 -4.829,1.911 -4.729,3.555 -0.669,2.508 1.951,4.84 4.466,5.531 6.68,1.284 13.925,-1.586 21.172,-4.454 C -0.632,16.525 -5.969,10.22 -11.775,9.71 c -3.389,-1.463 -6.577,0.359 -7.25,2.872 -0.668,2.506 0.204,3.284 3.595,4.75 m 8.001,22.651 c -1.44,3.377 -2.109,5.888 -0.364,7.443 1.749,1.551 4.934,-0.271 7.246,-2.87 3.858,-4.332 5.868,-11.865 7.002,-20.171 -8.118,2.091 -16.238,4.184 -20.096,8.515 -2.313,2.601 -2.882,6.753 -1.135,8.307 1.746,1.555 4.161,0.598 7.347,-1.224 m 23.428,5.321 c 0.976,2.422 2.724,3.973 5.137,3.018 2.412,-0.956 3.084,-3.466 2.01,-7.53 C 21.094,34.307 15.083,30.512 8.974,25.071 6.963,32.602 4.955,40.135 7.006,46.618 c 0.205,3.289 3.591,4.75 5.236,4.664 2.415,-0.96 3.19,-1.825 3.757,-5.978 M 31.426,27.971 c 3.284,-0.177 4.831,-1.909 4.729,-3.554 0.667,-2.509 -1.95,-4.841 -4.466,-5.529 -6.68,-1.285 -13.927,1.583 -21.173,4.453 6.111,5.438 11.45,11.744 17.257,12.253 3.389,1.463 6.574,-0.36 7.245,-2.87 0.67,-2.509 -0.204,-3.287 -3.592,-4.753 M 23.424,5.32 c 1.439,-3.378 2.113,-5.885 0.368,-7.442 -1.747,-1.552 -4.935,0.27 -7.251,2.87 C 12.684,5.08 10.676,12.612 9.542,20.921 17.659,18.827 25.779,16.736 29.637,12.403 31.95,9.804 32.52,5.649 30.773,4.094 29.027,2.54 26.612,3.499 23.424,5.32" /></g><g
transform="matrix(0.57741006,0,0,-0.57741006,-235.13854,898.12704)"
id="g16306"><path
id="path16304"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c -4.821,2.569 -9.923,4.496 -15.305,5.784 -5.383,1.283 -10.404,2.169 -15.062,2.652 -5.303,0.639 -10.602,0.801 -15.905,0.48 l 1.445,-77.119 c 7.068,0.483 13.817,1.284 20.246,2.41 5.301,0.965 10.602,2.369 15.904,4.217 5.301,1.846 9.236,4.218 11.809,7.11 2.567,2.893 4.737,6.868 6.508,11.929 1.765,5.062 2.73,10.323 2.892,15.786 0.157,5.461 -0.686,10.642 -2.531,15.544 C 8.152,-6.307 4.82,-2.572 0,0 m -66.276,-128.212 11.087,-0.482 -2.65,137.37 h -13.016 l -0.962,9.881 c 17.027,0.964 32.373,0.482 46.031,-1.447 5.782,-0.963 11.481,-2.25 17.109,-3.855 5.62,-1.608 10.685,-3.777 15.184,-6.507 4.495,-2.734 8.232,-6.108 11.208,-10.122 2.969,-4.018 4.614,-8.838 4.936,-14.461 0.484,-7.711 0.244,-14.459 -0.721,-20.242 -0.965,-5.785 -2.33,-10.767 -4.099,-14.943 -1.769,-4.18 -3.936,-7.633 -6.503,-10.363 -2.574,-2.734 -5.146,-4.982 -7.713,-6.747 -6.428,-4.181 -13.738,-6.188 -21.931,-6.025 l 54.463,-73.505 h 11.812 l 1.686,-8.918 -33.018,-2.17 -0.479,6.991 10.602,1.204 -57.117,72.781 -14.46,-1.927 v -46.995 l 11.086,0.965 v -8.918 l -32.052,0.482 z" /></g><g
transform="matrix(0.57741006,0,0,-0.57741006,-290.17403,883.09827)"
id="g16322"><path
id="path16320"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c -1.046,2.248 -2.772,3.694 -5.182,4.338 -6.264,2.248 -13.616,3.092 -22.048,2.53 -8.436,-0.564 -17.033,-1.849 -25.791,-3.855 -8.756,-2.012 -17.23,-4.421 -25.422,-7.23 -8.195,-2.813 -15.183,-5.265 -20.969,-7.351 l -0.482,-7.471 16.388,4.579 -0.481,-139.54 -13.496,-0.962 v -8.677 l 36.39,1.686 0.483,10.122 -14.461,-2.169 1.205,62.179 0.242,9.399 -0.481,70.372 c 1.926,0.64 4.577,1.525 7.953,2.65 3.372,1.123 7.469,2.291 12.289,3.496 4.819,1.205 10.245,2.327 16.266,3.373 6.026,1.043 12.573,1.725 19.643,2.049 -1.445,-1.77 -2.41,-3.614 -2.891,-5.543 -0.481,-1.928 -0.405,-3.657 0.241,-5.182 0.639,-1.528 1.927,-2.812 3.854,-3.855 1.929,-1.047 4.498,-1.567 7.714,-1.567 2.892,0 5.181,0.964 6.869,2.892 1.688,1.928 2.729,4.135 3.132,6.628 C 1.365,-4.62 1.045,-2.252 0,0" /></g><g
transform="matrix(0.57741006,0,0,-0.57741006,-165.14449,937.08189)"
id="g16326"><path
id="path16324"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 C 22.756,-46.462 103.04,-47.09 103.04,-47.09 13.691,-47.872 0,0 0,0 m -99.337,-33.74 -0.013,-0.428 c -0.282,-11.702 -7.741,-19.501 -17.459,-20.42 -9.699,-0.923 -17.428,5.868 -17.126,18.404 0.305,12.534 8.49,24.57 18.356,32.178 8.289,-7.974 16.495,-19.297 16.242,-29.734 m -193.03,35.08 c 17.189,9.15 49.441,15.952 73.138,17.77 37.651,3.162 78.074,-3.446 99.464,-21.019 -11.731,-8.605 -24.16,-22.297 -24.482,-35.679 -0.333,-13.793 13.964,-22.856 27.331,-21.592 12.154,1.156 23.305,11.385 23.64,25.162 0.283,11.723 -9.111,23.742 -18.603,32.026 12.931,8.741 31.863,15.95 56.18,18.254 20.639,1.955 39.915,-2.89 45.18,-10.74 2.945,-3.475 1.061,-6.145 2.888,-5.974 l 0.67,0.205 c 1.55,-2.236 4.476,-7.174 7.834,-16.512 4.984,-13.875 27.627,-36.002 78.85,-33.898 0,0 20.259,-1.476 28.273,2.091 0,0 38.35,0.905 46.58,6.699 0,0 -24.95,-7.212 -52.941,6.203 -27.987,13.417 -51.337,41.257 -89.088,39.938 0,0 -18.556,-0.639 -23.477,7.48 l 0.252,-0.946 c -8.283,6.583 -25.672,11.105 -44.92,9.637 -23.692,-2.245 -46.914,-10.287 -59.863,-19.431 -22.557,19.123 -64.225,25.19 -103.672,22.28 -24.898,-1.928 -57.771,-8.386 -78.594,-18.288 z" /></g></g></svg>

After

Width:  |  Height:  |  Size: 22 KiB

View file

@ -1,2 +1,3 @@
dist/* dist/*
frobar.egg-info/* frobar.egg-info/*
__pycache__

View file

@ -23,9 +23,15 @@ let
name = "frobar_launcher"; name = "frobar_launcher";
runtimeInputs = with pkgs; [ lemonbar-xft wirelesstools ]; runtimeInputs = with pkgs; [ lemonbar-xft wirelesstools ];
text = '' text = ''
${pkgs.procps}/bin/pkill /bin/frobar || true pidfile=$XDG_RUNTIME_DIR/frobar/$DISPLAY.pid
${frobar}/bin/frobar ${pkgs.coreutils}/bin/mkdir -p "$(${pkgs.coreutils}/bin/dirname "$pidfile")"
([ -f "$pidfile" ] && ${pkgs.procps}/bin/kill "$(<"$pidfile")") || true
${frobar}/bin/frobar & disown
echo $! > "$pidfile"
''; '';
}; };
in in
frobar_launcher frobar_launcher
# FIXME Doesn't kill the old bar
# FIXME Not using Nerdfont
# TODO Connection with i3 is lost sometimes, more often than with Arch?

View file

@ -15,13 +15,14 @@ in
url = "https://get.wallhere.com/photo/sunlight-abstract-minimalism-green-simple-circle-light-leaf-wave-material-line-wing-computer-wallpaper-font-close-up-macro-photography-124350.png"; url = "https://get.wallhere.com/photo/sunlight-abstract-minimalism-green-simple-circle-light-leaf-wave-material-line-wing-computer-wallpaper-font-close-up-macro-photography-124350.png";
sha256 = "sha256:1zfq3f3v34i45mi72pkfqphm8kbhczsg260xjfl6dbydy91d7y93"; sha256 = "sha256:1zfq3f3v34i45mi72pkfqphm8kbhczsg260xjfl6dbydy91d7y93";
}; };
# FIXME This doesn't work # The background is set on some occasions, autorandr + feh do the rest
fonts = { fonts = {
sizes = { sizes = {
applications = 10; applications = 10;
terminal = 10; terminal = 10;
}; };
# FIXME Somehow this seems smaller than Arch on the left screen, yet bigger on the right...
monospace = { monospace = {
package = pkgs.nerdfonts.override { package = pkgs.nerdfonts.override {
fonts = [ "DejaVuSansMono" ]; # Choose from https://github.com/NixOS/nixpkgs/blob/6ba3207643fd27ffa25a172911e3d6825814d155/pkgs/data/fonts/nerdfonts/shas.nix fonts = [ "DejaVuSansMono" ]; # Choose from https://github.com/NixOS/nixpkgs/blob/6ba3207643fd27ffa25a172911e3d6825814d155/pkgs/data/fonts/nerdfonts/shas.nix

View file

@ -22,7 +22,7 @@ let
owner = "unblevable"; owner = "unblevable";
repo = "quick-scope"; repo = "quick-scope";
rev = "v${version}"; rev = "v${version}";
sha256 = "iAPvIs/lhW+w5kFTZKaY97D/kfCGtqKrJVFvZ8cHu+c="; sha256 = "TcA4jZIdnQd06V+JrXGiCMr0Yhm9gB6OMiTSdzMt/Qw=";
}; };
meta.homepage = "https://github.com/unblevable/quick-scope"; meta.homepage = "https://github.com/unblevable/quick-scope";
}; };
@ -255,7 +255,6 @@ in
# f/F mode # f/F mode
vim-shot-f # Highlight relevant characters for f/F/t/T modes vim-shot-f # Highlight relevant characters for f/F/t/T modes
quick-scope # Highlight relevant characters for f/F modes one per word but always quick-scope # Highlight relevant characters for f/F modes one per word but always
# FIXME Doesn't work here, :QuickScopeToggle doesn't even work
# Registers # Registers
registers-nvim # Show register content when pressing " registers-nvim # Show register content when pressing "

View file

@ -1,4 +1,4 @@
{ lib, ... }: { lib, config, ... }:
{ {
options.frogeye = { options.frogeye = {
extra = lib.mkEnableOption "Big software"; extra = lib.mkEnableOption "Big software";
@ -13,6 +13,12 @@
fpga = lib.mkEnableOption "FPGA dev stuff"; fpga = lib.mkEnableOption "FPGA dev stuff";
python = lib.mkEnableOption "Python dev stuff"; python = lib.mkEnableOption "Python dev stuff";
}; };
dotfiles = {
path = lib.mkOption {
type = lib.types.str;
default = "${config.home.homeDirectory}/.config/dotfiles";
};
};
}; };
config = { config = {

View file

@ -28,8 +28,13 @@
# android tools # android tools
android-udev-rules android-udev-rules
# Needed for all the fetchFromGit in this repo on nixos-rebuild
git
]; ];
nixpkgs.config.allowUnfree = true;
programs = { programs = {
# Enable compilation cache # Enable compilation cache
ccache.enable = true; ccache.enable = true;
@ -49,7 +54,7 @@
chrony = { chrony = {
enable = true; enable = true;
servers = map (n: "${toString n}.europe.pool.ntp.org") (lib.lists.range 0 3); servers = map (n: "${toString n}.europe.pool.ntp.org") (lib.lists.range 0 3);
extraConfig = "rtcsync"; extraConfig = "rtcsync"; # See 23.11 release notes
}; };
# Prevent power button from shutting down the computer. # Prevent power button from shutting down the computer.

View file

@ -8,7 +8,6 @@
extraConfig = '' extraConfig = ''
country=NL country=NL
''; '';
interfaces = ["eth0"];
}; };
environment.systemPackages = with pkgs; [ wirelesstools ]; environment.systemPackages = with pkgs; [ wirelesstools ];
services.chrony.serverOption = "offline"; services.chrony.serverOption = "offline";

View file

@ -43,6 +43,9 @@ class Password:
def val(self) -> str: def val(self) -> str:
return self.content return self.content
def exists(self) -> bool:
return not not self.content
def key(self) -> str: def key(self) -> str:
if SEPARATE_PASSWORDS: if SEPARATE_PASSWORDS:
return f"@{self.var()}@" return f"@{self.var()}@"
@ -109,7 +112,7 @@ for path in list_networks():
# Helpers to prevent repetition # Helpers to prevent repetition
suffixes = data.pop("suffixes", [""]) suffixes = data.pop("suffixes", [""])
data.setdefault("key_mgmt", ["WPA-PSK"] if password else ["NONE"]) data.setdefault("key_mgmt", ["WPA-PSK"] if password.exists() else ["NONE"])
if password: if password:
if any(map(lambda m: "PSK" in m.split("-"), data["key_mgmt"])): if any(map(lambda m: "PSK" in m.split("-"), data["key_mgmt"])):
data["psk"] = password data["psk"] = password
@ -140,7 +143,7 @@ for path in list_networks():
if key_mgmt: if key_mgmt:
network["authProtocols"] = key_mgmt network["authProtocols"] = key_mgmt
if psk: if psk:
network["pskRaw"] = psk.key() network["psk"] = psk.key()
if data: if data:
raise NotImplementedError(f"{path}: Unhandled non-auth extra: {data}") raise NotImplementedError(f"{path}: Unhandled non-auth extra: {data}")
else: else:

View file

@ -2,11 +2,9 @@
{ {
imports = [ imports = [
<nixos-hardware/pine64/pinebook-pro> <nixos-hardware/pine64/pinebook-pro>
<nixpkgs/nixos/modules/installer/sd-card/sd-image-aarch64.nix>
./os/loader.nix ./os/loader.nix
]; ];
# nixos-hardware use latest kernel by default. This obviously runs quickly out of sync with zfs packages. # nixos-hardware use latest kernel by default. This obviously runs quickly out of sync with zfs packages.
# zfs packages are included despite me asking anything zfs, probably they're in the image for installation purposes?
boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
networking.hostName = "pindakaas"; networking.hostName = "pindakaas";

53
scripts/.bsh/bashrc Normal file
View file

@ -0,0 +1,53 @@
#!/usr/bin/env bash
# Geoffrey's trimmed and condensed shell configuration file,
# with an healthy and safe dose of aliases and config.
# Can be embedded to any server
# Completion for existing commands
alias ls='ls -h --color=auto'
alias mkdir='mkdir -v'
alias cp="cp -i"
alias mv="mv -iv"
alias free='free -h'
alias df='df -h'
# Advanced completions
# (not busybox compatible)
alias cp="cp -i --reflink=auto"
alias grep="grep --color=auto"
alias dd='dd status=progress'
alias rm='rm -v --one-file-system'
alias free='free -m'
alias diff='diff --color=auto'
alias dmesg='dmesg --ctime'
# Frequent mistakes
alias sl=ls
alias al=la
alias mdkir=mkdir
alias systemclt=systemctl
alias please=sudo
# Shortcuts for commonly used commands
alias ll="ls -l"
alias la="ls -la"
# alias s='sudo -s -E'
# Bash options
shopt -s expand_aliases
shopt -s histappend
HISTCONTROL=ignoreboth:erasedups
# Program configuration
export TIME_STYLE='+%Y-%m-%d %H:%M:%S'
export LESS=-R
export LESS_TERMCAP_mb=$'\E[1;31m'
export LESS_TERMCAP_md=$'\E[1;36m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;44;33m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_us=$'\E[1;32m'
export LESS_TERMCAP_ue=$'\E[0m'

View file

@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Prefered programs environment variables
export PAGER=less
if [ -x "$(command -v nvim)" ]
then
export EDITOR=nvim
alias vi=nvim
elif [ -x "$(command -v vim)" ]
then
export EDITOR=vim
alias vi=vim
else
export EDITOR=vi
fi
# Prompt
if [[ $USER == 'root' ]]; then
col=31;
elif [[ $USER == 'geoffrey' ]]; then
col=32;
else
col=33;
fi
export PS1="\[\e]2;\u@\H \w\a\]\[\e[0;37m\][\[\e[0;${col}m\]\u\[\e[0;37m\]@\[\e[0;34m\]\h \[\e[0;36m\]\W\[\e[0;37m\]]\$\[\e[0m\] "

50
scripts/.bsh/inputrc Normal file
View file

@ -0,0 +1,50 @@
$include /etc/inputrc
set bell-style none
set colored-completion-prefix on
set colored-stats on
set completion-ignore-case on
set completion-query-items 200
set editing-mode vi
set history-preserve-point on
set history-size 10000
set horizontal-scroll-mode off
set mark-directories on
set mark-modified-lines off
set mark-symlinked-directories on
set match-hidden-files on
set menu-complete-display-prefix on
set page-completions on
set print-completions-horizontally off
set revert-all-at-newline off
set show-all-if-ambiguous on
set show-all-if-unmodified on
set show-mode-in-prompt on
set skip-completed-text on
set visible-stats off
$if mode=vi
# these are for vi-command mode
set keymap vi-command
"k": history-search-backward
"j": history-search-forward
"\e[A": history-search-backward
"\e[B": history-search-forward
Control-l: clear-screen
# these are for vi-insert mode
set keymap vi-insert
"jk": vi-movement-mode
"\e[A": history-search-backward
"\e[B": history-search-forward
Control-l: clear-screen
# Switch between thin cursor and thicc block depending on vi mode
$if term=linux
set vi-ins-mode-string \1\e[?0c\2
set vi-cmd-mode-string \1\e[?8c\2
$else
set vi-ins-mode-string \1\e[6 q\2
set vi-cmd-mode-string \1\e[2 q\2
$endif
$endif

51
scripts/.bsh/vimrc Normal file
View file

@ -0,0 +1,51 @@
cmap w!! w !sudo tee > /dev/null %
filetype indent on
filetype on
filetype plugin on
imap jk <Esc>
let g:netrw_fastbrowse = 0
nmap <C-H> :bp<CR>
nmap <C-J> jjjjjjjjjjjjjjjjjjjjj
nmap <C-K> kkkkkkkkkkkkkkkkkkkkk
nmap <C-L> :bn<CR>
nmap <Enter> o<Esc>
nnoremap <Leader>s :%s/\<<C-r><C-w>\>/
set backspace=indent,eol,start
set cursorcolumn
set encoding=utf-8
set expandtab
set gdefault
set hidden
set hlsearch
set ignorecase
set incsearch
set lazyredraw
set list
set listchars=tab:╾╌,trail,extends:↦,precedes:↤,nbsp:_
set noerrorbells
set number
set ruler
set scrolloff=10
set shiftwidth=4
set showbreak=
set showcmd
set smartcase
set splitbelow
set tabstop=4
set title
set updatetime=250
set visualbell
set wildmenu
set wildmode=longest,list
set wrap
syntax enable
vmap <Enter> <Esc>
if has('nvim')
set inccommand=nosplit
set relativenumber
augroup every
autocmd!
au InsertEnter * set norelativenumber
au InsertLeave * set relativenumber
augroup END
endif

View file

@ -1,11 +1,14 @@
#!/usr/bin/env python3 #!/usr/bin/env nix-shell
#! nix-shell -i python3 --pure
#! nix-shell -p python3 python3Packages.coloredlogs
import argparse import argparse
import coloredlogs
import logging import logging
import os import os
import sys import sys
import coloredlogs
coloredlogs.install(level="DEBUG", fmt="%(levelname)s %(message)s") coloredlogs.install(level="DEBUG", fmt="%(levelname)s %(message)s")
log = logging.getLogger() log = logging.getLogger()
@ -155,7 +158,6 @@ def archive(docdir):
# If the directory doesn't exist, create the directories under it and move all the folder # If the directory doesn't exist, create the directories under it and move all the folder
else: else:
if args.dry: if args.dry:
print("mkdir -p", parentArcdir) print("mkdir -p", parentArcdir)
else: else:
@ -177,7 +179,6 @@ def unarchive(arcdir):
if __name__ == "__main__": if __name__ == "__main__":
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description="Place a folder in ~/Documents in ~/Documents/Archives and symlink it" description="Place a folder in ~/Documents in ~/Documents/Archives and symlink it"
) )

70
scripts/bsh Executable file
View file

@ -0,0 +1,70 @@
#!/usr/bin/env nix-shell
#! nix-shell -i bash --pure
#! nix-shell -p bash openssh coreutils gawk gnused
# TODO More integrated with current config
CACHE_DIR="${XDG_CACHE_DIR:-$HOME/.cache}/bsh"
FOLDER_NAME="geoffrey"
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
mkdir -p "$CACHE_DIR"
if [ ! -f "${CACHE_DIR}/cmd" ]
then
# Preparation
WORK="${CACHE_DIR}/${FOLDER_NAME}"
DEST="/tmp/${FOLDER_NAME}"
mkdir "$WORK"
# TODO Maybe we should just set HOME there…
# Bashrc generation (sortable then unsortable)
grep -o '^\s*[^#]*' $SCRIPT_DIR/.bsh/bashrc | sed 's/^\s\+//' > "${WORK}/b"
echo "alias s='sudo -s -E bash --rcfile ${DEST}/b'" >> "${WORK}/b"
echo "export VIMINIT='source ${DEST}/v'" >> "${WORK}/b"
#echo "export TERMINFO=${DEST}/terminfo" >> "${WORK}/b"
echo "export INPUTRC=${DEST}/i" >> "${WORK}/b"
# Sort for compression efficiency (saves a whooping 12 bytes)
sort -u "${WORK}/b" > "${WORK}/b_sorted"
mv "${WORK}/b_sorted" "${WORK}/b"
dircolors --sh >> "${WORK}/b"
grep -o '^[^#]*' $SCRIPT_DIR/.bsh/bashrc_unsortable | sed 's/^\s\+//' >> "${WORK}/b"
# Other files generation
#mkdir -p "${WORK}/terminfo/${TERM:0:1}"
#if [ -f "/usr/share/terminfo/${TERM:0:1}/${TERM}" ]
#then
# cp "/usr/share/terminfo/${TERM:0:1}/${TERM}" "${WORK}/terminfo/${TERM:0:1}/${TERM}"
#elif [ -f "$HOME/.config/terminfo/${TERM:0:1}/${TERM}" ]
#then
# cp "$HOME/.config/terminfo/${TERM:0:1}/${TERM}" "${WORK}/terminfo/${TERM:0:1}/${TERM}"
#fi
grep -o '^\s*[^#]*' $SCRIPT_DIR/.bsh/inputrc | sed 's/^\s\+//' > "${WORK}/i"
grep -o '^\s*[^"]*' $SCRIPT_DIR/.bsh/vimrc | sed 's/^\s\+//' > "${WORK}/v"
# Crafting command
b64="$(cd "$CACHE_DIR"; tar czf - "$FOLDER_NAME" | base64 -w 0)"
echo "echo $b64|base64 -d|tar xzC /tmp" > "${CACHE_DIR}/cmd"
echo "bash --rcfile ${DEST}/b" >> "${CACHE_DIR}/cmd"
echo "rm -rf ${DEST}" >> "${CACHE_DIR}/cmd"
# TODO Do not remove unless last one connected
# Cleanup
rm -rf "$WORK"
fi
# To keep until https://github.com/openssh/openssh-portable/commit/f64f8c00d158acc1359b8a096835849b23aa2e86
# is merged
function _ssh {
if [ "${TERM}" = "alacritty" ]
then
TERM=xterm-256color ssh "$@"
else
ssh "$@"
fi
}
alias ssh='_ssh'
_ssh -t "$@" "$(cat "${CACHE_DIR}/cmd")"

View file

@ -1,4 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env nix-shell
#! nix-shell -i bash
#! nix-shell -p bash pass libnotify
# TODO Password changed? # TODO Password changed?

View file

@ -1,4 +1,6 @@
#!/usr/bin/env python3 #!/usr/bin/env nix-shell
#! nix-shell -i python3 --pure
#! nix-shell -p python3 python3Packages.coloredlogs
""" """
Same as picture_name_date Same as picture_name_date

View file

@ -1,4 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env nix-shell
#! nix-shell -i bash --pure
#! nix-shell -p bash findutils git gnumake
# Removes files that can be regenerated # Removes files that can be regenerated
# from a dev environment # from a dev environment

View file

@ -1,18 +1,21 @@
#!/usr/bin/env python3 #!/usr/bin/env nix-shell
#! nix-shell -i python3 --pure
#! nix-shell -p python3 python3Packages.coloredlogs python3Packages.progressbar2 ffmpeg
import datetime
import hashlib
import json
import logging
import os import os
import shutil import shutil
import statistics
import subprocess import subprocess
import sys import sys
import logging import tempfile
import time
import coloredlogs import coloredlogs
import progressbar import progressbar
import time
import hashlib
import tempfile
import json
import statistics
import datetime
coloredlogs.install(level="DEBUG", fmt="%(levelname)s %(message)s") coloredlogs.install(level="DEBUG", fmt="%(levelname)s %(message)s")
log = logging.getLogger() log = logging.getLogger()
@ -161,6 +164,7 @@ log.info(
) )
) )
# From https://stackoverflow.com/a/3431838 # From https://stackoverflow.com/a/3431838
def sha256(fname): def sha256(fname):
hash_sha256 = hashlib.sha256() hash_sha256 = hashlib.sha256()

View file

@ -1,5 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# FIXME
if [ "$(cat /etc/hostname)" = "curacao.geoffrey.frogeye.fr" ] if [ "$(cat /etc/hostname)" = "curacao.geoffrey.frogeye.fr" ]
then then
echo 10000 | sudo tee /sys/class/backlight/intel_backlight/brightness echo 10000 | sudo tee /sys/class/backlight/intel_backlight/brightness

View file

@ -1,4 +1,6 @@
#!/usr/bin/env sh #!/usr/bin/env nix-shell
#! nix-shell -i bash --pure
#! nix-shell -p bash docker gnugrep coreutils
# Find the dependent child image from an image # Find the dependent child image from an image

View file

@ -1,4 +1,7 @@
#!/usr/bin/env sh #!/usr/bin/env nix-shell
#! nix-shell -i bash --pure
#! nix-shell -p bash docker
docker unpause $(docker ps -q) docker unpause $(docker ps -q)
docker kill $(docker ps -q) docker kill $(docker ps -q)
docker container prune -f docker container prune -f

View file

@ -1,4 +1,6 @@
#!/usr/bin/bash #!/usr/bin/env nix-shell
#! nix-shell -i bash --pure
#! nix-shell -p bash tree coreutils
# Remplace le contenu d'un dossier par un fichier texte # Remplace le contenu d'un dossier par un fichier texte
# relatant son arborescense # relatant son arborescense

19
scripts/emergency-clean Executable file
View file

@ -0,0 +1,19 @@
#!/usr/bin/env nix-shell
#! nix-shell -i bash --pure
#! nix-shell -p bash
# Clears everything it can to save space
rm -rf $HOME/.cache
if command -v pacman > /dev/null; then
sudo pacman -Scc
fi
if command -v apt-get > /dev/null; then
sudo apt-get clean
fi
if command -v nix-store > /dev/null; then
sudo journalctl --vacuum-size=100M
fi
if command -v journalctl > /dev/null; then
sudo journalctl --vacuum-size=100M
fi

View file

@ -1,4 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env nix-shell
#! nix-shell -i bash --pure
#! nix-shell -p bash git gnugrep coreutils findutils
# From https://stackoverflow.com/a/2083563 # From https://stackoverflow.com/a/2083563

View file

@ -1,4 +1,6 @@
#!/usr/bin/bash #!/usr/bin/env nix-shell
#! nix-shell -i bash --pure
#! nix-shell -p bash coreutils git gnused
# Replace git folders with a placeholder containing the remote and the commit # Replace git folders with a placeholder containing the remote and the commit

View file

@ -1,5 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# FIXME
if [ "$(cat /etc/hostname)" = "curacao.geoffrey.frogeye.fr" ] if [ "$(cat /etc/hostname)" = "curacao.geoffrey.frogeye.fr" ]
then then
echo 40000 | sudo tee /sys/class/backlight/intel_backlight/brightness echo 40000 | sudo tee /sys/class/backlight/intel_backlight/brightness

Some files were not shown because too many files have changed in this diff Show more