Compare commits
No commits in common. "main" and "master" have entirely different histories.
|
@ -1,8 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
dir="$(realpath $(dirname ${BASH_SOURCE[0]})/../..)"
|
|
||||||
_nix_direnv_force_reload=1 direnv exec "$dir" true
|
|
||||||
direnv reload
|
|
||||||
# direnv reload updates the mtime of .envrc. Also update the timestamp of the
|
|
||||||
# profile_rc file to keep track that we actually are up to date.
|
|
||||||
touch $dir/.direnv/{nix,flake}-profile-*.rc
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +0,0 @@
|
||||||
.direnv/
|
|
22
LICENSE
Normal file
22
LICENSE
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2016-2021 Henrik Lissner.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||||
|
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
|
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
161
README.md
161
README.md
|
@ -1,79 +1,128 @@
|
||||||
[![NixOS](https://img.shields.io/badge/NixOS-unstable-blue.svg?style=flat&logo=NixOS&logoColor=white)](https://nixos.org)
|
[![Made with Doom Emacs](https://img.shields.io/badge/Made_with-Doom_Emacs-blueviolet.svg?style=flat-square&logo=GNU%20Emacs&logoColor=white)](https://github.com/hlissner/doom-emacs)
|
||||||
[![MIT License](https://img.shields.io/github/license/divnix/devos)][mit]
|
[![NixOS Unstable](https://img.shields.io/badge/NixOS-unstable-blue.svg?style=flat-square&logo=NixOS&logoColor=white)](https://nixos.org)
|
||||||
|
|
||||||
> #### ⚠ Advisory ⚠
|
**Hey,** you. You're finally awake. You were trying to configure your OS declaratively, right? Walked right into that NixOS ambush, same as us, and those dotfiles over there.
|
||||||
> Do you remember how you got here? Where were you going? What were you leaving behind?
|
|
||||||
> Are you sure you want to go down this rabbit hole, Alice?
|
|
||||||
|
|
||||||
## Getting Started
|
<img src="/../screenshots/alucard/fakebusy.png" width="100%" />
|
||||||
This is my personal deployment hub. I configure all my personal servers from this repo. Good luck if you're looking to graft this.
|
|
||||||
You'll probably want to run some `install.sh` that will configure the base NixOS system. Some of them aren't in a good state.
|
|
||||||
From there you can either install the host you want with `sudo nixos-rebuild switch --flake .#<host>` or enter the cockpit with `nix develop` and deploy servers remotely through `deploy`
|
|
||||||
|
|
||||||
|
|
||||||
## Personal dotfiles
|
|
||||||
<img src="./screenshots/fakebusy.png" width="100%" />
|
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<span><img src="./screenshots/desktop.png" height="178" /></span>
|
<span><img src="/../screenshots/alucard/desktop.png" height="178" /></span>
|
||||||
<span><img src="./screenshots/rofi.png" height="178" /></span>
|
<span><img src="/../screenshots/alucard/rofi.png" height="178" /></span>
|
||||||
<span><img src="./screenshots/firefox.png" height="178" /></span>
|
<span><img src="/../screenshots/alucard/tiling.png" height="178" /></span>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
------
|
------
|
||||||
|
|
||||||
| | |
|
| | |
|
||||||
|----------------|----------------------------------------------------------|
|
|-|-|
|
||||||
| **Shell:** | bash / zsh |
|
| **Shell:** | zsh + zgen |
|
||||||
| **DM:** | lightdm + lightdm-mini-greeter |
|
| **DM:** | lightdm + lightdm-mini-greeter |
|
||||||
| **WM:** | bspwm + polybar |
|
| **WM:** | bspwm + polybar |
|
||||||
| **Editor:** | nvim |
|
| **Editor:** | [Doom Emacs][doom-emacs] (and occasionally [vim]) |
|
||||||
| **Terminal:** | kitty |
|
| **Terminal:** | st |
|
||||||
| **Launcher:** | rofi |
|
| **Launcher:** | rofi |
|
||||||
| **Browser:** | firefox |
|
| **Browser:** | firefox |
|
||||||
| **GTK Theme:** | [Ant Dracula](https://github.com/EliverLara/Ant-Dracula) |
|
| **GTK Theme:** | [Ant Dracula](https://github.com/EliverLara/Ant-Dracula) |
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
## Quick start
|
||||||
|
|
||||||
### Status: Tectonic
|
1. Yoink the latest build of [NixOS 21.05][nixos].
|
||||||
The planet is cooling down, and approaching stability. It is well understood, and the continents are not expected to change much more. One should expect some more localized changes, and further development.
|
2. Boot into the installer.
|
||||||
|
3. Do your partitions and mount your root to `/mnt` ([for example](hosts/kuro/README.org))
|
||||||
|
4. Install these dotfiles:
|
||||||
|
5. `nix-shell -p git nixFlakes`
|
||||||
|
6. `git clone https://github.com/hlissner/dotfiles /mnt/etc/nixos`
|
||||||
|
7. Install NixOS: `nixos-install --root /mnt --flake /mnt/etc/nixos#XYZ`, where
|
||||||
|
`XYZ` is [the host you want to install](hosts/). Use `#generic` for a
|
||||||
|
simple, universal config, or create a sub-directory in `hosts/` for your device. See [host/kuro] for an example.
|
||||||
|
8. Reboot!
|
||||||
|
9. Change your `root` and `$USER` passwords!
|
||||||
|
|
||||||
## Shoulders
|
## Management
|
||||||
Summoning is powerful magic, and cannot be created in isolation. It stands on the [shoulders of the
|
|
||||||
following giants][giants]:
|
|
||||||
|
|
||||||
### :onion: — like the layers of an onion
|
And I say, `bin/hey`. [What's going on?](http://hemansings.com/)
|
||||||
- [`serokell/deploy-rs`][deploy]
|
|
||||||
- [`NixOS/nixpkgs`][nixpkgs]
|
|
||||||
- [`ryantm/agenix`][agenix]
|
|
||||||
- [`direnv/direnv`][direnv]
|
|
||||||
|
|
||||||
:heart:
|
```
|
||||||
|
Usage: hey [global-options] [command] [sub-options]
|
||||||
|
|
||||||
### But Why?
|
Available Commands:
|
||||||
The future is more uncertain than ever. Make dependable what you can, in whatever way you know how.
|
check Run 'nix flake check' on your dotfiles
|
||||||
Stop doing it by yourself, unless we learn to work with one another will we be able to grow long term solutions.
|
gc Garbage collect & optimize nix store
|
||||||
|
generations Explore, manage, diff across generations
|
||||||
|
help [SUBCOMMAND] Show usage information for this script or a subcommand
|
||||||
|
rebuild Rebuild the current system's flake
|
||||||
|
repl Open a nix-repl with nixpkgs and dotfiles preloaded
|
||||||
|
rollback Roll back to last generation
|
||||||
|
search Search nixpkgs for a package
|
||||||
|
show [ARGS...]
|
||||||
|
ssh HOST [COMMAND] Run a bin/hey command on a remote NixOS system
|
||||||
|
swap PATH [PATH...] Recursively swap nix-store symlinks with copies (or back).
|
||||||
|
test Quickly rebuild, for quick iteration
|
||||||
|
theme THEME_NAME Quickly swap to another theme module
|
||||||
|
update [INPUT...] Update specific flakes or all of them
|
||||||
|
upgrade Update all flakes and rebuild system
|
||||||
|
|
||||||
Managing servers by hand sucks, k8s doesn't allow me to transitively deploy all my configuration to multiple personal machines, and ansible wasn't good enough.
|
Options:
|
||||||
|
-d, --dryrun Don't change anything; preform dry run
|
||||||
|
-D, --debug Show trace on nix errors
|
||||||
|
-f, --flake URI Change target flake to URI
|
||||||
|
-h, --help Display this help, or help for a specific command
|
||||||
|
-i, -A, -q, -e, -p Forward to nix-env
|
||||||
|
```
|
||||||
|
|
||||||
You probably don't want to use nixOS, I'm a masocist
|
## Frequently asked questions
|
||||||
|
|
||||||
### Grafts
|
+ **Why NixOS?**
|
||||||
https://github.com/hlissner/dotfiles
|
|
||||||
|
|
||||||
# License
|
Because declarative, generational, and immutable configuration is a godsend
|
||||||
DevOS is licensed under the [MIT License][mit].
|
when you have a fleet of computers to manage.
|
||||||
|
|
||||||
[community]: https://github.com/divnix/devos/tree/community
|
+ **How do you manage secrets?**
|
||||||
[deploy]: https://github.com/serokell/deploy-rs
|
|
||||||
[dotfiles]: https://github.com/hlissner/dotfiles
|
|
||||||
[flake-doc]: https://github.com/NixOS/nix/blob/master/src/nix/flake.md
|
|
||||||
[flakes]: https://nixos.wiki/wiki/Flakes
|
|
||||||
[giants]: https://en.wikipedia.org/wiki/Standing_on_the_shoulders_of_giants
|
|
||||||
[home-manager]: https://nix-community.github.io/home-manager
|
|
||||||
[mit]: https://mit-license.org
|
|
||||||
[nix]: https://nixos.org/manual/nix/stable
|
|
||||||
[nixos]: https://nixos.org/manual/nixos/stable
|
|
||||||
[nixpkgs]: https://github.com/NixOS/nixpkgs
|
|
||||||
|
|
||||||
|
With [agenix].
|
||||||
|
|
||||||
|
+ **How do I change the default username?**
|
||||||
|
|
||||||
|
1. Set the `USER` environment variable the first time you run `nixos-install`:
|
||||||
|
`USER=myusername nixos-install --root /mnt --flake /path/to/dotfiles#XYZ`
|
||||||
|
2. Or change `"hlissner"` in modules/options.nix.
|
||||||
|
|
||||||
|
+ **Why did you write bin/hey?**
|
||||||
|
|
||||||
|
I envy Guix's CLI and want similar for NixOS, but its toolchain is spread
|
||||||
|
across many commands, none of which are as intuitive: `nix`,
|
||||||
|
`nix-collect-garbage`, `nixos-rebuild`, `nix-env`, `nix-shell`.
|
||||||
|
|
||||||
|
I don't claim `hey` is the answer, but everybody likes their own brew.
|
||||||
|
|
||||||
|
+ **How 2 flakes?**
|
||||||
|
|
||||||
|
Would it be the NixOS experience if I gave you all the answers in one,
|
||||||
|
convenient place?
|
||||||
|
|
||||||
|
No. Suffer my pain:
|
||||||
|
|
||||||
|
+ [A three-part tweag article that everyone's read.](https://www.tweag.io/blog/2020-05-25-flakes/)
|
||||||
|
+ [An overengineered config to scare off beginners.](https://github.com/nrdxp/nixflk)
|
||||||
|
+ [A minimalistic config for scared beginners.](https://github.com/colemickens/nixos-flake-example)
|
||||||
|
+ [A nixos wiki page that spells out the format of flake.nix.](https://nixos.wiki/wiki/Flakes)
|
||||||
|
+ [Official documentation that nobody reads.](https://nixos.org/learn.html)
|
||||||
|
+ [Some great videos on general nixOS tooling and hackery.](https://www.youtube.com/channel/UC-cY3DcYladGdFQWIKL90SQ)
|
||||||
|
+ A couple flake configs that I
|
||||||
|
[may](https://github.com/LEXUGE/nixos)
|
||||||
|
[have](https://github.com/bqv/nixrc)
|
||||||
|
[shamelessly](https://git.sr.ht/~dunklecat/nixos-config/tree)
|
||||||
|
[rummaged](https://github.com/utdemir/dotfiles)
|
||||||
|
[through](https://github.com/purcell/dotfiles).
|
||||||
|
+ [Some notes about using Nix](https://github.com/justinwoo/nix-shorts)
|
||||||
|
+ [What helped me figure out generators (for npm, yarn, python and haskell)](https://myme.no/posts/2020-01-26-nixos-for-development.html)
|
||||||
|
+ [What y'all will need when Nix drives you to drink.](https://www.youtube.com/watch?v=Eni9PPPPBpg)
|
||||||
|
|
||||||
|
|
||||||
|
[doom-emacs]: https://github.com/hlissner/doom-emacs
|
||||||
|
[vim]: https://github.com/hlissner/.vim
|
||||||
|
[nixos]: https://releases.nixos.org/?prefix=nixos/unstable/
|
||||||
|
[host/kuro]: https://github.com/hlissner/dotfiles/tree/master/hosts/kuro
|
||||||
|
[agenix]: https://github.com/ryantm/agenix
|
||||||
|
|
8
bin/autoclicker
Executable file
8
bin/autoclicker
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
xdotool mousedown 1
|
||||||
|
sleep 0.01
|
||||||
|
xdotool mouseup 1
|
||||||
|
sleep 0.01
|
||||||
|
done
|
47
bin/bspwm/focus
Executable file
47
bin/bspwm/focus
Executable file
|
@ -0,0 +1,47 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Script: bspc-focus
|
||||||
|
# Author: Henrik Lissner
|
||||||
|
# Usage:
|
||||||
|
# bspc-focus [-m] (west|south|north|east)
|
||||||
|
# bspc-focus south
|
||||||
|
# bspc-focus -m west
|
||||||
|
#
|
||||||
|
# Focus the next window in direction. If -m is supplied, jump to the next
|
||||||
|
# monitor in that direction.
|
||||||
|
#
|
||||||
|
# The behavior of the base 'bspc node -f' is odd when crossing screens. It will
|
||||||
|
# focus the last selected window on that screen, rather than the window on the
|
||||||
|
# connecting edge, which is unintuitive.
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
leap=
|
||||||
|
if [[ $1 == -m ]]; then
|
||||||
|
leap=1; shift
|
||||||
|
fi
|
||||||
|
dir=$1
|
||||||
|
opposite=
|
||||||
|
|
||||||
|
case $dir in
|
||||||
|
west) opposite=east ;;
|
||||||
|
east) opposite=west ;;
|
||||||
|
north) opposite=north ;;
|
||||||
|
south) opposite=south ;;
|
||||||
|
*) >&2 echo "Not a valid direction: $dir"
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [[ -n $leap ]]; then
|
||||||
|
# jump to monitor in direction
|
||||||
|
bspc monitor -f "$dir"
|
||||||
|
else
|
||||||
|
# jump to window in direction (unless at edge of last monitor)
|
||||||
|
if ! bspc node -f "$dir.local"; then
|
||||||
|
if [[ $(bspc query -M -m "$dir") ]]; then
|
||||||
|
bspc monitor -f "$dir"
|
||||||
|
# Ensure we start at the edge of the window we arrived from
|
||||||
|
while bspc node -f "$opposite.local"; do :; done
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
21
bin/bspwm/presel
Executable file
21
bin/bspwm/presel
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/usr/bin/env cached-nix-shell
|
||||||
|
#! nix-shell -i zsh -p jshon
|
||||||
|
|
||||||
|
# Script: bspc-presel
|
||||||
|
# Author: Henrik Lissner
|
||||||
|
# Usage:
|
||||||
|
# bspc-presel RATIO
|
||||||
|
# bspc-presel 0.2
|
||||||
|
#
|
||||||
|
# Wrote this to invert the ratio on east/south-bound preselections. In English
|
||||||
|
# that means bspc node -p 0.2 should resize the preselection to 20%, whether or
|
||||||
|
# not it's on the west or east side of the window (or north or south side),
|
||||||
|
# which isn't the case by default.
|
||||||
|
#
|
||||||
|
# NOTE: We use zsh for this because bash chokes on float arithmetic.
|
||||||
|
|
||||||
|
ratio="$1"
|
||||||
|
case "$(bspc query -T -n focused | jshon -e presel -e splitDir | tr -d \")" in
|
||||||
|
west|north) bspc node -o $ratio ;;
|
||||||
|
east|south) bspc node -o $(( 1.0 - ratio )) ;;
|
||||||
|
esac
|
101
bin/bspwm/subtract-presel
Executable file
101
bin/bspwm/subtract-presel
Executable file
|
@ -0,0 +1,101 @@
|
||||||
|
#!/usr/bin/env cached-nix-shell
|
||||||
|
#! nix-shell -i zsh -p jshon wmutils-core
|
||||||
|
|
||||||
|
# Script: bspc-subtract-presel
|
||||||
|
# Author: Henrik Lissner (w/ credit to @Chrysostomus)
|
||||||
|
# Usage:
|
||||||
|
# bspc-resize-to-presel
|
||||||
|
#
|
||||||
|
# (Adapted from Chrysostomus/bspwm-scripts/bin/resizetopresel.sh)
|
||||||
|
#
|
||||||
|
# This script resizes the current window by "subtracting" the bspwm preselection
|
||||||
|
# on the current node. In English, that means this will reduce the window's
|
||||||
|
# width by 20%:
|
||||||
|
#
|
||||||
|
# bspc node -p east -o 0.2 && bspc-subtract-presel
|
||||||
|
#
|
||||||
|
# NOTE: We use zsh for this because bash chokes on float arithmetic.
|
||||||
|
|
||||||
|
# Check if the brother node is a receptacle
|
||||||
|
if [[ $(bspc query -T -n @brother/ | jshon -e client) = null ]]; then
|
||||||
|
# Yep, it's a receptacle. Get the real dimensions
|
||||||
|
eval $(grep "window_gap" ~/.config/bspwm/rc.d/theme | tr -cd [0-9])
|
||||||
|
# Get orientation
|
||||||
|
wattr xywh $(pfw) | read focused_x focused_y focused_width focused_height
|
||||||
|
receptacle_y=$(bspc query -T -n @brother/ | jshon -e rectangle -e y)
|
||||||
|
if [[ "$focused_y" -eq "$receptacle_y" ]]; then
|
||||||
|
receptacle_width=$(bspc query -T -n @brother/ | jshon -e rectangle -e width)
|
||||||
|
receptacle_x=$(bspc query -T -n @brother/ | jshon -e rectangle -e x)
|
||||||
|
# receptacle and window have the same height, so they are side by side
|
||||||
|
if [[ receptacle_x -gt focused_x ]]; then
|
||||||
|
echo "receptacle is right of the window"
|
||||||
|
# get the true window dimension
|
||||||
|
true_dim=$(( receptacle_width + gap ))
|
||||||
|
# kill the repectacle
|
||||||
|
for i in $(bspc query -N -n .leaf.!window.local); do bspc node $i -k; done
|
||||||
|
# resize the window
|
||||||
|
bspc node @east -r -$true_dim || bspc node @west -r +$true_dim
|
||||||
|
else
|
||||||
|
echo "receptacle is left of the window"
|
||||||
|
# get the true window dimension
|
||||||
|
true_dim=$(( receptacle_width + gap ))
|
||||||
|
# kill the repectacle
|
||||||
|
for i in $(bspc query -N -n .leaf.!window.local); do bspc node $i -k; done
|
||||||
|
# resize the window
|
||||||
|
bspc node @west -r +$true_dim || bspc node @east -r -$true_dim
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
receptacle_height=$(bspc query -T -n @brother/ | jshon -e rectangle -e height)
|
||||||
|
# width is necessarily equal if height is not, because the nodes are
|
||||||
|
# brothers Window are on the top of each other
|
||||||
|
if [[ receptacle_y -gt focused_y ]]; then
|
||||||
|
echo "receptacle is below the window"
|
||||||
|
# get the true window dimension
|
||||||
|
true_dim=$(( receptacle_height + gap))
|
||||||
|
# kill the repectacle
|
||||||
|
for i in $(bspc query -N -n .leaf.!window.local); do bspc node $i -k; done
|
||||||
|
# resize the window
|
||||||
|
bspc node @south -r -$true_dim || bspc node @north -r +$true_dim
|
||||||
|
else
|
||||||
|
echo "receptacle is above the window"
|
||||||
|
# get the true window dimension
|
||||||
|
true_dim=$(( receptacle_height + gap))
|
||||||
|
# kill the repectacle
|
||||||
|
for i in $(bspc query -N -n .leaf.!window.local); do bspc node $i -k; done
|
||||||
|
# resize the window
|
||||||
|
bspc node @north -r +$true_dim || bspc node @south -r -$true_dim
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
echo $true_dim
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If the focused window is not preselected, do nothing
|
||||||
|
[[ "$(bspc query -T -n focused | jshon -e presel)" == null ]] && exit 0
|
||||||
|
|
||||||
|
dir=$(bspc query -T -n focused | jshon -e presel -e splitDir | tr -d \")
|
||||||
|
ratio=$(bspc query -T -n focused | jshon -e presel -e splitRatio)
|
||||||
|
case "$dir" in
|
||||||
|
west)
|
||||||
|
cur=$(bspc query -T -n focused | jshon -e rectangle -e width)
|
||||||
|
bspc node @west -r +$((${cur}*${ratio})) || \
|
||||||
|
bspc node @east -r -$((${cur}*${ratio}))
|
||||||
|
;;
|
||||||
|
east)
|
||||||
|
cur=$(bspc query -T -n focused | jshon -e rectangle -e width)
|
||||||
|
bspc node @east -r -$((${cur}*(1.0-${ratio}))) || \
|
||||||
|
bspc node @west -r +$((${cur}*${ratio}))
|
||||||
|
;;
|
||||||
|
|
||||||
|
north)
|
||||||
|
cur=$(bspc query -T -n focused | jshon -e rectangle -e height)
|
||||||
|
bspc node @north -r +$((${cur}*${ratio})) || \
|
||||||
|
bspc node @south -r -$((${cur}*${ratio}))
|
||||||
|
;;
|
||||||
|
south)
|
||||||
|
cur=$(bspc query -T -n focused | jshon -e rectangle -e height)
|
||||||
|
bspc node @south -r -$(( ${cur} * (1.0 - ${ratio}) )) || \
|
||||||
|
bspc node @north -r +$(( ${cur} * ${ratio} ))
|
||||||
|
esac
|
||||||
|
|
||||||
|
bspc node -p cancel
|
48
bin/bspwm/swap
Executable file
48
bin/bspwm/swap
Executable file
|
@ -0,0 +1,48 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Script: bspc-swap
|
||||||
|
# Author: Henrik Lissner
|
||||||
|
# Usage:
|
||||||
|
# bspc-swap [-m] (west|south|north|east)
|
||||||
|
# bspc-swap south
|
||||||
|
# bspc-swap -m west
|
||||||
|
#
|
||||||
|
# Swaps current window with the window in a direction. If -m is set, move window
|
||||||
|
# to the next monitor in that direction.
|
||||||
|
#
|
||||||
|
# The behavior of the base 'bspc node -s' is odd when crossing screens. It will
|
||||||
|
# swaps with the last selected window on that screen, rather than the window on
|
||||||
|
# the connecting edge, which is unintuitive.
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
leap=
|
||||||
|
if [[ $1 == -m ]]; then
|
||||||
|
leap=1
|
||||||
|
dir=$2
|
||||||
|
else
|
||||||
|
dir=$1
|
||||||
|
fi
|
||||||
|
|
||||||
|
case $dir in west|south|north|east) ;;
|
||||||
|
*) >&2 echo "Not a valid direction: $dir"
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [[ -n $leap ]]; then
|
||||||
|
# move window to monitor in direction
|
||||||
|
old_id=$(bspc query -N -n focused)
|
||||||
|
if [[ $(bspc query -M -m "$dir") ]]; then
|
||||||
|
bspc node -m "$dir"
|
||||||
|
bspc node -f "$old_id"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# move window in direction
|
||||||
|
old_id=$(bspc query -N -n focused)
|
||||||
|
if bspc node -s "$dir.local"; then
|
||||||
|
bspc node -f "$old_id"
|
||||||
|
elif [[ -n $(bspc query -M -m "$dir") ]]; then
|
||||||
|
bspc node -m "$dir"
|
||||||
|
bspc node -f "$old_id"
|
||||||
|
fi
|
||||||
|
fi
|
385
bin/hey
Executable file
385
bin/hey
Executable file
|
@ -0,0 +1,385 @@
|
||||||
|
#!/usr/bin/env cached-nix-shell
|
||||||
|
#! nix-shell -p ruby_2_7 -i "ruby -S" --quiet
|
||||||
|
|
||||||
|
DESC = <<~DESC
|
||||||
|
Nix's CLI has a poor user story, in my opinion. It could be better; Guix is a
|
||||||
|
good role model here. I wrote this script to abstract the more common
|
||||||
|
workflows, like rebuilding (nixos-rebuild), cleaning up (nix-collect-garbage),
|
||||||
|
package/env management (nix-env), updating, rolling back, etc. As well as some
|
||||||
|
utility operations (like managing generations, building remotely, or swapping
|
||||||
|
themes on the fly).
|
||||||
|
|
||||||
|
Because I can go months without shaving yaks in NixOS, exact flags or details
|
||||||
|
are often and easily forgotten. This spares me that fumbling phase and also
|
||||||
|
serves as a reference.
|
||||||
|
|
||||||
|
Note: `hey` can also be used as a shortcut for nix-env:
|
||||||
|
|
||||||
|
hey -q
|
||||||
|
hey -iA nixos.htop
|
||||||
|
hey -e htop
|
||||||
|
DESC
|
||||||
|
|
||||||
|
require 'shellwords'
|
||||||
|
require 'optparse'
|
||||||
|
|
||||||
|
module Hey
|
||||||
|
extend self
|
||||||
|
Command = Struct.new(:name, :desc, :args, :opts, :fn)
|
||||||
|
|
||||||
|
@@opts = {}
|
||||||
|
@@alias = {}
|
||||||
|
@@commands = {}
|
||||||
|
@@cli = nil
|
||||||
|
def self.defcmd names, &block
|
||||||
|
names = (names.kind_of?(Array) ? names : [names]).map(&:to_s)
|
||||||
|
names.drop(1).each { |n| @@alias[n] = names.first }
|
||||||
|
cli = Command.new names.first, [], []
|
||||||
|
cli.opts = OptionParser.new do |opt|
|
||||||
|
opt.banner = "Usage: #{opt.program_name} #{cli.name} [options]"
|
||||||
|
opt.separator "\nOptions:"
|
||||||
|
opt.on_tail('-h', '--help', 'Prints this help') { puts opt; exit }
|
||||||
|
end
|
||||||
|
@@cli = cli
|
||||||
|
fn = block.call cli
|
||||||
|
cli.fn = lambda do |args|
|
||||||
|
begin
|
||||||
|
cli.opts.banner +=
|
||||||
|
(cli.args ? " #{cli.args.join ' '}" : "") +
|
||||||
|
(cli.desc ? "\n\n#{cli.desc[0]}\n\n#{cli.desc[1..].join "\n"}" : "")
|
||||||
|
cli.opts.order!(args, into: @@opts)
|
||||||
|
fn.call args
|
||||||
|
ensure @@cli = nil end
|
||||||
|
end
|
||||||
|
@@commands[cli.name] = @@cli
|
||||||
|
end
|
||||||
|
def self.opts(*args) @@cli.opts.on(*args) end
|
||||||
|
def self.args(*args) @@cli.args = args end
|
||||||
|
def self.desc(*args) @@cli.desc = args end
|
||||||
|
def self.sh(args, sudo: false, noerror: false)
|
||||||
|
raise ArgumentError unless args.kind_of?(Array)
|
||||||
|
args.unshift('sudo') if sudo
|
||||||
|
args.compact!
|
||||||
|
if @@opts[:dryrun]
|
||||||
|
print "#{args}\n"
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
result = system "#{args.shelljoin} 2>&1"
|
||||||
|
exit($?.exitstatus) unless noerror or result
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
end
|
||||||
|
def self.rebuild(*args, sudo: false, host: nil)
|
||||||
|
host ||= ENV['HOST'] || `hostname`.rstrip
|
||||||
|
sh ["nixos-rebuild",
|
||||||
|
"--flake", "#{@@opts[:flake]}##{host}",
|
||||||
|
"--option", "pure-eval", "no",
|
||||||
|
*args], sudo: sudo
|
||||||
|
end
|
||||||
|
|
||||||
|
#
|
||||||
|
defcmd :repl do
|
||||||
|
desc "Open a nix-repl with nixpkgs and dotfiles preloaded"
|
||||||
|
lambda do |args|
|
||||||
|
tempfile = '/tmp/dotfiles-repl.nix'
|
||||||
|
File.write('/tmp/dotfiles-repl.nix', "(builtins.getFlake \"#{@@opts[:flake]}\")")
|
||||||
|
begin
|
||||||
|
sh ["nix", "repl", "<nixpkgs>", tempfile, *args]
|
||||||
|
ensure
|
||||||
|
File.delete tempfile
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
defcmd [:check, :ch] do
|
||||||
|
desc "Run 'nix flake check' on your dotfiles"
|
||||||
|
lambda do |args|
|
||||||
|
sh ["nix", "flake", "check", @@opts[:flake]]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
defcmd :show do
|
||||||
|
desc "[ARGS...]", "Run 'nix flake show' on your dotfiles"
|
||||||
|
lambda do |args|
|
||||||
|
sh ["nix", "flake", "show", @@opts[:flake]]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
defcmd :theme do
|
||||||
|
desc 'Quickly swap to another theme module'
|
||||||
|
args "THEME_NAME"
|
||||||
|
lambda do |args|
|
||||||
|
ENV["THEME"] = args.shift
|
||||||
|
rebuild "--fast", "test"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
defcmd [:test, :t] do
|
||||||
|
desc "Quickly rebuild, for quick iteration"
|
||||||
|
lambda do |args|
|
||||||
|
rebuild "--fast", "test", *args
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
defcmd [:rebuild, :re] do
|
||||||
|
desc "Rebuild the current system's flake"
|
||||||
|
opts '--build-host HOST', "Where to build the flake"
|
||||||
|
opts '--target-host HOST', "Where to deploy the built derivations"
|
||||||
|
opts '--host HOST', "The target nixosConfiguration to build"
|
||||||
|
opts '--user', "Rebuild as user, rather than root"
|
||||||
|
opts '--fast', "Equivalent to --no-build-nix --show-trace for quick rebuilding"
|
||||||
|
lambda do |args|
|
||||||
|
Dir.chdir(@@opts[:flake]) do
|
||||||
|
args = ["switch"] unless args.length > 0
|
||||||
|
rebuild(*(@@opts[:"build-host"] ? ["--build-host", @@opts[:"build-host"]] : []),
|
||||||
|
*(@@opts[:"target-host"] ? ["--target-host", @@opts[:"target-host"]] : []),
|
||||||
|
@@opts[:fast] ? "--fast" : nil,
|
||||||
|
@@opts[:debug] ? "--show-trace" : nil,
|
||||||
|
*args,
|
||||||
|
sudo: !@@opts[:user],
|
||||||
|
host: @@opts[:host])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
defcmd :rollback do
|
||||||
|
desc "Roll back to last generation"
|
||||||
|
lambda do |_args|
|
||||||
|
rebuild "--rollback", "switch"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
defcmd [:update, :u] do
|
||||||
|
desc "Update specific flakes or all of them"
|
||||||
|
args "[INPUT...]"
|
||||||
|
lambda do |args|
|
||||||
|
if args.empty?
|
||||||
|
puts "Updating all flakes.."
|
||||||
|
sh ["nix", "flake", "update", @@opts[:flake]]
|
||||||
|
else
|
||||||
|
puts "Trying to update flakes: #{args.join ' '}"
|
||||||
|
sh ["nix", "flake", "lock"]
|
||||||
|
.concat(args.map { |f| [ "--update-input", f ]}.flatten)
|
||||||
|
.concat([@@opts[:flake]])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
defcmd [:upgrade, :up] do
|
||||||
|
desc "Update all flakes and rebuild system"
|
||||||
|
lambda do |_args|
|
||||||
|
update
|
||||||
|
rebuild :switch
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
defcmd [:search, :s] do
|
||||||
|
desc "Search nixpkgs for a package"
|
||||||
|
lambda do |args|
|
||||||
|
sh ["nix", "search", "nixpkgs", *args]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
defcmd :swap do
|
||||||
|
desc "Recursively swap nix-store symlinks with copies (or back).",
|
||||||
|
"The purpose is so you can have copies of your dotfiles that can be modified in",
|
||||||
|
"place (so you can iterate on them quickly instead of 'hey re'ing between",
|
||||||
|
"changes). Run again to restore the old link(s).\n",
|
||||||
|
"Warning: backup your copies, or they will be destroyed when restored!"
|
||||||
|
args "PATH", "[PATH...]"
|
||||||
|
lambda do |args|
|
||||||
|
for target in args
|
||||||
|
if File.directory? target
|
||||||
|
files = Dir.glob("#{target}/**/*.nix-store-backup")
|
||||||
|
if files.length > 0
|
||||||
|
puts "There are swapped files here. Unswapping!"
|
||||||
|
call :swap, *files
|
||||||
|
else
|
||||||
|
puts "Swapping files in #{target}"
|
||||||
|
call :swap, *(Dir.glob("#{target}/**/*")
|
||||||
|
.select { |f| File.symlink? f }
|
||||||
|
.select { |l| File.readlink(l).match '^/nix/store/' })
|
||||||
|
end
|
||||||
|
elsif File.file? "#{target}.nix-store-backup"
|
||||||
|
puts "Unswapping #{target}"
|
||||||
|
sh [:mv, '-i', "#{target}.nix-store-backup", target]
|
||||||
|
elsif File.file? target
|
||||||
|
puts "Swapping #{target}"
|
||||||
|
sh [:mv, target, "#{target}.nix-store-backup"]
|
||||||
|
sh [:cp, "#{target}.nix-store-backup", target]
|
||||||
|
else
|
||||||
|
puts "Not a valid target: #{target}"
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
defcmd :gc do
|
||||||
|
desc "Garbage collect & optimize nix store"
|
||||||
|
opts "-a", "--all", "GC both the user and system profiles"
|
||||||
|
opts "-s", "--system", "Only GC the system profile"
|
||||||
|
lambda do |_args|
|
||||||
|
if @@opts[:all] or @@opts[:system]
|
||||||
|
puts "Cleaning up your system profile..."
|
||||||
|
sh %w{nix-collect-garbage -d}, sudo: true
|
||||||
|
sh %w{nix-store --optimise}, sudo: true
|
||||||
|
# Clear out left-over secrets. The switch-to-configuration call below will
|
||||||
|
# regenerate them.
|
||||||
|
if File.exists?("/run/secrets/*")
|
||||||
|
sh %w{rm -rf /run/secrets/*}, sudo: true
|
||||||
|
end
|
||||||
|
# nix-collect-garbage is a Nix tool, not a NixOS tool. It won't delete old
|
||||||
|
# boot entries until you do a nixos-rebuild (which means we'll always have
|
||||||
|
# 2 boot entries at any time). Instead, we properly delete them by
|
||||||
|
# reloading the current environment.
|
||||||
|
sh %w{nix-env --delete-generations old --profile /nix/var/nix/profiles/system}, sudo: true
|
||||||
|
sh %w{/nix/var/nix/profiles/system/bin/switch-to-configuration switch}, sudo: true
|
||||||
|
end
|
||||||
|
if @@opts[:all] or not @@opts[:system]
|
||||||
|
puts "Cleaning up your user profile..."
|
||||||
|
sh %w{nix-collect-garbage -d}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
defcmd :ssh do
|
||||||
|
desc "Run a bin/hey command on a remote NixOS system",
|
||||||
|
"If COMMAND is one of switch, test, or boot (if omitted, 'test' is assumed),",
|
||||||
|
"that host's config is built locally and then copied to the remote over ssh.",
|
||||||
|
"This will prompt you for your root password, as it temporarily opens root ssh",
|
||||||
|
"access (via your existing ssh key) to the remote -- which is immediately removed",
|
||||||
|
"upon completion.",
|
||||||
|
"",
|
||||||
|
"If COMMAND is anything else, it merely runs 'nix run github:hlissner/dotfiles",
|
||||||
|
"-- COMMAND' on the rmeote."
|
||||||
|
args "HOST", "[COMMAND]"
|
||||||
|
opts '--host HOST', "The nixos config to build and deploy to HOST"
|
||||||
|
lambda do |args|
|
||||||
|
target, command = args.take(2)
|
||||||
|
command ||= "test"
|
||||||
|
if command.match(/switch|test|boot/)
|
||||||
|
puts "Enabling root ssh access on #{target}. Enter root password for remote system:"
|
||||||
|
if sh ["ssh", "-t", target,
|
||||||
|
"sudo mkdir -p /root/.ssh && sudo cp -f ~/.ssh/authorized_keys /root/.ssh/"],
|
||||||
|
noerror: true
|
||||||
|
begin
|
||||||
|
puts "Building #{@@opts[:flake]}##{@@opts[:host] || target} for #{target}"
|
||||||
|
call "rebuild", ["--user",
|
||||||
|
"--host", @@opts[:host] || target,
|
||||||
|
"--build-host", "localhost",
|
||||||
|
"--target-host", "root@#{target}",
|
||||||
|
command]
|
||||||
|
ensure
|
||||||
|
puts "Undoing root ssh access on #{target}"
|
||||||
|
sh ["ssh", "-t", "root@#{target}", "rm -f /root/.ssh/authorized_keys"]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
command = "nix run github:hlissner/dotfiles -- #{command}"
|
||||||
|
puts "Running '#{command}' on #{target}"
|
||||||
|
sh ["ssh", "-t", target, command]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# TODO Generalize this to nix profiles
|
||||||
|
defcmd [:generations, :gen] do
|
||||||
|
desc "Explore, manage, diff across generations"
|
||||||
|
opts '--diff FROM TO', "Diff profiles FROM with TO (numbers)"
|
||||||
|
opts '-r', '--remove PROFILE', "Delete PROFILE from history"
|
||||||
|
lambda do |args|
|
||||||
|
profile = "/nix/var/nix/profiles/system"
|
||||||
|
case args.shift
|
||||||
|
when "diff"
|
||||||
|
from, to = *args
|
||||||
|
if from == to
|
||||||
|
puts "Comparing the same profile! Aborting..."
|
||||||
|
exit 1
|
||||||
|
elsif [from, to].compact.select do |gen|
|
||||||
|
File.exists? "#{profile}-#{gen}-link" or
|
||||||
|
puts "Generation #{gen} does not exist!"
|
||||||
|
end.length != [from, to].compact.length
|
||||||
|
exit 2
|
||||||
|
end
|
||||||
|
from = from ? "#{profile}-#{from}-link" : profile
|
||||||
|
to = to ? "#{profile}-#{to}-link" : profile
|
||||||
|
fromDevs = `nix-store -q --references #{from}`.split
|
||||||
|
toDevs = `nix-store -q --references #{to}`.split
|
||||||
|
puts (fromDevs - toDevs).map { |d| "\e[31m-#{d}\e[0m" }
|
||||||
|
puts (toDevs - fromDevs).map { |d| "\e[32m+#{d}\e[0m" }
|
||||||
|
when /ls|list/
|
||||||
|
sh ["nix-env", "--list-generations", "--profile", profile], sudo: true
|
||||||
|
when "remove"
|
||||||
|
sh ["nix-env", "--delete-generations", "--profile", profile, *args], sudo: true
|
||||||
|
when "switch"
|
||||||
|
puts "Targeted rollback not supported yet" # TODO Is this true?
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class UsageError < StandardError; end
|
||||||
|
defcmd [:help, :h] do
|
||||||
|
desc "Show usage information for this script or a subcommand"
|
||||||
|
args "[SUBCOMMAND]"
|
||||||
|
lambda do |args|
|
||||||
|
raise UsageError unless args.first
|
||||||
|
call args.first, ["-h", *args.drop(1)]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
#
|
||||||
|
def self.call command, args
|
||||||
|
cmd = command.to_s
|
||||||
|
cmd = @@alias[cmd] while cmd and not @@commands.key?(cmd)
|
||||||
|
if cmd
|
||||||
|
@@commands[cmd].fn.call args
|
||||||
|
elsif command
|
||||||
|
puts "Couldn't recognize command '#{command}'"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
raise UsageError
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.run args=[]
|
||||||
|
opts = OptionParser.new do |opt|
|
||||||
|
opt.banner = "Usage: hey [global-options] [command] [sub-options]\n\n" + DESC
|
||||||
|
opt.separator "\n\nAvailable Commands:"
|
||||||
|
opt.separator (@@commands.values
|
||||||
|
.reject { |c| c.desc.empty? }
|
||||||
|
.sort { |a,b| a.name <=> b.name }
|
||||||
|
.map { |c| " %-22s %s\n" % ["#{c.name} #{c.args.join ' '}",
|
||||||
|
c.desc[0]]})
|
||||||
|
opt.separator "\nOptions:"
|
||||||
|
opt.on '-d', '--dryrun', "Don't change anything; preform dry run"
|
||||||
|
opt.on '-D', '--debug', "Show trace on nix errors"
|
||||||
|
opt.on '-f', '--flake URI', "Change target flake to URI"
|
||||||
|
opt.on '-h', '--help', "Display this help, or help for a specific command"
|
||||||
|
opt.on(*%w{-i -A -q -e -p}, "Forward to nix-env") { sh ["nix-env", *ARGV]; exit }
|
||||||
|
end
|
||||||
|
opts.order!(args, into: @@opts)
|
||||||
|
if @@opts[:flake] and @@opts[:flake].include? "#"
|
||||||
|
@@opts[:flake], @@opts[:host] = @@opts[:flake].split '#'
|
||||||
|
end
|
||||||
|
if not @@opts[:flake] or @@opts[:flake].empty?
|
||||||
|
@@opts[:flake] = File.expand_path('../', File.dirname(__FILE__))
|
||||||
|
end
|
||||||
|
|
||||||
|
begin
|
||||||
|
args.unshift("help") if @@opts[:help]
|
||||||
|
if args.length == 0
|
||||||
|
puts "Error: No command specified!"
|
||||||
|
puts
|
||||||
|
raise UsageError
|
||||||
|
else
|
||||||
|
call args.first, args.drop(1)
|
||||||
|
end
|
||||||
|
rescue UsageError
|
||||||
|
puts opts
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Hey.run ARGV.dup
|
72
bin/mov2gif
Executable file
72
bin/mov2gif
Executable file
|
@ -0,0 +1,72 @@
|
||||||
|
#!/usr/bin/env cached-nix-shell
|
||||||
|
#! nix-shell -i bash -p ffmpeg gifsicle
|
||||||
|
|
||||||
|
# Uses ffmpeg to convert a video file to a gif file. Optimizes the final result
|
||||||
|
# with gifsicle.
|
||||||
|
#
|
||||||
|
# Requires: ffmpeg gifsicle
|
||||||
|
#
|
||||||
|
# Example:
|
||||||
|
# mov2gif some-vid.mp4 output.gif
|
||||||
|
# mov2gif -f 10 -s 00:00:10 -t 00:00:05 some-vid.mp4 output.gif
|
||||||
|
|
||||||
|
set -e
|
||||||
|
PALETTE="/tmp/palette.png"
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
cat <<EOL
|
||||||
|
Usage: ${0##*/} [-fsSth] SOURCE_FILE [destfile]
|
||||||
|
|
||||||
|
-f [FPS] set frames per second
|
||||||
|
-s [hh:mm:ss] set starting time (like -ss in ffmpeg)
|
||||||
|
-S [W:H] set width/height (either can be -1 for auto)
|
||||||
|
-t [hh:mm:ss] set the duration to capture (like -t in ffmpeg)
|
||||||
|
-h this help
|
||||||
|
EOL
|
||||||
|
}
|
||||||
|
|
||||||
|
cleanup() { rm -f "$PALETTE"; }
|
||||||
|
trap cleanup EXIT
|
||||||
|
|
||||||
|
#
|
||||||
|
fps=30
|
||||||
|
while getopts hf:s:t:S: opt; do
|
||||||
|
case $opt in
|
||||||
|
f) fps="$OPTARG" ;;
|
||||||
|
s) start="-ss $OPTARG" ;;
|
||||||
|
S) scale=",scale=$OPTARG:flags=lanczos" ;;
|
||||||
|
t) duration="-t $OPTARG" ;;
|
||||||
|
h) usage
|
||||||
|
exit
|
||||||
|
;;
|
||||||
|
:) >&2 echo "$OPTARG requires an argument"
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
*) >&2 echo "Not a valid arg: $opt"
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
shift $((OPTIND-1))
|
||||||
|
|
||||||
|
#
|
||||||
|
if (($# == 0)); then
|
||||||
|
>&2 echo "No movie file specified"
|
||||||
|
exit
|
||||||
|
elif [[ ! -f $1 ]]; then
|
||||||
|
>&2 echo "$1 does not exist"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
src="$1"
|
||||||
|
dest="${2:-${src%.*}.gif}"
|
||||||
|
flags="fps=${fps}$scale"
|
||||||
|
|
||||||
|
# stats_mode=full favors motion, causing the resulting palette to better
|
||||||
|
# accomodate fades and transitions.
|
||||||
|
ffmpeg -v warning $start $duration -i "file:$src" -vf "$flags,palettegen=stats_mode=full" -y "$PALETTE"
|
||||||
|
ffmpeg -v warning $start $duration -i "file:$src" -i "$PALETTE" -lavfi "$flags [x]; [x][1:v] paletteuse" -y "$dest"
|
||||||
|
|
||||||
|
gifsicle -O3 "$dest" -o "$dest"
|
21
bin/myip
Executable file
21
bin/myip
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# Echos your local or WAN IP
|
||||||
|
|
||||||
|
if [[ $1 == -w ]]; then
|
||||||
|
wan=1
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n $wan ]]; then
|
||||||
|
dig +short myip.opendns.com @resolver1.opendns.com
|
||||||
|
else
|
||||||
|
IF=$(netstat -rn | awk '/^0.0.0.0/ {thif=substr($0,74,10); print thif;} /^default.*UG/ {thif=substr($0,65,10); print thif;}')
|
||||||
|
if command -v ifconfig >/dev/null; then
|
||||||
|
ifconfig ${NET_IF} | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'
|
||||||
|
elif command -v ip >/dev/null; then
|
||||||
|
ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/'
|
||||||
|
else
|
||||||
|
>&2 echo "No easy way to grab your IP"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
86
bin/optimimg
Executable file
86
bin/optimimg
Executable file
|
@ -0,0 +1,86 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
# Optimize image files (losslessly by default)
|
||||||
|
#
|
||||||
|
# Examples:
|
||||||
|
# imgoptim image.jpg image.png image.gif
|
||||||
|
# imgoptim directory_of_images/
|
||||||
|
# imgoptim directory_of_images/*.png
|
||||||
|
#
|
||||||
|
# Requires:
|
||||||
|
# PNGs: optipng, pngquant (lossy)
|
||||||
|
# JPGs: jpegtran, jpegoptim (lossy)
|
||||||
|
# GIFs: gifsicle
|
||||||
|
#
|
||||||
|
# Packages (same name on homebrew & arch linux)
|
||||||
|
# optipng [pngquant] libjpeg-turbo [jpegoptim] gifsicle
|
||||||
|
|
||||||
|
set -e
|
||||||
|
unset CDPATH
|
||||||
|
|
||||||
|
_usage() {
|
||||||
|
cat <<EOL
|
||||||
|
Usage: ${0:A:t} [-lh] IMAGE [IMAGE2 [IMAGE3 [...]]]
|
||||||
|
|
||||||
|
-l enable lossy compression
|
||||||
|
-h this help
|
||||||
|
EOL
|
||||||
|
}
|
||||||
|
|
||||||
|
_filesize() {
|
||||||
|
case $OSTYPE in
|
||||||
|
darwin*) stat -c%s "$1" ;;
|
||||||
|
*) stat --printf="%s" "$1" ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
while getopts hl opt; do
|
||||||
|
case $opt in
|
||||||
|
h) _usage; exit;;
|
||||||
|
l) lossy=1;;
|
||||||
|
:) >&2 echo "$OPTARG requires an argument"; _usage; exit 1;;
|
||||||
|
*) >&2 echo "Not a valid arg: $opt"; _usage; exit 1;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
shift $((OPTIND-1))
|
||||||
|
|
||||||
|
cmds=( optipng jpegtran gifsicle )
|
||||||
|
[[ -n $lossy ]] && cmds=( $cmds pngquant jpegoptim )
|
||||||
|
for cmd in ${cmds[@]}; do
|
||||||
|
if ! command -v $cmd >/dev/null; then
|
||||||
|
>&2 echo "$cmd isn't installed"
|
||||||
|
error=1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [[ -n $error ]]; then
|
||||||
|
>&2 echo "There were errors, aborting"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
for file in $@; do
|
||||||
|
if [[ -d $file ]]; then
|
||||||
|
imgoptim $file/*
|
||||||
|
elif [[ -f $file ]]; then
|
||||||
|
pre_size=$(_filesize "$file")
|
||||||
|
case ${file##*.} in
|
||||||
|
png)
|
||||||
|
[[ -n $lossy ]] && pngquant $file
|
||||||
|
optipng -nc -nb -o7 $file
|
||||||
|
;;
|
||||||
|
gif)
|
||||||
|
gifsicle --batch --optimize=3 "$file"
|
||||||
|
;;
|
||||||
|
jpg|jpeg)
|
||||||
|
[[ -n $lossy ]] && jpegoptim --max=90 "$file"
|
||||||
|
jpegtran -copy none -optimize -progressive -outfile "$file" "$file"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
printf "Unrecognized file '$file': ignored"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
post_size=$(_filesize "$file")
|
||||||
|
perc=$(echo "((${pre_size} - ${post_size}) / ${pre_size}) * 100" | bc -l)
|
||||||
|
printf "* %s: %d => %d (%.2f%% reduction)\n" "$file" "${pre_size}" "${post_size}" "$perc"
|
||||||
|
fi
|
||||||
|
done
|
36
bin/optimpdf
Executable file
36
bin/optimpdf
Executable file
|
@ -0,0 +1,36 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Compress pdf files using ghostscript.
|
||||||
|
#
|
||||||
|
# Defaults to 72 dpi.
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# pdfoptim SRC [TARGET] [DPI]
|
||||||
|
#
|
||||||
|
# Requires: ghostscript (gs)
|
||||||
|
|
||||||
|
optimize() {
|
||||||
|
# Adapted from Alfred Klomp's shrinkpdf script
|
||||||
|
# <http://alfredklomp.com/programming/shrinkpdf/>
|
||||||
|
gs -q -dNOPAUSE -dBATCH -dSAFER \
|
||||||
|
-sDEVICE=pdfwrite \
|
||||||
|
-dPDFSETTINGS=/screen \
|
||||||
|
-dCompatibilityLevel=1.3 \
|
||||||
|
-dEmbedAllFonts=true \
|
||||||
|
-dSubsetFonts=true \
|
||||||
|
-dAutoRotatePages=/None \
|
||||||
|
-dMonoImageResolution=$3 \
|
||||||
|
-dMonoImageDownsampleType=/Bicubic \
|
||||||
|
-dGrayImageResolution=$3 \
|
||||||
|
-dGrayImageDownsampleType=/Bicubic \
|
||||||
|
-dColorImageResolution=$3 \
|
||||||
|
-dColorImageDownsampleType=/Bicubic \
|
||||||
|
-sOutputFile="$2" \
|
||||||
|
"$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
src="$1"
|
||||||
|
dest="${2:--}"
|
||||||
|
dpi="${3:-72}"
|
||||||
|
|
||||||
|
optimize "$src" "$dest" "$dpi" || exit $?
|
5
bin/rofi/appmenu
Executable file
5
bin/rofi/appmenu
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
rofi -show drun \
|
||||||
|
-modi drun,run \
|
||||||
|
-show-icons \
|
||||||
|
-theme theme/appmenu.rasi
|
137
bin/rofi/browsermenu
Executable file
137
bin/rofi/browsermenu
Executable file
|
@ -0,0 +1,137 @@
|
||||||
|
#!/usr/bin/env cached-nix-shell
|
||||||
|
#! nix-shell -p ruby_2_7 rubyPackages_2_7.sqlite3 -i "ruby -S" --quiet
|
||||||
|
|
||||||
|
# Open your browser bookmarks or history in your default browser. Currently
|
||||||
|
# works with Firefox, Brave, and qutebrowser.
|
||||||
|
|
||||||
|
require 'shellwords'
|
||||||
|
require 'sqlite3'
|
||||||
|
require 'json'
|
||||||
|
require 'fileutils'
|
||||||
|
require 'cgi'
|
||||||
|
|
||||||
|
def rofi items, *args
|
||||||
|
cmd = [*%w{rofi -dmenu -theme theme/bookmarkmenu.rasi -markup-rows -multi-select -p browser -i}, *args]
|
||||||
|
IO.popen(cmd.compact.shelljoin, "r+") do |pipe|
|
||||||
|
pipe.puts items.keys.join "\n"
|
||||||
|
pipe.close_write
|
||||||
|
(pipe.gets || "").split "\n"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def db file, command
|
||||||
|
copy = "/tmp/browsermenu-db-#{File.basename(file)}"
|
||||||
|
begin
|
||||||
|
# Copy the sqlite database because history/bookmark info is usually small
|
||||||
|
# and may be locked by an open browser.
|
||||||
|
unless File.exists? copy
|
||||||
|
FileUtils.cp file, copy
|
||||||
|
FileUtils.chmod 0400, copy, verbose: true
|
||||||
|
end
|
||||||
|
results = []
|
||||||
|
db = SQLite3::Database.open copy
|
||||||
|
db.execute(command).each { |r| results.push r }
|
||||||
|
results
|
||||||
|
ensure
|
||||||
|
File.delete copy
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def walk_json children
|
||||||
|
result = []
|
||||||
|
for c in children
|
||||||
|
if c['children']
|
||||||
|
result += walk_json c['children']
|
||||||
|
else
|
||||||
|
result.push [ c['name'], c['url'] ]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
result
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_bookmarks browser
|
||||||
|
bookmarks = []
|
||||||
|
case browser
|
||||||
|
when :firefox
|
||||||
|
# In my nixos dotfiles I hardcode the default profile to $USER.profile,
|
||||||
|
# which makes this lookup easier, but means this script won't work on any
|
||||||
|
# other system.
|
||||||
|
user = ENV['USER']
|
||||||
|
["#{ENV['HOME']}/.mozilla/firefox/#{user}.default",
|
||||||
|
"#{ENV['XDG_CONFIG_HOME']}/firefox/.mozilla/firefox/#{user}.default",
|
||||||
|
"#{ENV['XDG_DATA_HOME']}/mozilla/firefox/#{user}.default"].each do |dir|
|
||||||
|
if Dir.exists? dir
|
||||||
|
db "#{dir}/places.sqlite",
|
||||||
|
["SELECT DISTINCT mb.title, mp.url FROM moz_bookmarks mb",
|
||||||
|
"INNER JOIN moz_places mp ON mp.id = mb.fk",
|
||||||
|
"WHERE mb.type = 1 AND mb.title IS NOT NULL",
|
||||||
|
"ORDER BY mp.frecency DESC",
|
||||||
|
"LIMIT 200"].join(' ')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
when :brave
|
||||||
|
f = File.read "#{ENV['XDG_CONFIG_HOME']}/BraveSoftware/Brave-Browser/Default/Bookmarks"
|
||||||
|
data = JSON.parse f
|
||||||
|
walk_json data["roots"]["bookmark_bar"]["children"]
|
||||||
|
when :qutebrowser
|
||||||
|
bookmarks = File.readlines "#{ENV['XDG_CONFIG_HOME']}/qutebrowser/bookmarks/urls"
|
||||||
|
bookmarks.map { |s| s.strip.split(' ', 2).reverse }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_history browser
|
||||||
|
case browser
|
||||||
|
when :firefox
|
||||||
|
# In my nixos dotfiles I hardcode the default profile to $USER.profile,
|
||||||
|
# which makes this lookup easier, but means this script won't work on any
|
||||||
|
# other system.
|
||||||
|
user = ENV['USER']
|
||||||
|
["#{ENV['HOME']}/.mozilla/firefox/#{user}.default",
|
||||||
|
"#{ENV['XDG_CONFIG_HOME']}/firefox/.mozilla/firefox/#{user}.default",
|
||||||
|
"#{ENV['XDG_DATA_HOME']}/mozilla/firefox/#{user}.default"].each do |dir|
|
||||||
|
if Dir.exists? dir
|
||||||
|
return db "#{dir}/places.sqlite",
|
||||||
|
["SELECT title, url",
|
||||||
|
"FROM moz_places",
|
||||||
|
"WHERE title<>''",
|
||||||
|
"ORDER BY last_visit_date DESC"].join(' ')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return []
|
||||||
|
when :brave
|
||||||
|
db "#{ENV['XDG_CONFIG_HOME']}/BraveSoftware/Brave-Browser/Default/History",
|
||||||
|
"SELECT title, url FROM urls GROUP BY url ORDER BY last_visit_time DESC LIMIT 200"
|
||||||
|
when :qutebrowser
|
||||||
|
db "#{ENV['XDG_DATA_HOME']}/qutebrowser/history.sqlite",
|
||||||
|
["SELECT title, url FROM History",
|
||||||
|
"WHERE title != ''",
|
||||||
|
"GROUP BY url",
|
||||||
|
"ORDER BY atime DESC"].join(' ')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def list urls
|
||||||
|
items = urls.map do |x|
|
||||||
|
x.map! { |x| CGI.escapeHTML x }
|
||||||
|
[x[0].empty? ?
|
||||||
|
"<b>#{x[1]}</b>" :
|
||||||
|
"<b>#{x[0]}</b> <span size=\"x-small\">#{x[1]}</span>",
|
||||||
|
x[1]]
|
||||||
|
end.to_h
|
||||||
|
selected = rofi items
|
||||||
|
selected.map { |key| items[key] }
|
||||||
|
end
|
||||||
|
|
||||||
|
type, browser = *ARGV
|
||||||
|
browser = (browser || ENV['BROWSER']).to_sym
|
||||||
|
urls = if type == 'history'
|
||||||
|
get_history browser
|
||||||
|
else
|
||||||
|
get_bookmarks browser
|
||||||
|
end
|
||||||
|
urls = list urls
|
||||||
|
if urls.empty?
|
||||||
|
puts "No URL selected. Aborting..."
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
Process.detach fork { exec ENV['BROWSER'], *urls }
|
260
bin/rofi/bwmenu
Executable file
260
bin/rofi/bwmenu
Executable file
|
@ -0,0 +1,260 @@
|
||||||
|
#!/usr/bin/env cached-nix-shell
|
||||||
|
#! nix-shell -p ruby_2_7 -i "ruby -S"
|
||||||
|
|
||||||
|
# A rofi client for vaultwarden. Similar to passmenu, but uses rofi. (Badly)
|
||||||
|
# written in ruby because data persistence and frontend logic would be a pain to
|
||||||
|
# write in bash or zsh. I'll refactor this later perhaps. Maybe.
|
||||||
|
|
||||||
|
require 'shellwords'
|
||||||
|
require 'json'
|
||||||
|
require 'optparse'
|
||||||
|
require 'uri'
|
||||||
|
require 'base64'
|
||||||
|
require 'fileutils'
|
||||||
|
|
||||||
|
PersistentData = Struct.new(:path, :ttl, :pid, :data) do
|
||||||
|
DATADIR = "#{ENV['XDG_DATA_HOME']}/bwmenu"
|
||||||
|
|
||||||
|
def self.load name, ttl: nil
|
||||||
|
path = "#{DATADIR}/#{name}"
|
||||||
|
data = JSON::load(Base64.decode64(File.read(path))) if File.exists?(path)
|
||||||
|
d = PersistentData.new *(data || {}).values
|
||||||
|
d.path = path
|
||||||
|
d.ttl = ttl
|
||||||
|
d
|
||||||
|
end
|
||||||
|
|
||||||
|
def expire
|
||||||
|
File.delete(self.path) if File.exists?(self.path)
|
||||||
|
end
|
||||||
|
|
||||||
|
def save data = nil, onfinish = nil
|
||||||
|
self.data = data if data
|
||||||
|
FileUtils.mkdir_p DATADIR unless File.directory?(DATADIR)
|
||||||
|
File.open(self.path, 'w') do |f|
|
||||||
|
f.chmod 0600
|
||||||
|
f.write Base64.encode64(self.to_h.to_json)
|
||||||
|
end
|
||||||
|
if self.pid and system("ps -f p #{self.pid}")
|
||||||
|
Process.kill self.pid
|
||||||
|
end
|
||||||
|
if self.ttl
|
||||||
|
self.pid = fork do
|
||||||
|
Signal.trap('TERM') { throw :terminate }
|
||||||
|
catch :terminate do
|
||||||
|
sleep self.ttl
|
||||||
|
end
|
||||||
|
onfinish.call(self, data) if onfinish.respond_to? :call
|
||||||
|
self.expire
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
module BW
|
||||||
|
extend self
|
||||||
|
|
||||||
|
EXE = {}
|
||||||
|
def self.bin exe
|
||||||
|
EXE[exe] = `which #{exe} 2>/dev/null`.rstrip unless EXE[exe]
|
||||||
|
raise "Couldn't find #{exe} in PATH" if EXE[exe].empty?
|
||||||
|
EXE[exe]
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.sh *args, input: nil, sudo: false, nooutput: false
|
||||||
|
exe, *args = args.flatten.compact.map(&:to_s)
|
||||||
|
bin exe
|
||||||
|
cmd = [sudo ? "sudo" : nil, exe, *args.shelljoin].compact.join(' ')
|
||||||
|
$stderr.puts "$ #{cmd}"
|
||||||
|
if input
|
||||||
|
IO.popen(cmd, "r+") do |pipe|
|
||||||
|
pipe.puts input
|
||||||
|
pipe.close_write
|
||||||
|
(pipe.gets || "").rstrip unless nooutput
|
||||||
|
end
|
||||||
|
else
|
||||||
|
(`#{cmd}` || "").rstrip
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.rofi items, *args
|
||||||
|
input = items.keys.join("\n") if items
|
||||||
|
result = sh(['rofi', '-dmenu', '-markup-rows',
|
||||||
|
'-theme', 'theme/passmenu.rasi',
|
||||||
|
*args],
|
||||||
|
input: input)
|
||||||
|
if items
|
||||||
|
items[result]
|
||||||
|
else
|
||||||
|
result
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.notify message, title: nil, urgency: "normal"
|
||||||
|
sh 'notify-send', '-u', urgency, '-a', "Vaultwarden", *[title, message].compact
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.error message
|
||||||
|
$stderr.puts message
|
||||||
|
notify message, urgency: 'low'
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.bw *args
|
||||||
|
sh [:bw, '--session', @@session_id, *args]
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.xclip *args, **opts
|
||||||
|
sh :xclip, '-selection', 'clipboard', *args, **opts
|
||||||
|
end
|
||||||
|
|
||||||
|
@@session = nil
|
||||||
|
@@session_id = nil
|
||||||
|
def self.run argv
|
||||||
|
opts = {}
|
||||||
|
OptionParser.new do |opt|
|
||||||
|
opt.banner = "Usage: bwmenu [options] [URL]"
|
||||||
|
opt.on '--autolock TTL', "How long to keep the vault open"
|
||||||
|
opt.on '--autoclear TTL' "How long to keep secrets in the clipboard"
|
||||||
|
opt.on '--debug', "Be more verbose"
|
||||||
|
opt.on '-f', '--field FIELD', "Extract specific field from selected entry; accepts 'whole' for whole entry"
|
||||||
|
opt.on '-o', '--output', "Write output to stdout rather than the clipboard"
|
||||||
|
opt.on '--select', "Select first entry"
|
||||||
|
opt.on '--select-if-only', "Select first entry if only entry"
|
||||||
|
opt.on '--default ID', "Highlight item with ID by default"
|
||||||
|
opt.on '-r', "Resume where you last left off"
|
||||||
|
end.parse! argv, into: opts
|
||||||
|
|
||||||
|
clipboard_ttl = opts[:autoclear] || 20
|
||||||
|
vault_ttl = opts[:autolock] || 900
|
||||||
|
|
||||||
|
@@session = PersistentData.load :session, ttl: vault_ttl
|
||||||
|
if @@session.data
|
||||||
|
sid, data = @@session.data
|
||||||
|
@@session_id = sid
|
||||||
|
else
|
||||||
|
pass = rofi nil, %w{-p Master\ Password -password -lines 0}
|
||||||
|
error "No password given. Aborting..." if pass.empty?
|
||||||
|
sid = sh [:bw, :unlock, '--raw', pass]
|
||||||
|
error "Failed to unlock vault. Aborting..." unless $?.success?
|
||||||
|
@@session_id = sid
|
||||||
|
data = JSON.parse(bw(:list, :items))
|
||||||
|
@@session.save [sid, data]
|
||||||
|
end
|
||||||
|
raise "No session ID" unless @@session_id
|
||||||
|
|
||||||
|
last = PersistentData.load :last_id
|
||||||
|
last_id, last_field = last.data if last
|
||||||
|
if opts[:r] and last_id.data
|
||||||
|
selected = data.find { |u| u['id'] == last_id }
|
||||||
|
else
|
||||||
|
select_type = opts[:"select-if-only"] ? :if_only : opts[:select]
|
||||||
|
selected = list_items data, argv.first,
|
||||||
|
default: opts[:default],
|
||||||
|
select: select_type
|
||||||
|
end
|
||||||
|
|
||||||
|
begin
|
||||||
|
error "Nothing selected. Aborting..." if selected.empty?
|
||||||
|
last_id = selected['id']
|
||||||
|
item = show_item selected, field: opts[:field]
|
||||||
|
if not item
|
||||||
|
error "Nothing selected. Aborting..." if selected.empty?
|
||||||
|
elsif item.respond_to? :call
|
||||||
|
item.call
|
||||||
|
elsif opts[:output]
|
||||||
|
puts item.rstrip
|
||||||
|
else
|
||||||
|
notify "Copied to clipboard for #{clipboard_ttl} seconds"
|
||||||
|
xclip '-in', input: item.rstrip, nooutput: true
|
||||||
|
clipboard = PersistentData.load :clipboard, ttl: clipboard_ttl
|
||||||
|
clipboard.save(
|
||||||
|
item.rstrip,
|
||||||
|
lambda { |_, data| xclip('-in', '/dev/null') if item.rstrip == xclip('-out') }
|
||||||
|
)
|
||||||
|
end
|
||||||
|
ensure
|
||||||
|
last.save [ last_id, last_field ]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
#
|
||||||
|
def list_items data, query = nil, default: nil, select: false
|
||||||
|
rofiData = {}
|
||||||
|
rofiData["Sync Vault"] = lambda { notify "Sync vault", bw(:sync) },
|
||||||
|
rofiData["Open Vault in Browser"] = lambda { sh ENV['BROWSER'], bw(:config, :server) }
|
||||||
|
data = data.map do |i|
|
||||||
|
default_id = i['id'] if i['id'] == default
|
||||||
|
icon = ["", "", "", ""][i['type'] - 1]
|
||||||
|
case i['type']
|
||||||
|
when 1 # logins
|
||||||
|
urls = (i['login']['uris'] || []).filter_map do |u|
|
||||||
|
return unless u['uri']
|
||||||
|
uri = URI(u['uri'])
|
||||||
|
not i['name'].include?((uri.hostname || uri.path).downcase) and
|
||||||
|
uri.hostname || uri.path
|
||||||
|
end
|
||||||
|
subtitle = urls.join ", " if i['type'] == 1
|
||||||
|
subtitle = " <span size=\"x-small\">(#{subtitle})</span>" unless urls.empty?
|
||||||
|
when 2 # secure notes
|
||||||
|
when 3 # cards
|
||||||
|
subtitle = " <span size=\"x-small\">(#{i['card']['brand'].downcase})</span>"
|
||||||
|
when 4 # identities
|
||||||
|
end
|
||||||
|
["<span font_desc=\"Fira Code\" font_weight=\"bold\">#{icon} </span> <b>#{i['name']}</b>#{subtitle}", i]
|
||||||
|
end
|
||||||
|
case select
|
||||||
|
when :if_only
|
||||||
|
return data[0][1] if data.length == 1
|
||||||
|
when true
|
||||||
|
return data[0][1]
|
||||||
|
end
|
||||||
|
rofi rofiData.merge(data.to_h), '-p', 'Vaultwarden', '-filter', (query || "")
|
||||||
|
end
|
||||||
|
|
||||||
|
def show_item item, field: nil
|
||||||
|
return item.to_json if field == 'whole'
|
||||||
|
preamble = {}
|
||||||
|
data = {}
|
||||||
|
case item['type']
|
||||||
|
when 1 # logins
|
||||||
|
url = item['login']['uris'][0]['uri']
|
||||||
|
preamble[" Launch #{url}"] = lambda { sh ENV['BROWSER'], url }
|
||||||
|
data['Username'] = item['login']['username']
|
||||||
|
data['Password'] = item['login']['password']
|
||||||
|
data['TOTP'] = bw :get, :totp, url if item['login']['totp']
|
||||||
|
return (data[field.capitalize] || item[field]) if field
|
||||||
|
when 2 # secure notes
|
||||||
|
data['Notes'] = item['notes']
|
||||||
|
return item[field] if field
|
||||||
|
when 3 # cards
|
||||||
|
cardInfo = item['card']
|
||||||
|
data['Card Type'] = cardInfo['brand']
|
||||||
|
data['Card Name'] = cardInfo['cardholderName']
|
||||||
|
data['Card Number'] = cardInfo['number']
|
||||||
|
data['Expiry Date'] = "#{cardInfo['expMonth']}/#{cardInfo['expYear']}"
|
||||||
|
data['Security Code'] = cardInfo['code']
|
||||||
|
return cardInfo[field] if field
|
||||||
|
when 4 # identities
|
||||||
|
item['identity'].each { |k,v| data[k] = v if v }
|
||||||
|
return item['identity'][field] if field
|
||||||
|
end
|
||||||
|
(item['fields'] || []).each do |field|
|
||||||
|
data[field['name']] = field['value']
|
||||||
|
end
|
||||||
|
maxLength = data.keys.map(&:length).max + 5
|
||||||
|
rofiData = {}
|
||||||
|
preamble.merge(data).each do |label, value|
|
||||||
|
if value.kind_of? String
|
||||||
|
valueLabel = value
|
||||||
|
valueLabel = value.gsub /./, '*' if label == 'Password'
|
||||||
|
rofiData["<span font_desc=\"Fira Code\" font_weight=\"bold\">%-#{maxLength}s</span> %s" % [label, valueLabel]] = value
|
||||||
|
else
|
||||||
|
rofiData[label] = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
rofi rofiData, '-p', item['name']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
BW.run ARGV.dup
|
11
bin/rofi/filemenu
Executable file
11
bin/rofi/filemenu
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
cd $HOME
|
||||||
|
DIR="$(fd -L -d 4 --type d . | rofi -dmenu -i -p "~/" -theme theme/filemenu.rasi)"
|
||||||
|
if [ -d "$DIR" ]; then
|
||||||
|
cd "$DIR"
|
||||||
|
if [[ $1 == "-x" ]]; then
|
||||||
|
scratch
|
||||||
|
else
|
||||||
|
xst
|
||||||
|
fi
|
||||||
|
fi
|
0
bin/rofi/networkmenu
Normal file
0
bin/rofi/networkmenu
Normal file
31
bin/rofi/powermenu
Executable file
31
bin/rofi/powermenu
Executable file
|
@ -0,0 +1,31 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
rofi_command="rofi -theme theme/powermenu.rasi"
|
||||||
|
|
||||||
|
### Options ###
|
||||||
|
power_off="\tShutdown"
|
||||||
|
reboot="\tReboot"
|
||||||
|
lock="\tLock"
|
||||||
|
suspend="鈴\tSleep"
|
||||||
|
log_out="\tLogout"
|
||||||
|
# Variable passed to rofi
|
||||||
|
options="$power_off\n$reboot\n$lock\n$suspend\n$log_out"
|
||||||
|
|
||||||
|
case "$(echo -e "$options" | $rofi_command -dmenu -selected-row 2)" in
|
||||||
|
$power_off)
|
||||||
|
systemctl poweroff
|
||||||
|
;;
|
||||||
|
$reboot)
|
||||||
|
systemctl reboot
|
||||||
|
;;
|
||||||
|
$lock)
|
||||||
|
zzz
|
||||||
|
;;
|
||||||
|
$suspend)
|
||||||
|
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause
|
||||||
|
systemctl suspend
|
||||||
|
;;
|
||||||
|
$log_out)
|
||||||
|
bspc quit
|
||||||
|
;;
|
||||||
|
esac
|
0
bin/rofi/spotifymenu
Normal file
0
bin/rofi/spotifymenu
Normal file
4
bin/rofi/windowmenu
Executable file
4
bin/rofi/windowmenu
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
rofi -show window \
|
||||||
|
-show-icons \
|
||||||
|
-theme theme/windowmenu.rasi
|
26
bin/scratch
Executable file
26
bin/scratch
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Toggle a scratch terminal window. A scratch terminal is a disposable terminal
|
||||||
|
# for one-off, quick commands that don't warrant a dedicated terminal.
|
||||||
|
|
||||||
|
SCRID=scratch
|
||||||
|
CMD=${1:-'tmux new-session -A -s scratch -n scratch'}
|
||||||
|
focused=$(xdotool getactivewindow)
|
||||||
|
scratch=$(xdotool search --onlyvisible --classname $SCRID)
|
||||||
|
if [[ -n $scratch ]]; then
|
||||||
|
if [[ $focused == $scratch ]]; then
|
||||||
|
xdotool windowkill $scratch
|
||||||
|
else
|
||||||
|
xdotool windowactivate $scratch
|
||||||
|
fi
|
||||||
|
elif command -v urxvt >/dev/null; then
|
||||||
|
urxvt -name $SCRID \
|
||||||
|
-e $SHELL -c "$CMD"
|
||||||
|
elif command -v xst >/dev/null; then
|
||||||
|
xst -t $SCRID -n $SCRID -c $SCRID \
|
||||||
|
-f "$(xrdb -query | grep 'scratch\.font' | cut -f2)" \
|
||||||
|
-e $SHELL -c "$CMD"
|
||||||
|
else
|
||||||
|
>&2 echo "No shell to launch the scratch terminal with"
|
||||||
|
exit 1
|
||||||
|
fi
|
16
bin/scrcap
Executable file
16
bin/scrcap
Executable file
|
@ -0,0 +1,16 @@
|
||||||
|
#!/usr/bin/env cached-nix-shell
|
||||||
|
#! nix-shell -i bash -p maim slop
|
||||||
|
|
||||||
|
# A script that takes a screenshot (prompts you for what region/window to
|
||||||
|
# capture) and stores it in the clipboard.
|
||||||
|
|
||||||
|
tmp=$(mktemp)
|
||||||
|
trap "rm -f '$tmp'" EXIT
|
||||||
|
|
||||||
|
# Delay for long enough that we can refocus the targeted window
|
||||||
|
if maim --delay=${2:-1} -us >"$tmp"; then
|
||||||
|
xclip -selection clipboard -t image/png "$tmp" &&
|
||||||
|
notify-send "Screenshot saved" "Copied image to clipboard"
|
||||||
|
else
|
||||||
|
notify-send -u low "Aborted screenshot"
|
||||||
|
fi
|
99
bin/scrrec
Executable file
99
bin/scrrec
Executable file
|
@ -0,0 +1,99 @@
|
||||||
|
#!/usr/bin/env cached-nix-shell
|
||||||
|
#! nix-shell -i bash -p ffmpeg slop
|
||||||
|
|
||||||
|
# Select a region and record it.
|
||||||
|
#
|
||||||
|
# If given a gif, it will record an mp4 and convert it afterwards using the
|
||||||
|
# mov2gif script included in this repo (which is powered by gifsicle and
|
||||||
|
# ffmpeg).
|
||||||
|
#
|
||||||
|
# Usage: scrrec somefile.mp4
|
||||||
|
# scrrec another.gif
|
||||||
|
|
||||||
|
is_script=
|
||||||
|
geom=
|
||||||
|
delay=1
|
||||||
|
count=3
|
||||||
|
fps=30
|
||||||
|
stopfile=/tmp/_stop
|
||||||
|
while getopts c:d:f:g:ps opt; do
|
||||||
|
case $opt in
|
||||||
|
c) count=$OPTARG ;;
|
||||||
|
d) delay="$OPTARG" ;;
|
||||||
|
f) fps=$OPTARG ;;
|
||||||
|
g) geom="$OPTARG" ;;
|
||||||
|
p) picom= ;;
|
||||||
|
s) is_script=1 ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
shift $((OPTIND-1))
|
||||||
|
|
||||||
|
##
|
||||||
|
select-region() {
|
||||||
|
if [[ $geom ]]; then
|
||||||
|
echo "${geom//[x+]/ }"
|
||||||
|
else
|
||||||
|
slop -nof "%w %h %x %y"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
countdown() {
|
||||||
|
if (( count > 0 )); then
|
||||||
|
for ((i=count;i>0;i--)); do
|
||||||
|
if [[ $is_script ]]; then
|
||||||
|
notify-send -u critical -t 1000 "Recording in $i"
|
||||||
|
else
|
||||||
|
echo "Recording in $i"
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
elif [[ $is_script ]]; then
|
||||||
|
notify-send -u critical "Starting recording..."
|
||||||
|
else
|
||||||
|
echo "Started recording..."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
recording-start() {
|
||||||
|
local ffmpeg_opts="-y -f x11grab -show_region 1 -ss $delay -s ${4}x${5} -i :0.0+${2},${3} -framerate ${fps}"
|
||||||
|
local dest=${1:-./rec.mp4}
|
||||||
|
local mp4dest=
|
||||||
|
[[ $dest == *.gif ]] && mp4dest="${dest%.*}.mp4"
|
||||||
|
countdown
|
||||||
|
ffmpeg $ffmpeg_opts "${mp4dest:-$dest}" &
|
||||||
|
pid=$!
|
||||||
|
echo $pid >$stopfile
|
||||||
|
wait $pid
|
||||||
|
rm -f $stopfile
|
||||||
|
if [[ -f "$mp4dest" ]]; then
|
||||||
|
mov2gif "$mp4dest" "$dest" && rm -fv "$mp4dest"
|
||||||
|
fi
|
||||||
|
echo -n "$dest" | xclip -selection clipboard -in
|
||||||
|
notify-send "Screencast successful" "Saved to $dest\nAnd copied to your clipboard!"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# If a recording session is already active, stop that one.
|
||||||
|
if [[ -n "$is_script" && -f "$stopfile" ]]; then
|
||||||
|
kill $(cat $stopfile)
|
||||||
|
echo "Stopped previous recording"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
read -r W H X Y < <(select-region)
|
||||||
|
[[ -z "$W$H$X$Y" ]] && exit 1
|
||||||
|
|
||||||
|
# picom with blur and/or transparencies cause unbearable flickering in
|
||||||
|
# recordings, so temporarily disable it.
|
||||||
|
picom=
|
||||||
|
if systemctl is-enabled --user picom >/dev/null; then
|
||||||
|
systemctl --user stop picom
|
||||||
|
picom=1
|
||||||
|
fi
|
||||||
|
cleanup() { [[ $picom ]] && systemctl --user start picom; }
|
||||||
|
trap cleanup EXIT
|
||||||
|
|
||||||
|
# Let 'er rip
|
||||||
|
recording-start "$1" "$X" "$Y" "$W" "$H"
|
||||||
|
|
||||||
|
# vim:set ft=sh shiftwidth=2:
|
38
bin/since
Executable file
38
bin/since
Executable file
|
@ -0,0 +1,38 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
set -e
|
||||||
|
(( $# > 0 )) || exit
|
||||||
|
|
||||||
|
# Displays the time since $1 in a human readable format (e.g. 4h 25m 55s). If
|
||||||
|
# given a file, the modified time is used. If $1 == "--", then this script acts
|
||||||
|
# as a converter, converting $2 into human a readable format, e.g. since -- 72
|
||||||
|
# #=> 1m 12s
|
||||||
|
|
||||||
|
# TODO: A help fallback
|
||||||
|
# TODO: Options parsing?
|
||||||
|
|
||||||
|
# If given a file, give time since last modification
|
||||||
|
(( $# == 1 )) && [[ -f $1 ]] && arg=reference || arg=date
|
||||||
|
|
||||||
|
if [[ $1 == -- ]]; then
|
||||||
|
t="$2"
|
||||||
|
else
|
||||||
|
now=$(date +%s)
|
||||||
|
then=$(date --$arg="$*" +%s)
|
||||||
|
|
||||||
|
t=$(( now - then ))
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Bash doesn't support floating point arithmetic like zsh does, so use bc to do
|
||||||
|
# our arithmetic.
|
||||||
|
zmodload zsh/mathfunc
|
||||||
|
t=$(( abs(t) ))
|
||||||
|
weeks=$(( t / 60 / 60 / 24 / 7 ))
|
||||||
|
days=$(( t / 60 / 60 / 24 % 7 ))
|
||||||
|
hours=$(( t / 60 / 60 % 24 ))
|
||||||
|
minutes=$(( t / 60 % 60 ))
|
||||||
|
seconds=$(( t % 60 ))
|
||||||
|
(( weeks > 0 )) && echo -n "${weeks}w "
|
||||||
|
(( days > 0 )) && echo -n "${days}d "
|
||||||
|
(( hours > 0 )) && echo -n "${hours}h "
|
||||||
|
(( minutes > 0 )) && echo -n "${minutes}m "
|
||||||
|
echo -n "${seconds}s"
|
21
bin/spell
Executable file
21
bin/spell
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Find the correct spelling of a word. Uses (and requires) fzf to select the
|
||||||
|
# correct word. This output can be piped to something like dict to find
|
||||||
|
# definitions/synonyms.
|
||||||
|
#
|
||||||
|
# Requires: aspell, fzf
|
||||||
|
# Usage: spell mispeling
|
||||||
|
# Example: dict $(spell mispeling)
|
||||||
|
|
||||||
|
result=$(echo "$@" | aspell -a | tail -n-2)
|
||||||
|
if [[ "$result" == '*' ]]; then
|
||||||
|
echo "$@"
|
||||||
|
else
|
||||||
|
words=$(echo "$result" | sed $'s/[:,] /\\\n/g' | tail -n +2)
|
||||||
|
if (( $(wc -l <<< "$words") > 1 )) && command -v sk >/dev/null; then
|
||||||
|
fzf <<< "$words"
|
||||||
|
else
|
||||||
|
echo "$words"
|
||||||
|
fi
|
||||||
|
fi
|
6
bin/timein
Executable file
6
bin/timein
Executable file
|
@ -0,0 +1,6 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
open=open
|
||||||
|
[[ $OSTYPE == linux* ]] && open=xdg-open
|
||||||
|
|
||||||
|
$open https://time.is/$1 2>/dev/null &
|
22
bin/zzz
Executable file
22
bin/zzz
Executable file
|
@ -0,0 +1,22 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# If -f, then put computer to sleep.
|
||||||
|
# Otherwise, lock screen and turn off monitor.
|
||||||
|
|
||||||
|
if [[ $1 == -h ]]; then
|
||||||
|
bin=${0##*/}
|
||||||
|
echo "Usage: $bin [-f]"
|
||||||
|
echo
|
||||||
|
echo " $bin # put display to sleep"
|
||||||
|
echo " $bin -f # put computer to sleep"
|
||||||
|
elif [[ $1 == -f ]]; then
|
||||||
|
echo "Going to sleep..."
|
||||||
|
systemctl suspend
|
||||||
|
else
|
||||||
|
echo "Shutting my eyes..."
|
||||||
|
if command -v slock >/dev/null; then
|
||||||
|
pgrep slock >/dev/null || slock &
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
xset dpms force off
|
||||||
|
fi
|
111
config/awesome/init.fnl
Normal file
111
config/awesome/init.fnl
Normal file
|
@ -0,0 +1,111 @@
|
||||||
|
(local gears (require :gears))
|
||||||
|
(local awful (require :awful))
|
||||||
|
(local naughty (require :naughty))
|
||||||
|
(require :awful.autofocus)
|
||||||
|
|
||||||
|
(local wincmd (require :commands.window))
|
||||||
|
(local tagcmd (require :commands.tag))
|
||||||
|
(local pa (require :utils.pulseaudio))
|
||||||
|
(local input (require :utils.input))
|
||||||
|
|
||||||
|
|
||||||
|
(fn initialize [bindings]
|
||||||
|
;; Error handling
|
||||||
|
;; Check if awesome encountered an error during startup and fell back to
|
||||||
|
;; another config (This code will only ever execute for the fallback config)
|
||||||
|
(let [preset { :timeout 0 :bg "#000000" :fg "#ff0000" :max_height 1080 }]
|
||||||
|
(when awesome.startup_errors
|
||||||
|
(naughty.notify {:preset preset
|
||||||
|
:title "Oops, there were errors during startup!"
|
||||||
|
:text awesome.startup_errors}))
|
||||||
|
|
||||||
|
(var in-error false)
|
||||||
|
(awesome.connect_signal
|
||||||
|
"debug::error"
|
||||||
|
(fn []
|
||||||
|
;; Make sure we don't go into an endless error loop
|
||||||
|
(when (not in-error)
|
||||||
|
(set in-error true)
|
||||||
|
(naughty.notify {:preset preset
|
||||||
|
:title "Oops, an error happened!"
|
||||||
|
:text (tostring err)})
|
||||||
|
(naughty.notify {:preset preset
|
||||||
|
:title "Oops, an error happened!"
|
||||||
|
:text (tostring err)})
|
||||||
|
(set in-error false)))))
|
||||||
|
|
||||||
|
(root.keys bindings.global-keys)
|
||||||
|
|
||||||
|
(naughty.notify {:text "Glorious fennel"})
|
||||||
|
(gears.wallpaper.set "#282c34"))
|
||||||
|
|
||||||
|
|
||||||
|
(local
|
||||||
|
bindings
|
||||||
|
{
|
||||||
|
:global-keys
|
||||||
|
(gears.table.join
|
||||||
|
|
||||||
|
(input.key-group
|
||||||
|
"awesome"
|
||||||
|
[[:mod] :s hotkeys_popup.show_help "show help"]
|
||||||
|
[[:mod :shift] :r awesome.restart "reload config"]
|
||||||
|
)
|
||||||
|
|
||||||
|
(input.key-group
|
||||||
|
"exec"
|
||||||
|
[[:mod] :space (fn [] (awful.util.spawn "rofi -show run")) "app launcher"]
|
||||||
|
[[:mod] :e (fn [] (awful.util.spawn "emacsclient -c -n -e '(switch-to-buffer nil)'")) "emacs"]
|
||||||
|
[[:mod] :v (fn []
|
||||||
|
(let [option "gopass ls --flat"
|
||||||
|
prompt "rofi -dmenu -p pass"
|
||||||
|
action "xargs --no-run-if-empty gopass show -c"
|
||||||
|
cmd (.. option " | " prompt " | " action)]
|
||||||
|
(awful.spawn.easy_async_with_shell cmd (fn []))))
|
||||||
|
"secret vault"]
|
||||||
|
[[:mod] :Return (fn [] (awful.spawn "xst")) "open terminal"]
|
||||||
|
[[] :XF86AudioMute pa.toggle-muted "⏼ audio muted"]
|
||||||
|
[[] :XF86AudioMicMute pa.toggle-mic-mute "⏼ mic muted"]
|
||||||
|
[[] :XF86AudioRaiseVolume (fn [] (pa.adjust-volume 5)) "raise volume"]
|
||||||
|
[[] :XF86AudioLowerVolume (fn [] (pa.adjust-volume -5)) "lower volume"]
|
||||||
|
)
|
||||||
|
|
||||||
|
(input.key-group
|
||||||
|
"client"
|
||||||
|
[[:mod] :h (fn [] (awful.client.focus.bydirection :left)) "focus left"]
|
||||||
|
[[:mod] :j (fn [] (awful.client.focus.bydirection :down)) "focus down"]
|
||||||
|
[[:mod] :k (fn [] (awful.client.focus.bydirection :up)) "focus up"]
|
||||||
|
[[:mod] :l (fn [] (awful.client.focus.bydirection :right)) "focus right"]
|
||||||
|
[[:mod] :n (fn [] (awful.client.focus.byidx 1)) "focus next"]
|
||||||
|
[[:mod] :p (fn [] (awful.client.focus.byidx -1)) "focus previous"]
|
||||||
|
[[:mod :shift] :j (fn [] (awful.client.swap.byidx 1)) "swap next with previous"]
|
||||||
|
[[:mod :shift] :k (fn [] (awful.client.swap.byidx -1)) "swap next with previous"]
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
:client-keys
|
||||||
|
(gears.table.join
|
||||||
|
(input.key-group
|
||||||
|
"client"
|
||||||
|
[[:mod] :n wincmd.minimize "minimize"]
|
||||||
|
[[:mod] :t wincmd.toggle-ontop "⏼ keep on top"]
|
||||||
|
[[:mod] :m wincmd.toggle-maximized "⏼ maximize"]
|
||||||
|
[[:mod] :f wincmd.toggle-fullscreen "⏼ fullscreen"]
|
||||||
|
[[:mod :ctrl] :space awful.client.floating.toggle "⏼ floating"]
|
||||||
|
[[:mod :ctrl] :Return wincmd.move-to-master "move to master"]
|
||||||
|
[[:mod :ctrl] :m wincmd.toggle-maximize-vertical "⏼ max vertically"]
|
||||||
|
[[:mod :shift] :m wincmd.toggle-maximize-horizontal "⏼ max horizontally"]
|
||||||
|
[[:mod :shift] :c wincmd.close "close"]
|
||||||
|
))
|
||||||
|
|
||||||
|
:client-buttons
|
||||||
|
(gears.table.join
|
||||||
|
(input.mousebind [] input.left-click client.mouse-raise)
|
||||||
|
(input.mousebind [:mod] input.left-click client.mouse-drag-move)
|
||||||
|
(input.mousebind [:mod] input.right-click client.mouse-drag-resize)
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
;;
|
||||||
|
(initialize bindings)
|
34
config/bspwm/bspwmrc
Executable file
34
config/bspwm/bspwmrc
Executable file
|
@ -0,0 +1,34 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# case $HOSTNAME in
|
||||||
|
# kuro) export LAN=eno1 ;;
|
||||||
|
# shiro) export LAN=wlp3s0 ;;
|
||||||
|
# esac
|
||||||
|
|
||||||
|
export MONITOR=$(xrandr -q | grep primary | cut -d' ' -f1)
|
||||||
|
export MONITORS=( $(xrandr -q | grep ' connected' | cut -d' ' -f1) )
|
||||||
|
MONITOR=${MONITOR:-${MONITORS[0]}}
|
||||||
|
|
||||||
|
# Only have workspaces for primary monitor
|
||||||
|
bspc monitor $MONITOR -d {1,2,3,4,5}
|
||||||
|
|
||||||
|
bspc config remove_disabled_monitors true
|
||||||
|
bspc config remove_unplugged_monitors true
|
||||||
|
|
||||||
|
|
||||||
|
# Rules
|
||||||
|
bspc rule -r '*'
|
||||||
|
|
||||||
|
bspc rule -a Pinentry state=floating center=on
|
||||||
|
bspc rule -a Emacs split_ratio=0.28 state=tiled
|
||||||
|
bspc rule -a Firefox split_ratio=0.32
|
||||||
|
bspc rule -a feh state=fullscreen
|
||||||
|
bspc rule -a 'Emacs:org*' state=floating
|
||||||
|
bspc rule -a 'Emacs:scratch' state=floating
|
||||||
|
bspc rule -a 'Emacs:emacs-everywhere' state=floating sticky=on
|
||||||
|
bspc rule -a '*:scratch' state=floating sticky=on center=on border=off rectangle=1000x800+0+0
|
||||||
|
|
||||||
|
#
|
||||||
|
for file in $XDG_CONFIG_HOME/bspwm/rc.d/*; do
|
||||||
|
source "$file"
|
||||||
|
done
|
14
config/docker/aliases.zsh
Normal file
14
config/docker/aliases.zsh
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
alias dk=docker
|
||||||
|
alias dkc=docker-compose
|
||||||
|
alias dkm=docker-machine
|
||||||
|
alias dkl='dk logs'
|
||||||
|
alias dkcl='dkc logs'
|
||||||
|
|
||||||
|
dkclr() {
|
||||||
|
dk stop $(docker ps -a -q)
|
||||||
|
dk rm $(docker ps -a -q)
|
||||||
|
}
|
||||||
|
|
||||||
|
dke() {
|
||||||
|
dk exec -it "$1" "${@:1}"
|
||||||
|
}
|
6
config/emacs/aliases.zsh
Normal file
6
config/emacs/aliases.zsh
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
e() { pgrep emacs && emacsclient -n "$@" || emacs -nw "$@" }
|
||||||
|
ediff() { emacs -nw --eval "(ediff-files \"$1\" \"$2\")"; }
|
||||||
|
eman() { emacs -nw --eval "(switch-to-buffer (man \"$1\"))"; }
|
||||||
|
ekill() { emacsclient --eval '(kill-emacs)'; }
|
1344
config/gimp/menurc
Normal file
1344
config/gimp/menurc
Normal file
File diff suppressed because it is too large
Load diff
29
config/git/aliases.zsh
Normal file
29
config/git/aliases.zsh
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
g() { [[ $# = 0 ]] && git status --short . || git $*; }
|
||||||
|
|
||||||
|
alias git='noglob git'
|
||||||
|
alias ga='git add'
|
||||||
|
alias gap='git add --patch'
|
||||||
|
alias gb='git branch -av'
|
||||||
|
alias gop='git open'
|
||||||
|
alias gbl='git blame'
|
||||||
|
alias gc='git commit'
|
||||||
|
alias gcm='git commit -m'
|
||||||
|
alias gca='git commit --amend'
|
||||||
|
alias gcf='git commit --fixup'
|
||||||
|
alias gcl='git clone'
|
||||||
|
alias gco='git checkout'
|
||||||
|
alias gcoo='git checkout --'
|
||||||
|
alias gf='git fetch'
|
||||||
|
alias gi='git init'
|
||||||
|
alias gl='git log --graph --pretty="format:%C(yellow)%h%Creset %C(red)%G?%Creset%C(green)%d%Creset %s %Cblue(%cr) %C(bold blue)<%aN>%Creset"'
|
||||||
|
alias gll='git log --pretty="format:%C(yellow)%h%Creset %C(red)%G?%Creset%C(green)%d%Creset %s %Cblue(%cr) %C(bold blue)<%aN>%Creset"'
|
||||||
|
alias gL='gl --stat'
|
||||||
|
alias gp='git push'
|
||||||
|
alias gpl='git pull --rebase --autostash'
|
||||||
|
alias gs='git status --short .'
|
||||||
|
alias gss='git status'
|
||||||
|
alias gst='git stash'
|
||||||
|
alias gr='git reset HEAD'
|
||||||
|
alias grv='git rev-parse'
|
|
@ -1,14 +1,14 @@
|
||||||
[user]
|
[user]
|
||||||
name = Anish Lakhwara
|
name = Henrik Lissner
|
||||||
email = anish+git@lakhwara.com
|
email = henrik@lissner.net
|
||||||
[core]
|
[core]
|
||||||
whitespace = trailing-space
|
whitespace = trailing-space
|
||||||
[init]
|
[init]
|
||||||
defaultBranch = main
|
defaultBranch = main
|
||||||
[github]
|
[github]
|
||||||
user = chickensoupwithrice
|
user = hlissner
|
||||||
[gitlab]
|
[gitlab]
|
||||||
user =
|
user = hlissner
|
||||||
[rebase]
|
[rebase]
|
||||||
autosquash = true
|
autosquash = true
|
||||||
[push]
|
[push]
|
||||||
|
@ -21,8 +21,6 @@
|
||||||
ranked-authors = !git authors | sort | uniq -c | sort -n
|
ranked-authors = !git authors | sort | uniq -c | sort -n
|
||||||
emails = !git log --format="%aE" | sort -u
|
emails = !git log --format="%aE" | sort -u
|
||||||
email-domains = !git log --format="%aE" | awk -F'@' '{print $2}' | sort -u
|
email-domains = !git log --format="%aE" | awk -F'@' '{print $2}' | sort -u
|
||||||
# pretty log
|
|
||||||
ls = !git log --graph --abbrev-commit --decorate --color=always --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) - %C(dim red)%an%C(reset)%C(bold yellow)%d%C(reset)' --all
|
|
||||||
[filter "lfs"]
|
[filter "lfs"]
|
||||||
required = true
|
required = true
|
||||||
smudge = git-lfs smudge -- %f
|
smudge = git-lfs smudge -- %f
|
||||||
|
@ -32,7 +30,7 @@
|
||||||
insteadOf = gh:
|
insteadOf = gh:
|
||||||
[url "git@github.com:"]
|
[url "git@github.com:"]
|
||||||
insteadOf = ssh+gh:
|
insteadOf = ssh+gh:
|
||||||
[url "git@github.com:chickensoupwithrice/"]
|
[url "git@github.com:hlissner/"]
|
||||||
insteadOf = gh:/
|
insteadOf = gh:/
|
||||||
[url "https://gitlab.com/"]
|
[url "https://gitlab.com/"]
|
||||||
insteadOf = gl:
|
insteadOf = gl:
|
|
@ -9,7 +9,6 @@
|
||||||
.*.sw[a-z]
|
.*.sw[a-z]
|
||||||
*.un~
|
*.un~
|
||||||
.netrwhist
|
.netrwhist
|
||||||
.vim/*
|
|
||||||
|
|
||||||
# OS generated files #
|
# OS generated files #
|
||||||
######################
|
######################
|
3
config/ncmpcpp/aliases.zsh
Normal file
3
config/ncmpcpp/aliases.zsh
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
alias rate=mpd-rate
|
||||||
|
alias mpcs='mpc search any'
|
||||||
|
alias mpcsp='mpc searchplay any'
|
424
config/ncmpcpp/bindings
Normal file
424
config/ncmpcpp/bindings
Normal file
|
@ -0,0 +1,424 @@
|
||||||
|
def_key "k"
|
||||||
|
scroll_up
|
||||||
|
|
||||||
|
def_key "j"
|
||||||
|
scroll_down
|
||||||
|
|
||||||
|
def_key "K"
|
||||||
|
select_item
|
||||||
|
scroll_up
|
||||||
|
|
||||||
|
def_key "J"
|
||||||
|
select_item
|
||||||
|
scroll_down
|
||||||
|
|
||||||
|
def_key "h"
|
||||||
|
previous_column
|
||||||
|
|
||||||
|
def_key "l"
|
||||||
|
next_column
|
||||||
|
|
||||||
|
def_key "L"
|
||||||
|
show_lyrics
|
||||||
|
|
||||||
|
def_key "up"
|
||||||
|
volume_up
|
||||||
|
|
||||||
|
def_key "down"
|
||||||
|
volume_down
|
||||||
|
|
||||||
|
#def_key "right"
|
||||||
|
# next_column
|
||||||
|
#
|
||||||
|
#def_key "left"
|
||||||
|
# previous_column
|
||||||
|
#
|
||||||
|
#def_key "mouse"
|
||||||
|
# mouse_event
|
||||||
|
#
|
||||||
|
#def_key "up"
|
||||||
|
# scroll_up
|
||||||
|
#
|
||||||
|
#def_key "shift-up"
|
||||||
|
# select_item
|
||||||
|
# scroll_up
|
||||||
|
#
|
||||||
|
#def_key "down"
|
||||||
|
# scroll_down
|
||||||
|
#
|
||||||
|
#def_key "shift-down"
|
||||||
|
# select_item
|
||||||
|
# scroll_down
|
||||||
|
#
|
||||||
|
#def_key "["
|
||||||
|
# scroll_up_album
|
||||||
|
#
|
||||||
|
#def_key "]"
|
||||||
|
# scroll_down_album
|
||||||
|
#
|
||||||
|
#def_key "{"
|
||||||
|
# scroll_up_artist
|
||||||
|
#
|
||||||
|
#def_key "}"
|
||||||
|
# scroll_down_artist
|
||||||
|
#
|
||||||
|
#def_key "page_up"
|
||||||
|
# page_up
|
||||||
|
#
|
||||||
|
#def_key "page_down"
|
||||||
|
# page_down
|
||||||
|
#
|
||||||
|
#def_key "home"
|
||||||
|
# move_home
|
||||||
|
#
|
||||||
|
#def_key "end"
|
||||||
|
# move_end
|
||||||
|
#
|
||||||
|
#def_key "insert"
|
||||||
|
# select_item
|
||||||
|
#
|
||||||
|
#def_key "enter"
|
||||||
|
# enter_directory
|
||||||
|
#
|
||||||
|
#def_key "enter"
|
||||||
|
# toggle_output
|
||||||
|
#
|
||||||
|
#def_key "enter"
|
||||||
|
# run_action
|
||||||
|
#
|
||||||
|
#def_key "enter"
|
||||||
|
# play_item
|
||||||
|
#
|
||||||
|
#def_key "space"
|
||||||
|
# add_item_to_playlist
|
||||||
|
#
|
||||||
|
#def_key "space"
|
||||||
|
# toggle_lyrics_update_on_song_change
|
||||||
|
#
|
||||||
|
#def_key "space"
|
||||||
|
# toggle_visualization_type
|
||||||
|
#
|
||||||
|
#def_key "delete"
|
||||||
|
# delete_playlist_items
|
||||||
|
#
|
||||||
|
#def_key "delete"
|
||||||
|
# delete_browser_items
|
||||||
|
#
|
||||||
|
#def_key "delete"
|
||||||
|
# delete_stored_playlist
|
||||||
|
#
|
||||||
|
#def_key "right"
|
||||||
|
# next_column
|
||||||
|
#
|
||||||
|
#def_key "right"
|
||||||
|
# slave_screen
|
||||||
|
#
|
||||||
|
#def_key "right"
|
||||||
|
# volume_up
|
||||||
|
#
|
||||||
|
#def_key "+"
|
||||||
|
# volume_up
|
||||||
|
#
|
||||||
|
#def_key "left"
|
||||||
|
# previous_column
|
||||||
|
#
|
||||||
|
#def_key "left"
|
||||||
|
# master_screen
|
||||||
|
#
|
||||||
|
#def_key "left"
|
||||||
|
# volume_down
|
||||||
|
#
|
||||||
|
#def_key "-"
|
||||||
|
# volume_down
|
||||||
|
#
|
||||||
|
#def_key ":"
|
||||||
|
# execute_command
|
||||||
|
#
|
||||||
|
#def_key "tab"
|
||||||
|
# next_screen
|
||||||
|
#
|
||||||
|
#def_key "shift-tab"
|
||||||
|
# previous_screen
|
||||||
|
#
|
||||||
|
#def_key "f1"
|
||||||
|
# show_help
|
||||||
|
#
|
||||||
|
#def_key "1"
|
||||||
|
# show_playlist
|
||||||
|
#
|
||||||
|
#def_key "2"
|
||||||
|
# show_browser
|
||||||
|
#
|
||||||
|
#def_key "2"
|
||||||
|
# change_browse_mode
|
||||||
|
#
|
||||||
|
#def_key "3"
|
||||||
|
# show_search_engine
|
||||||
|
#
|
||||||
|
#def_key "3"
|
||||||
|
# reset_search_engine
|
||||||
|
#
|
||||||
|
#def_key "4"
|
||||||
|
# show_media_library
|
||||||
|
#
|
||||||
|
#def_key "4"
|
||||||
|
# toggle_media_library_columns_mode
|
||||||
|
#
|
||||||
|
#def_key "5"
|
||||||
|
# show_playlist_editor
|
||||||
|
#
|
||||||
|
#def_key "6"
|
||||||
|
# show_tag_editor
|
||||||
|
#
|
||||||
|
#def_key "7"
|
||||||
|
# show_outputs
|
||||||
|
#
|
||||||
|
#def_key "8"
|
||||||
|
# show_visualizer
|
||||||
|
#
|
||||||
|
#def_key "="
|
||||||
|
# show_clock
|
||||||
|
#
|
||||||
|
#def_key "@"
|
||||||
|
# show_server_info
|
||||||
|
#
|
||||||
|
#def_key "s"
|
||||||
|
# stop
|
||||||
|
#
|
||||||
|
#def_key "p"
|
||||||
|
# pause
|
||||||
|
#
|
||||||
|
#def_key ">"
|
||||||
|
# next
|
||||||
|
#
|
||||||
|
#def_key "<"
|
||||||
|
# previous
|
||||||
|
#
|
||||||
|
#def_key "ctrl-h"
|
||||||
|
# jump_to_parent_directory
|
||||||
|
#
|
||||||
|
#def_key "ctrl-h"
|
||||||
|
# replay_song
|
||||||
|
#
|
||||||
|
#def_key "backspace"
|
||||||
|
# jump_to_parent_directory
|
||||||
|
#
|
||||||
|
#def_key "backspace"
|
||||||
|
# replay_song
|
||||||
|
#
|
||||||
|
#def_key "f"
|
||||||
|
# seek_forward
|
||||||
|
#
|
||||||
|
#def_key "b"
|
||||||
|
# seek_backward
|
||||||
|
#
|
||||||
|
#def_key "r"
|
||||||
|
# toggle_repeat
|
||||||
|
#
|
||||||
|
#def_key "z"
|
||||||
|
# toggle_random
|
||||||
|
#
|
||||||
|
#def_key "y"
|
||||||
|
# save_tag_changes
|
||||||
|
#
|
||||||
|
#def_key "y"
|
||||||
|
# start_searching
|
||||||
|
#
|
||||||
|
#def_key "y"
|
||||||
|
# toggle_single
|
||||||
|
#
|
||||||
|
#def_key "R"
|
||||||
|
# toggle_consume
|
||||||
|
#
|
||||||
|
#def_key "Y"
|
||||||
|
# toggle_replay_gain_mode
|
||||||
|
#
|
||||||
|
#def_key "T"
|
||||||
|
# toggle_add_mode
|
||||||
|
#
|
||||||
|
#def_key "|"
|
||||||
|
# toggle_mouse
|
||||||
|
#
|
||||||
|
#def_key "#"
|
||||||
|
# toggle_bitrate_visibility
|
||||||
|
#
|
||||||
|
#def_key "Z"
|
||||||
|
# shuffle
|
||||||
|
#
|
||||||
|
#def_key "x"
|
||||||
|
# toggle_crossfade
|
||||||
|
#
|
||||||
|
#def_key "X"
|
||||||
|
# set_crossfade
|
||||||
|
#
|
||||||
|
#def_key "u"
|
||||||
|
# update_database
|
||||||
|
#
|
||||||
|
#def_key "ctrl-s"
|
||||||
|
# sort_playlist
|
||||||
|
#
|
||||||
|
#def_key "ctrl-s"
|
||||||
|
# toggle_browser_sort_mode
|
||||||
|
#
|
||||||
|
#def_key "ctrl-s"
|
||||||
|
# toggle_media_library_sort_mode
|
||||||
|
#
|
||||||
|
#def_key "ctrl-r"
|
||||||
|
# reverse_playlist
|
||||||
|
#
|
||||||
|
#def_key "ctrl-_"
|
||||||
|
# select_found_items
|
||||||
|
#
|
||||||
|
#def_key "/"
|
||||||
|
# find
|
||||||
|
#
|
||||||
|
#def_key "/"
|
||||||
|
# find_item_forward
|
||||||
|
#
|
||||||
|
#def_key "?"
|
||||||
|
# find
|
||||||
|
#
|
||||||
|
#def_key "?"
|
||||||
|
# find_item_backward
|
||||||
|
#
|
||||||
|
#def_key "."
|
||||||
|
# next_found_item
|
||||||
|
#
|
||||||
|
#def_key ","
|
||||||
|
# previous_found_item
|
||||||
|
#
|
||||||
|
#def_key "w"
|
||||||
|
# toggle_find_mode
|
||||||
|
#
|
||||||
|
#def_key "e"
|
||||||
|
# edit_song
|
||||||
|
#
|
||||||
|
#def_key "e"
|
||||||
|
# edit_library_tag
|
||||||
|
#
|
||||||
|
#def_key "e"
|
||||||
|
# edit_library_album
|
||||||
|
#
|
||||||
|
#def_key "e"
|
||||||
|
# edit_directory_name
|
||||||
|
#
|
||||||
|
#def_key "e"
|
||||||
|
# edit_playlist_name
|
||||||
|
#
|
||||||
|
#def_key "e"
|
||||||
|
# edit_lyrics
|
||||||
|
#
|
||||||
|
#def_key "i"
|
||||||
|
# show_song_info
|
||||||
|
#
|
||||||
|
#def_key "I"
|
||||||
|
# show_artist_info
|
||||||
|
#
|
||||||
|
#def_key "g"
|
||||||
|
# jump_to_position_in_song
|
||||||
|
#
|
||||||
|
#def_key "l"
|
||||||
|
# show_lyrics
|
||||||
|
#
|
||||||
|
#def_key "ctrl-v"
|
||||||
|
# select_range
|
||||||
|
#
|
||||||
|
#def_key "v"
|
||||||
|
# reverse_selection
|
||||||
|
#
|
||||||
|
#def_key "V"
|
||||||
|
# remove_selection
|
||||||
|
#
|
||||||
|
#def_key "B"
|
||||||
|
# select_album
|
||||||
|
#
|
||||||
|
#def_key "a"
|
||||||
|
# add_selected_items
|
||||||
|
#
|
||||||
|
#def_key "c"
|
||||||
|
# clear_playlist
|
||||||
|
#
|
||||||
|
#def_key "c"
|
||||||
|
# clear_main_playlist
|
||||||
|
#
|
||||||
|
#def_key "C"
|
||||||
|
# crop_playlist
|
||||||
|
#
|
||||||
|
#def_key "C"
|
||||||
|
# crop_main_playlist
|
||||||
|
#
|
||||||
|
#def_key "m"
|
||||||
|
# move_sort_order_up
|
||||||
|
#
|
||||||
|
#def_key "m"
|
||||||
|
# move_selected_items_up
|
||||||
|
#
|
||||||
|
#def_key "m"
|
||||||
|
# set_visualizer_sample_multiplier
|
||||||
|
#
|
||||||
|
#def_key "n"
|
||||||
|
# move_sort_order_down
|
||||||
|
#
|
||||||
|
#def_key "n"
|
||||||
|
# move_selected_items_down
|
||||||
|
#
|
||||||
|
#def_key "M"
|
||||||
|
# move_selected_items_to
|
||||||
|
#
|
||||||
|
#def_key "A"
|
||||||
|
# add
|
||||||
|
#
|
||||||
|
#def_key "S"
|
||||||
|
# save_playlist
|
||||||
|
#
|
||||||
|
#def_key "o"
|
||||||
|
# jump_to_playing_song
|
||||||
|
#
|
||||||
|
#def_key "G"
|
||||||
|
# jump_to_browser
|
||||||
|
#
|
||||||
|
#def_key "G"
|
||||||
|
# jump_to_playlist_editor
|
||||||
|
#
|
||||||
|
#def_key "~"
|
||||||
|
# jump_to_media_library
|
||||||
|
#
|
||||||
|
#def_key "E"
|
||||||
|
# jump_to_tag_editor
|
||||||
|
#
|
||||||
|
#def_key "U"
|
||||||
|
# toggle_playing_song_centering
|
||||||
|
#
|
||||||
|
#def_key "P"
|
||||||
|
# toggle_display_mode
|
||||||
|
#
|
||||||
|
#def_key "\\"
|
||||||
|
# toggle_interface
|
||||||
|
#
|
||||||
|
#def_key "!"
|
||||||
|
# toggle_separators_between_albums
|
||||||
|
#
|
||||||
|
#def_key "L"
|
||||||
|
# toggle_lyrics_fetcher
|
||||||
|
#
|
||||||
|
#def_key "F"
|
||||||
|
# toggle_fetching_lyrics_in_background
|
||||||
|
#
|
||||||
|
#def_key "ctrl-l"
|
||||||
|
# toggle_screen_lock
|
||||||
|
#
|
||||||
|
#def_key "`"
|
||||||
|
# toggle_library_tag_type
|
||||||
|
#
|
||||||
|
#def_key "`"
|
||||||
|
# refetch_lyrics
|
||||||
|
#
|
||||||
|
#def_key "`"
|
||||||
|
# add_random_items
|
||||||
|
#
|
||||||
|
#def_key "ctrl-p"
|
||||||
|
# set_selected_items_priority
|
||||||
|
#
|
||||||
|
#def_key "q"
|
||||||
|
# quit
|
||||||
|
#
|
433
config/ncmpcpp/config
Normal file
433
config/ncmpcpp/config
Normal file
|
@ -0,0 +1,433 @@
|
||||||
|
##### directories ######
|
||||||
|
ncmpcpp_directory = ~/.config/ncmpcpp
|
||||||
|
|
||||||
|
## Directory for storing downloaded lyrics.
|
||||||
|
lyrics_directory = ~/music/.db/lyrics
|
||||||
|
|
||||||
|
##### connection settings #####
|
||||||
|
mpd_host = "~/.config/mpd/mpd.sock"
|
||||||
|
#mpd_host = "127.0.0.1"
|
||||||
|
#mpd_port = 6600
|
||||||
|
#mpd_connection_timeout = 5
|
||||||
|
|
||||||
|
## Needed for tag editor and file operations to work.
|
||||||
|
mpd_music_dir = ~/music
|
||||||
|
mpd_crossfade_time = 5
|
||||||
|
|
||||||
|
##### music visualizer #####
|
||||||
|
##
|
||||||
|
## Note: In order to make music visualizer work you'll
|
||||||
|
## need to use mpd fifo output, whose format parameter
|
||||||
|
## has to be set to 44100:16:1 for mono visualization
|
||||||
|
## or 44100:16:2 for stereo visualization. Example
|
||||||
|
## configuration (it has to be put into mpd.conf):
|
||||||
|
##
|
||||||
|
## audio_output {
|
||||||
|
## type "fifo"
|
||||||
|
## name "Visualizer feed"
|
||||||
|
## path "/tmp/mpd.fifo"
|
||||||
|
## format "44100:16:2"
|
||||||
|
## }
|
||||||
|
##
|
||||||
|
#visualizer_fifo_path = /tmp/mpd.fifo
|
||||||
|
|
||||||
|
##
|
||||||
|
## Note: Below parameter is needed for ncmpcpp
|
||||||
|
## to determine which output provides data for
|
||||||
|
## visualizer and thus allow syncing between
|
||||||
|
## visualization and sound as currently there
|
||||||
|
## are some problems with it.
|
||||||
|
##
|
||||||
|
#visualizer_output_name = Visualizer feed
|
||||||
|
|
||||||
|
##
|
||||||
|
## If you set format to 44100:16:2, make it 'yes'.
|
||||||
|
##
|
||||||
|
visualizer_in_stereo = no
|
||||||
|
|
||||||
|
##
|
||||||
|
## Multiply received samples by given value. Very
|
||||||
|
## useful for proper visualization of quiet music.
|
||||||
|
##
|
||||||
|
#visualizer_sample_multiplier = 1.0
|
||||||
|
|
||||||
|
##
|
||||||
|
## Note: Below parameter defines how often ncmpcpp
|
||||||
|
## has to "synchronize" visualizer and audio outputs.
|
||||||
|
## 30 seconds is optimal value, but if you experience
|
||||||
|
## synchronization problems, set it to lower value.
|
||||||
|
## Keep in mind that sane values start with >=10.
|
||||||
|
##
|
||||||
|
visualizer_sync_interval = 30
|
||||||
|
|
||||||
|
##
|
||||||
|
## Note: To enable spectrum frequency visualization
|
||||||
|
## you need to compile ncmpcpp with fftw3 support.
|
||||||
|
##
|
||||||
|
#
|
||||||
|
## Available values: spectrum, wave, wave_filled, ellipse.
|
||||||
|
visualizer_type = spectrum
|
||||||
|
## Alternative subset of 256 colors for terminals that support it.
|
||||||
|
#visualizer_color = 41, 83, 119, 155, 185, 215, 209, 203, 197, 161
|
||||||
|
visualizer_color = blue, cyan, green, yellow, magenta, red
|
||||||
|
#visualizer_look = ●▮
|
||||||
|
#
|
||||||
|
##### system encoding #####
|
||||||
|
##
|
||||||
|
## ncmpcpp should detect your charset encoding
|
||||||
|
## but if it failed to do so, you can specify
|
||||||
|
## charset encoding you are using here.
|
||||||
|
##
|
||||||
|
## Note: You can see whether your ncmpcpp build
|
||||||
|
## supports charset detection by checking output
|
||||||
|
## of `ncmpcpp --version`.
|
||||||
|
##
|
||||||
|
## Note: Since MPD uses UTF-8 by default, setting
|
||||||
|
## this option makes sense only if your encoding
|
||||||
|
## is different.
|
||||||
|
##
|
||||||
|
#system_encoding = ""
|
||||||
|
#
|
||||||
|
##### delays #####
|
||||||
|
#
|
||||||
|
## Time of inactivity (in seconds) after playlist
|
||||||
|
## highlighting will be disabled (0 = always on).
|
||||||
|
##
|
||||||
|
#playlist_disable_highlight_delay = 5
|
||||||
|
#
|
||||||
|
## Defines how long messages are supposed to be visible.
|
||||||
|
##
|
||||||
|
message_delay_time = 2
|
||||||
|
#
|
||||||
|
##### song format #####
|
||||||
|
##
|
||||||
|
## For a song format you can use:
|
||||||
|
##
|
||||||
|
## %l - length
|
||||||
|
## %f - filename
|
||||||
|
## %D - directory
|
||||||
|
## %a - artist
|
||||||
|
## %A - album artist
|
||||||
|
## %t - title
|
||||||
|
## %b - album
|
||||||
|
## %y - date
|
||||||
|
## %n - track number (01/12 -> 01)
|
||||||
|
## %N - full track info (01/12 -> 01/12)
|
||||||
|
## %g - genre
|
||||||
|
## %c - composer
|
||||||
|
## %p - performer
|
||||||
|
## %d - disc
|
||||||
|
## %C - comment
|
||||||
|
## %P - priority
|
||||||
|
## $R - begin right alignment
|
||||||
|
##
|
||||||
|
## If you want to make sure that a part of the format is displayed
|
||||||
|
## only when certain tags are present, you can archieve it by
|
||||||
|
## grouping them with brackets, e.g. '{%a - %t}' will be evaluated
|
||||||
|
## to 'ARTIST - TITLE' if both tags are present or '' otherwise.
|
||||||
|
## It is also possible to define a list of alternatives by providing
|
||||||
|
## several groups and separating them with '|', e.g. '{%t}|{%f}'
|
||||||
|
## will be evaluated to 'TITLE' or 'FILENAME' if the former is not
|
||||||
|
## present.
|
||||||
|
##
|
||||||
|
## Note: If you want to set limit on maximal length of a tag, just
|
||||||
|
## put the appropriate number between % and character that defines
|
||||||
|
## tag type, e.g. to make album take max. 20 terminal cells, use '%20b'.
|
||||||
|
##
|
||||||
|
## In addition, formats support markers used for text attributes.
|
||||||
|
## They are followed by character '$'. After that you can put:
|
||||||
|
##
|
||||||
|
## - 0 - default window color (discards all other colors)
|
||||||
|
## - 1 - black
|
||||||
|
## - 2 - red
|
||||||
|
## - 3 - green
|
||||||
|
## - 4 - yellow
|
||||||
|
## - 5 - blue
|
||||||
|
## - 6 - magenta
|
||||||
|
## - 7 - cyan
|
||||||
|
## - 8 - white
|
||||||
|
## - 9 - end of current color
|
||||||
|
## - b - bold text
|
||||||
|
## - u - underline text
|
||||||
|
## - r - reverse colors
|
||||||
|
## - a - use alternative character set
|
||||||
|
##
|
||||||
|
## If you don't want to use a non-color attribute anymore, just put it
|
||||||
|
## again, but this time insert character '/' between '$' and attribute
|
||||||
|
## character, e.g. {$b%t$/b}|{$r%f$/r} will display bolded title tag
|
||||||
|
## or filename with reversed colors.
|
||||||
|
##
|
||||||
|
## If you want to use 256 colors and/or background colors in formats
|
||||||
|
## (the naming scheme is described below in section about color
|
||||||
|
## definitions), it can be done with the syntax $(COLOR), e.g. to set
|
||||||
|
## the artist tag to one of the non-standard colors and make it have
|
||||||
|
## yellow background, you need to write $(197_yellow)%a$(end). Note
|
||||||
|
## that for standard colors this is interchangable with attributes
|
||||||
|
## listed above.
|
||||||
|
##
|
||||||
|
## Note: colors can be nested.
|
||||||
|
##
|
||||||
|
#
|
||||||
|
# song_list_format = {%a }$2%t$9 %C $R{%b }$2%25l$9
|
||||||
|
#song_list_format = {{$5%a$9 }{$7%A$9 }}{%n }$(16)%t$(end) $R{$8%l$9}
|
||||||
|
# song_status_format = {{%a{ $3%b{ (%y)}$9} }{$8%t$9}}|{%f}
|
||||||
|
#song_library_format = {%n - }{%t}|{%f}
|
||||||
|
song_list_format = "{$2%a$9} {$5%t$9} $R {$3%b$3} $9({$9%l$9})"
|
||||||
|
song_library_format = "%n %t"
|
||||||
|
song_status_format = "$b{$6%a$9 $1|$9} {$7%t$9} $1|$9 {$2%b$9} $1|$9 {$6%y$9} $1|$9"
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#alternative_header_first_line_format = $b$1$aqqu$/a$9 {%t}|{%f} $1$atqq$/a$9$/b
|
||||||
|
#alternative_header_second_line_format = {{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}}|{%D}
|
||||||
|
#
|
||||||
|
now_playing_prefix = "$(3_236)> "
|
||||||
|
now_playing_suffix = $0
|
||||||
|
#
|
||||||
|
#browser_playlist_prefix = "$2playlist$9 "
|
||||||
|
#
|
||||||
|
selected_item_prefix = "$(6_237)+ "
|
||||||
|
selected_item_suffix = $9
|
||||||
|
#
|
||||||
|
# modified_item_prefix = $3> $9
|
||||||
|
#
|
||||||
|
##
|
||||||
|
## Note: attributes are not supported for the following variables.
|
||||||
|
##
|
||||||
|
#song_window_title_format = {%a - }{%t}|{%f}
|
||||||
|
##
|
||||||
|
## Note: Below variables are used for sorting songs in browser.
|
||||||
|
## The sort mode determines how songs are sorted, and can be used
|
||||||
|
## in combination with a sort format to specify a custom sorting format.
|
||||||
|
## Available values for browser_sort_mode are "name", "mtime", "format"
|
||||||
|
## and "noop".
|
||||||
|
##
|
||||||
|
#
|
||||||
|
#browser_sort_mode = name
|
||||||
|
#browser_sort_format = {%a - }{%t}|{%f} {(%l)}
|
||||||
|
#
|
||||||
|
##### columns settings #####
|
||||||
|
##
|
||||||
|
## syntax of song columns list format is "column column etc."
|
||||||
|
##
|
||||||
|
## - syntax for each column is:
|
||||||
|
##
|
||||||
|
## (width of the column)[color of the column]{displayed tag}
|
||||||
|
##
|
||||||
|
## Note: Width is by default in %, if you want a column to
|
||||||
|
## have fixed size, add 'f' after the value, e.g. (10)[white]{a}
|
||||||
|
## will be the column that take 10% of screen (so the real width
|
||||||
|
## will depend on actual screen size), whereas (10f)[white]{a}
|
||||||
|
## will take 10 terminal cells, no matter how wide the screen is.
|
||||||
|
##
|
||||||
|
## - color is optional (if you want the default one,
|
||||||
|
## leave the field empty).
|
||||||
|
##
|
||||||
|
## Note: You can give a column additional attributes by putting appropriate
|
||||||
|
## character after displayed tag character. Available attributes are:
|
||||||
|
##
|
||||||
|
## - r - column will be right aligned
|
||||||
|
## - E - if tag is empty, empty tag marker won't be displayed
|
||||||
|
##
|
||||||
|
## You can also:
|
||||||
|
##
|
||||||
|
## - give a column custom name by putting it after attributes,
|
||||||
|
## separated with character ':', e.g. {lr:Length} gives you
|
||||||
|
## right aligned column of lengths named "Length".
|
||||||
|
##
|
||||||
|
## - define sequence of tags, that have to be displayed in case
|
||||||
|
## predecessor is empty in a way similar to the one in classic
|
||||||
|
## song format, i.e. using '|' character, e.g. {a|c|p:Owner}
|
||||||
|
## creates column named "Owner" that tries to display artist
|
||||||
|
## tag and then composer and performer if previous ones are
|
||||||
|
## not available.
|
||||||
|
##
|
||||||
|
song_columns_list_format = (3f)[241]{NEr:#} (8f)[5]{l} (22)[6]{a|A:Artist} (40)[9]{t|f:Title} (30)[13]{b}
|
||||||
|
#
|
||||||
|
##### various settings #####
|
||||||
|
#
|
||||||
|
##
|
||||||
|
## Note: Custom command that will be executed each
|
||||||
|
## time song changes. Useful for notifications etc.
|
||||||
|
##
|
||||||
|
execute_on_song_change = "mpd-notify-song"
|
||||||
|
#playlist_show_mpd_host = no
|
||||||
|
playlist_show_remaining_time = yes
|
||||||
|
playlist_shorten_total_times = yes
|
||||||
|
#playlist_separate_albums = no
|
||||||
|
#
|
||||||
|
##
|
||||||
|
## Note: Possible display modes: classic, columns.
|
||||||
|
##
|
||||||
|
playlist_display_mode = classic
|
||||||
|
browser_display_mode = columns
|
||||||
|
#search_engine_display_mode = classic
|
||||||
|
#playlist_editor_display_mode = classic
|
||||||
|
discard_colors_if_item_is_selected = yes
|
||||||
|
incremental_seeking = yes
|
||||||
|
seek_time = 2
|
||||||
|
volume_change_step = 10
|
||||||
|
#autocenter_mode = no
|
||||||
|
#centered_cursor = no
|
||||||
|
#
|
||||||
|
##
|
||||||
|
## Note: You can specify third character which will
|
||||||
|
## be used to build 'empty' part of progressbar.
|
||||||
|
##
|
||||||
|
progressbar_look = "─╼ "
|
||||||
|
#progressbar_boldness
|
||||||
|
progressbar_color = 1
|
||||||
|
progressbar_elapsed_color = 4
|
||||||
|
#
|
||||||
|
## Available values: database, playlist.
|
||||||
|
##
|
||||||
|
#default_place_to_search_in = database
|
||||||
|
#
|
||||||
|
## Available values: classic, alternative.
|
||||||
|
##
|
||||||
|
user_interface = alternative
|
||||||
|
#data_fetching_delay = yes
|
||||||
|
#
|
||||||
|
## Available values: artist, album_artist, date, genre, composer, performer.
|
||||||
|
##
|
||||||
|
#media_library_primary_tag = artist
|
||||||
|
#
|
||||||
|
## Available values: wrapped, normal.
|
||||||
|
##
|
||||||
|
#default_find_mode = wrapped
|
||||||
|
#default_tag_editor_pattern = %n - %t
|
||||||
|
header_visibility = yes
|
||||||
|
statusbar_visibility = yes
|
||||||
|
titles_visibility = no
|
||||||
|
#header_text_scrolling = yes
|
||||||
|
#cyclic_scrolling = no
|
||||||
|
#lines_scrolled = 2
|
||||||
|
#follow_now_playing_lyrics = no
|
||||||
|
#fetch_lyrics_for_current_song_in_background = no
|
||||||
|
#store_lyrics_in_song_dir = no
|
||||||
|
#generate_win32_compatible_filenames = yes
|
||||||
|
allow_for_physical_item_deletion = yes
|
||||||
|
#
|
||||||
|
##
|
||||||
|
## Note: If you set this variable, ncmpcpp will try to
|
||||||
|
## get info from last.fm in language you set and if it
|
||||||
|
## fails, it will fall back to english. Otherwise it will
|
||||||
|
## use english the first time.
|
||||||
|
##
|
||||||
|
## Note: Language has to be expressed as an ISO 639 alpha-2 code.
|
||||||
|
##
|
||||||
|
#lastfm_preferred_language = en
|
||||||
|
#show_hidden_files_in_local_browser = no
|
||||||
|
#
|
||||||
|
##
|
||||||
|
## How shall screen switcher work?
|
||||||
|
##
|
||||||
|
## - "previous" - switch between the current and previous screen.
|
||||||
|
## - "screen1,...,screenN" - switch between given sequence of screens.
|
||||||
|
##
|
||||||
|
## Screens available for use: help, playlist, browser, search_engine,
|
||||||
|
## media_library, playlist_editor, tag_editor, outputs, visualizer, clock.
|
||||||
|
##
|
||||||
|
#screen_switcher_mode = playlist, browser
|
||||||
|
#
|
||||||
|
##
|
||||||
|
## Note: You can define startup screen
|
||||||
|
## by choosing screen from the list above.
|
||||||
|
##
|
||||||
|
#startup_screen = playlist
|
||||||
|
#
|
||||||
|
##
|
||||||
|
## Note: You can define startup slave screen
|
||||||
|
## by choosing screen from the list above or
|
||||||
|
## an empty value for no slave screen.
|
||||||
|
##
|
||||||
|
#startup_slave_screen = ""
|
||||||
|
#startup_slave_screen_focus = no
|
||||||
|
#
|
||||||
|
##
|
||||||
|
## Default width of locked screen (in %).
|
||||||
|
## Acceptable values are from 20 to 80.
|
||||||
|
##
|
||||||
|
#
|
||||||
|
#locked_screen_width_part = 50
|
||||||
|
#ask_for_locked_screen_width_part = yes
|
||||||
|
jump_to_now_playing_song_at_start = yes
|
||||||
|
#ask_before_clearing_playlists = yes
|
||||||
|
#clock_display_seconds = no
|
||||||
|
#display_volume_level = no
|
||||||
|
#display_bitrate = yes
|
||||||
|
display_remaining_time = no
|
||||||
|
#
|
||||||
|
## Available values: none, basic, extended, perl.
|
||||||
|
##
|
||||||
|
#regular_expressions = perl
|
||||||
|
#
|
||||||
|
##
|
||||||
|
## Note: If below is enabled, ncmpcpp will ignore leading
|
||||||
|
## "The" word while sorting items in browser, tags in
|
||||||
|
## media library, etc.
|
||||||
|
##
|
||||||
|
#ignore_leading_the = no
|
||||||
|
#block_search_constraints_change_if_items_found = yes
|
||||||
|
#mouse_support = yes
|
||||||
|
#mouse_list_scroll_whole_page = yes
|
||||||
|
empty_tag_marker = <empty>
|
||||||
|
#tags_separator = " | "
|
||||||
|
tag_editor_extended_numeration = yes
|
||||||
|
#media_library_sort_by_mtime = no
|
||||||
|
enable_window_title = yes
|
||||||
|
#
|
||||||
|
##
|
||||||
|
## Note: You can choose default search mode for search
|
||||||
|
## engine. Available modes are:
|
||||||
|
##
|
||||||
|
## - 1 - use mpd built-in searching (no regexes, pattern matching)
|
||||||
|
## - 2 - use ncmpcpp searching (pattern matching with support for regexes,
|
||||||
|
## but if your mpd is on a remote machine, downloading big database
|
||||||
|
## to process it can take a while
|
||||||
|
## - 3 - match only exact values (this mode uses mpd function for searching
|
||||||
|
## in database and local one for searching in current playlist)
|
||||||
|
##
|
||||||
|
search_engine_default_search_mode = 2
|
||||||
|
external_editor = vim
|
||||||
|
|
||||||
|
## Note: set to yes if external editor is a console application.
|
||||||
|
use_console_editor = yes
|
||||||
|
|
||||||
|
##### colors definitions #####
|
||||||
|
##
|
||||||
|
## It is possible to set a background color by setting a color
|
||||||
|
## value "<foreground>_<background>", e.g. red_black will set
|
||||||
|
## foregound color to red and background color to black.
|
||||||
|
##
|
||||||
|
## In addition, for terminals that support 256 colors it
|
||||||
|
## is possible to set one of them by using a number in range
|
||||||
|
## [1, 256] instead of color name, e.g. numerical value
|
||||||
|
## corresponding to red_black is 2_1. To find out if the
|
||||||
|
## terminal supports 256 colors, run ncmpcpp and check out
|
||||||
|
## the bottom of the help screen for list of available colors
|
||||||
|
## and their numerical values.
|
||||||
|
##
|
||||||
|
## Note: due to technical limitations of ncurses, if 256 colors
|
||||||
|
## are used, it is possible to either use only the colors with
|
||||||
|
## default background color, or all pairs from 1_1 up to 254_127,
|
||||||
|
## depending on the ncurses version used.
|
||||||
|
##
|
||||||
|
colors_enabled = yes
|
||||||
|
empty_tag_color = 13
|
||||||
|
header_window_color = 241
|
||||||
|
volume_color = 239
|
||||||
|
state_line_color = 13
|
||||||
|
state_flags_color = 13
|
||||||
|
main_window_color = green
|
||||||
|
color1 = white
|
||||||
|
color2 = blue
|
||||||
|
# main_window_highlight_color = yellow
|
||||||
|
statusbar_color = 13
|
||||||
|
statusbar_time_color = 6
|
||||||
|
player_state_color = 14
|
||||||
|
alternative_ui_separator_color = 2
|
||||||
|
current_item_prefix = $(9_238)
|
||||||
|
current_item_suffix = $(end)
|
||||||
|
# active_column_color = red
|
||||||
|
window_border_color = 13
|
||||||
|
active_window_border = 13
|
349
config/qutebrowser/config.py
Normal file
349
config/qutebrowser/config.py
Normal file
|
@ -0,0 +1,349 @@
|
||||||
|
import os
|
||||||
|
import glob
|
||||||
|
|
||||||
|
## Load settings applied with :set
|
||||||
|
config.load_autoconfig()
|
||||||
|
|
||||||
|
## General config
|
||||||
|
c.content.default_encoding = 'utf-8'
|
||||||
|
c.content.javascript.enabled = True
|
||||||
|
c.content.local_storage = True
|
||||||
|
c.content.plugins = True
|
||||||
|
|
||||||
|
c.editor.encoding = 'utf-8'
|
||||||
|
|
||||||
|
## Security & privacy
|
||||||
|
c.content.autoplay = False # don't autoplay videos
|
||||||
|
|
||||||
|
## Adblocking
|
||||||
|
# Use (superior) Brave adblock if available, or fall back to host blocking
|
||||||
|
c.content.blocking.method = "auto"
|
||||||
|
c.content.blocking.hosts.lists = [
|
||||||
|
'https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts',
|
||||||
|
'https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext'
|
||||||
|
# 'https://www.malwaredomainlist.com/hostslist/hosts.txt',
|
||||||
|
# 'http://someonewhocares.org/hosts/hosts',
|
||||||
|
# 'http://winhelp2002.mvps.org/hosts.zip',
|
||||||
|
# 'http://malwaredomains.lehigh.edu/files/justdomains.zip',
|
||||||
|
]
|
||||||
|
# c.content.blocking.whitelist = []
|
||||||
|
|
||||||
|
## Options
|
||||||
|
c.downloads.position = 'bottom'
|
||||||
|
c.downloads.location.directory = os.path.expanduser("~/dl")
|
||||||
|
c.downloads.location.prompt = False
|
||||||
|
c.input.insert_mode.auto_leave = True
|
||||||
|
c.input.insert_mode.auto_load = False
|
||||||
|
c.input.links_included_in_focus_chain = False
|
||||||
|
c.new_instance_open_target = 'tab-silent'
|
||||||
|
c.prompt.filebrowser = False
|
||||||
|
c.prompt.radius = 0
|
||||||
|
c.spellcheck.languages = ['en-US']
|
||||||
|
c.session.lazy_restore = True
|
||||||
|
c.tabs.show = 'multiple'
|
||||||
|
c.tabs.title.format = '{audio}{current_title} - {host}'
|
||||||
|
c.tabs.title.format_pinned = ''
|
||||||
|
c.window.title_format = '{current_title} - {host} - qutebrowser'
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
## Keybindings
|
||||||
|
|
||||||
|
# Universal Emacsien C-g alias for Escape
|
||||||
|
config.bind('<Ctrl-g>', 'clear-keychain ;; search ;; fullscreen --leave')
|
||||||
|
for mode in ['caret', 'command', 'hint', 'insert', 'passthrough', 'prompt', 'register']:
|
||||||
|
config.bind('<Ctrl-g>', 'mode-leave', mode=mode)
|
||||||
|
|
||||||
|
# ...
|
||||||
|
config.bind('zz', 'close')
|
||||||
|
config.bind('tm', 'tab-mute')
|
||||||
|
config.bind('wi', 'devtools bottom')
|
||||||
|
config.bind(';;', 'hint inputs --first') # easier to reach than ;t
|
||||||
|
config.bind(';e', 'hint inputs --first ;; fake-key <Ctrl+a> ;; :spawn nohup bspc rule -a "Emacs:*" -o state=floating sticky=on && emacsclient --eval "(emacs-everywhere)"')
|
||||||
|
# ;v already bound to 'spawn mpv {url}'
|
||||||
|
config.bind(';V', 'hint links spawn mpv {hint-url}')
|
||||||
|
|
||||||
|
# Use external editor
|
||||||
|
c.editor.command = ['emacsclient', '-c', '-F', '((name . "qutebrowser-editor"))', '+{line}:{column}', '{}']
|
||||||
|
# Though we set it, I use the more specialzied emacs-everywhere instead
|
||||||
|
config.bind('<Ctrl+E>', 'edit-text', mode='insert')
|
||||||
|
config.bind('<Ctrl+E>', 'hint inputs --first ;; edit-text', mode='normal')
|
||||||
|
config.bind('<Shift+Ins>', 'fake-key <Ctrl+V>', mode='insert')
|
||||||
|
|
||||||
|
# Vaultwarden integration
|
||||||
|
config.bind(";pp", 'spawn -u qute-bwmenu')
|
||||||
|
config.bind(";pu", 'spawn -u qute-bwmenu --field username')
|
||||||
|
config.bind(";ps", 'spawn -u qute-bwmenu --field password')
|
||||||
|
config.bind(";po", 'spawn -u qute-bwmenu --field otp')
|
||||||
|
config.bind(";pl", 'spawn -u qute-bwmenu --last')
|
||||||
|
|
||||||
|
## Ex-commands
|
||||||
|
|
||||||
|
|
||||||
|
## Bindings for normal mode
|
||||||
|
# config.bind("'", 'enter-mode jump_mark')
|
||||||
|
# config.bind('+', 'zoom-in')
|
||||||
|
# config.bind('-', 'zoom-out')
|
||||||
|
# config.bind('.', 'repeat-command')
|
||||||
|
# config.bind('/', 'set-cmd-text /')
|
||||||
|
# config.bind(':', 'set-cmd-text :')
|
||||||
|
# config.bind(';I', 'hint images tab')
|
||||||
|
# config.bind(';O', 'hint links fill :open -t -r {hint-url}')
|
||||||
|
# config.bind(';R', 'hint --rapid links window')
|
||||||
|
# config.bind(';Y', 'hint links yank-primary')
|
||||||
|
# config.bind(';b', 'hint all tab-bg')
|
||||||
|
# config.bind(';d', 'hint links download')
|
||||||
|
# config.bind(';f', 'hint all tab-fg')
|
||||||
|
# config.bind(';h', 'hint all hover')
|
||||||
|
# config.bind(';i', 'hint images')
|
||||||
|
# config.bind(';o', 'hint links fill :open {hint-url}')
|
||||||
|
# config.bind(';r', 'hint --rapid links tab-bg')
|
||||||
|
# config.bind(';t', 'hint inputs')
|
||||||
|
# config.bind(';y', 'hint links yank')
|
||||||
|
# config.bind('<Alt-1>', 'tab-focus 1')
|
||||||
|
# config.bind('<Alt-2>', 'tab-focus 2')
|
||||||
|
# config.bind('<Alt-3>', 'tab-focus 3')
|
||||||
|
# config.bind('<Alt-4>', 'tab-focus 4')
|
||||||
|
# config.bind('<Alt-5>', 'tab-focus 5')
|
||||||
|
# config.bind('<Alt-6>', 'tab-focus 6')
|
||||||
|
# config.bind('<Alt-7>', 'tab-focus 7')
|
||||||
|
# config.bind('<Alt-8>', 'tab-focus 8')
|
||||||
|
# config.bind('<Alt-9>', 'tab-focus -1')
|
||||||
|
# config.bind('<Ctrl-A>', 'navigate increment')
|
||||||
|
# config.bind('<Ctrl-Alt-p>', 'print')
|
||||||
|
# config.bind('<Ctrl-B>', 'scroll-page 0 -1')
|
||||||
|
# config.bind('<Ctrl-D>', 'scroll-page 0 0.5')
|
||||||
|
# config.bind('<Ctrl-F5>', 'reload -f')
|
||||||
|
# config.bind('<Ctrl-F>', 'scroll-page 0 1')
|
||||||
|
# config.bind('<Ctrl-N>', 'open -w')
|
||||||
|
# config.bind('<Ctrl-PgDown>', 'tab-next')
|
||||||
|
# config.bind('<Ctrl-PgUp>', 'tab-prev')
|
||||||
|
# config.bind('<Ctrl-Q>', 'quit')
|
||||||
|
# config.bind('<Ctrl-Return>', 'follow-selected -t')
|
||||||
|
# config.bind('<Ctrl-Shift-N>', 'open -p')
|
||||||
|
# config.bind('<Ctrl-Shift-T>', 'undo')
|
||||||
|
# config.bind('<Ctrl-Shift-W>', 'close')
|
||||||
|
# config.bind('<Ctrl-T>', 'open -t')
|
||||||
|
# config.bind('<Ctrl-Tab>', 'tab-focus last')
|
||||||
|
# config.bind('<Ctrl-U>', 'scroll-page 0 -0.5')
|
||||||
|
# config.bind('<Ctrl-V>', 'enter-mode passthrough')
|
||||||
|
# config.bind('<Ctrl-W>', 'tab-close')
|
||||||
|
# config.bind('<Ctrl-X>', 'navigate decrement')
|
||||||
|
# config.bind('<Ctrl-^>', 'tab-focus last')
|
||||||
|
# config.bind('<Ctrl-h>', 'home')
|
||||||
|
# config.bind('<Ctrl-p>', 'tab-pin')
|
||||||
|
# config.bind('<Ctrl-s>', 'stop')
|
||||||
|
# config.bind('<Escape>', 'clear-keychain ;; search ;; fullscreen --leave')
|
||||||
|
# config.bind('<F11>', 'fullscreen')
|
||||||
|
# config.bind('<F5>', 'reload')
|
||||||
|
# config.bind('<Return>', 'follow-selected')
|
||||||
|
# config.bind('<back>', 'back')
|
||||||
|
# config.bind('<forward>', 'forward')
|
||||||
|
# config.bind('=', 'zoom')
|
||||||
|
# config.bind('?', 'set-cmd-text ?')
|
||||||
|
# config.bind('@', 'run-macro')
|
||||||
|
# config.bind('B', 'set-cmd-text -s :quickmark-load -t')
|
||||||
|
# config.bind('D', 'tab-close -o')
|
||||||
|
# config.bind('F', 'hint all tab')
|
||||||
|
# config.bind('G', 'scroll-to-perc')
|
||||||
|
# config.bind('H', 'back')
|
||||||
|
# config.bind('J', 'tab-next')
|
||||||
|
# config.bind('K', 'tab-prev')
|
||||||
|
# config.bind('L', 'forward')
|
||||||
|
# config.bind('M', 'bookmark-add')
|
||||||
|
# config.bind('N', 'search-prev')
|
||||||
|
# config.bind('O', 'set-cmd-text -s :open -t')
|
||||||
|
# config.bind('PP', 'open -t -- {primary}')
|
||||||
|
# config.bind('Pp', 'open -t -- {clipboard}')
|
||||||
|
# config.bind('R', 'reload -f')
|
||||||
|
# config.bind('Sb', 'open qute://bookmarks#bookmarks')
|
||||||
|
# config.bind('Sh', 'open qute://history')
|
||||||
|
# config.bind('Sq', 'open qute://bookmarks')
|
||||||
|
# config.bind('Ss', 'open qute://settings')
|
||||||
|
# config.bind('T', 'tab-focus')
|
||||||
|
# config.bind('ZQ', 'quit')
|
||||||
|
# config.bind('ZZ', 'quit --save')
|
||||||
|
# config.bind('[[', 'navigate prev')
|
||||||
|
# config.bind(']]', 'navigate next')
|
||||||
|
# config.bind('`', 'enter-mode set_mark')
|
||||||
|
# config.bind('ad', 'download-cancel')
|
||||||
|
# config.bind('b', 'set-cmd-text -s :quickmark-load')
|
||||||
|
# config.bind('cd', 'download-clear')
|
||||||
|
# config.bind('co', 'tab-only')
|
||||||
|
# config.bind('d', 'tab-close')
|
||||||
|
# config.bind('f', 'hint')
|
||||||
|
# config.bind('g$', 'tab-focus -1')
|
||||||
|
# config.bind('g0', 'tab-focus 1')
|
||||||
|
# config.bind('gB', 'set-cmd-text -s :bookmark-load -t')
|
||||||
|
# config.bind('gC', 'tab-clone')
|
||||||
|
# config.bind('gO', 'set-cmd-text :open -t -r {url:pretty}')
|
||||||
|
# config.bind('gU', 'navigate up -t')
|
||||||
|
# config.bind('g^', 'tab-focus 1')
|
||||||
|
# config.bind('ga', 'open -t')
|
||||||
|
# config.bind('gb', 'set-cmd-text -s :bookmark-load')
|
||||||
|
# config.bind('gd', 'download')
|
||||||
|
# config.bind('gf', 'view-source')
|
||||||
|
# config.bind('gg', 'scroll-to-perc 0')
|
||||||
|
# config.bind('gl', 'tab-move -')
|
||||||
|
# config.bind('gm', 'tab-move')
|
||||||
|
# config.bind('go', 'set-cmd-text :open {url:pretty}')
|
||||||
|
# config.bind('gr', 'tab-move +')
|
||||||
|
# config.bind('gt', 'set-cmd-text -s :buffer')
|
||||||
|
# config.bind('gu', 'navigate up')
|
||||||
|
# config.bind('h', 'scroll left')
|
||||||
|
# config.bind('i', 'enter-mode insert')
|
||||||
|
# config.bind('j', 'scroll down')
|
||||||
|
# config.bind('k', 'scroll up')
|
||||||
|
# config.bind('l', 'scroll right')
|
||||||
|
# config.bind('m', 'quickmark-save')
|
||||||
|
# config.bind('n', 'search-next')
|
||||||
|
# config.bind('o', 'set-cmd-text -s :open')
|
||||||
|
# config.bind('pP', 'open -- {primary}')
|
||||||
|
# config.bind('pp', 'open -- {clipboard}')
|
||||||
|
# config.bind('q', 'record-macro')
|
||||||
|
# config.bind('r', 'reload')
|
||||||
|
# config.bind('sf', 'save')
|
||||||
|
# config.bind('sk', 'set-cmd-text -s :bind')
|
||||||
|
# config.bind('sl', 'set-cmd-text -s :set -t')
|
||||||
|
# config.bind('ss', 'set-cmd-text -s :set')
|
||||||
|
# config.bind('th', 'back -t')
|
||||||
|
# config.bind('tl', 'forward -t')
|
||||||
|
# config.bind('u', 'undo')
|
||||||
|
# config.bind('v', 'enter-mode caret')
|
||||||
|
# config.bind('wB', 'set-cmd-text -s :bookmark-load -w')
|
||||||
|
# config.bind('wO', 'set-cmd-text :open -w {url:pretty}')
|
||||||
|
# config.bind('wP', 'open -w -- {primary}')
|
||||||
|
# config.bind('wb', 'set-cmd-text -s :quickmark-load -w')
|
||||||
|
# config.bind('wf', 'hint all window')
|
||||||
|
# config.bind('wh', 'back -w')
|
||||||
|
# config.bind('wi', 'inspector')
|
||||||
|
# config.bind('wl', 'forward -w')
|
||||||
|
# config.bind('wo', 'set-cmd-text -s :open -w')
|
||||||
|
# config.bind('wp', 'open -w -- {clipboard}')
|
||||||
|
# config.bind('xO', 'set-cmd-text :open -b -r {url:pretty}')
|
||||||
|
# config.bind('xb', 'config-cycle statusbar.hide')
|
||||||
|
# config.bind('xo', 'set-cmd-text -s :open -b')
|
||||||
|
# config.bind('xt', 'config-cycle tabs.show always switching')
|
||||||
|
# config.bind('xx', 'config-cycle statusbar.hide ;; config-cycle tabs.show always switching')
|
||||||
|
# config.bind('yD', 'yank domain -s')
|
||||||
|
# config.bind('yP', 'yank pretty-url -s')
|
||||||
|
# config.bind('yT', 'yank title -s')
|
||||||
|
# config.bind('yY', 'yank -s')
|
||||||
|
# config.bind('yd', 'yank domain')
|
||||||
|
# config.bind('yp', 'yank pretty-url')
|
||||||
|
# config.bind('yt', 'yank title')
|
||||||
|
# config.bind('yy', 'yank')
|
||||||
|
# config.bind('{{', 'navigate prev -t')
|
||||||
|
# config.bind('}}', 'navigate next -t')
|
||||||
|
|
||||||
|
## Bindings for caret mode
|
||||||
|
# config.bind('$', 'move-to-end-of-line', mode='caret')
|
||||||
|
# config.bind('0', 'move-to-start-of-line', mode='caret')
|
||||||
|
# config.bind('<Ctrl-Space>', 'drop-selection', mode='caret')
|
||||||
|
# config.bind('<Escape>', 'leave-mode', mode='caret')
|
||||||
|
# config.bind('<Return>', 'yank selection', mode='caret')
|
||||||
|
# config.bind('<Space>', 'toggle-selection', mode='caret')
|
||||||
|
# config.bind('G', 'move-to-end-of-document', mode='caret')
|
||||||
|
# config.bind('H', 'scroll left', mode='caret')
|
||||||
|
# config.bind('J', 'scroll down', mode='caret')
|
||||||
|
# config.bind('K', 'scroll up', mode='caret')
|
||||||
|
# config.bind('L', 'scroll right', mode='caret')
|
||||||
|
# config.bind('Y', 'yank selection -s', mode='caret')
|
||||||
|
# config.bind('[', 'move-to-start-of-prev-block', mode='caret')
|
||||||
|
# config.bind(']', 'move-to-start-of-next-block', mode='caret')
|
||||||
|
# config.bind('b', 'move-to-prev-word', mode='caret')
|
||||||
|
# config.bind('c', 'enter-mode normal', mode='caret')
|
||||||
|
# config.bind('e', 'move-to-end-of-word', mode='caret')
|
||||||
|
# config.bind('gg', 'move-to-start-of-document', mode='caret')
|
||||||
|
# config.bind('h', 'move-to-prev-char', mode='caret')
|
||||||
|
# config.bind('j', 'move-to-next-line', mode='caret')
|
||||||
|
# config.bind('k', 'move-to-prev-line', mode='caret')
|
||||||
|
# config.bind('l', 'move-to-next-char', mode='caret')
|
||||||
|
# config.bind('v', 'toggle-selection', mode='caret')
|
||||||
|
# config.bind('w', 'move-to-next-word', mode='caret')
|
||||||
|
# config.bind('y', 'yank selection', mode='caret')
|
||||||
|
# config.bind('{', 'move-to-end-of-prev-block', mode='caret')
|
||||||
|
# config.bind('}', 'move-to-end-of-next-block', mode='caret')
|
||||||
|
|
||||||
|
## Bindings for command mode
|
||||||
|
# config.bind('<Alt-B>', 'rl-backward-word', mode='command')
|
||||||
|
# config.bind('<Alt-Backspace>', 'rl-backward-kill-word', mode='command')
|
||||||
|
# config.bind('<Alt-D>', 'rl-kill-word', mode='command')
|
||||||
|
# config.bind('<Alt-F>', 'rl-forward-word', mode='command')
|
||||||
|
# config.bind('<Ctrl-?>', 'rl-delete-char', mode='command')
|
||||||
|
# config.bind('<Ctrl-A>', 'rl-beginning-of-line', mode='command')
|
||||||
|
# config.bind('<Ctrl-B>', 'rl-backward-char', mode='command')
|
||||||
|
# config.bind('<Ctrl-D>', 'completion-item-del', mode='command')
|
||||||
|
# config.bind('<Ctrl-E>', 'rl-end-of-line', mode='command')
|
||||||
|
# config.bind('<Ctrl-F>', 'rl-forward-char', mode='command')
|
||||||
|
config.bind('<Ctrl-B>', 'rl-backward-word', mode='command')
|
||||||
|
config.bind('<Ctrl-F>', 'rl-forward-word', mode='command')
|
||||||
|
# config.bind('<Ctrl-H>', 'rl-backward-delete-char', mode='command')
|
||||||
|
# config.bind('<Ctrl-K>', 'rl-kill-line', mode='command')
|
||||||
|
# config.bind('<Ctrl-N>', 'command-history-next', mode='command')
|
||||||
|
# config.bind('<Ctrl-P>', 'command-history-prev', mode='command')
|
||||||
|
# config.bind('<Ctrl-Shift-Tab>', 'completion-item-focus prev-category', mode='command')
|
||||||
|
# config.bind('<Ctrl-Tab>', 'completion-item-focus next-category', mode='command')
|
||||||
|
# config.bind('<Ctrl-U>', 'rl-unix-line-discard', mode='command')
|
||||||
|
# config.bind('<Ctrl-W>', 'rl-unix-word-rubout', mode='command')
|
||||||
|
# config.bind('<Ctrl-Y>', 'rl-yank', mode='command')
|
||||||
|
# config.bind('<Down>', 'command-history-next', mode='command')
|
||||||
|
# config.bind('<Escape>', 'leave-mode', mode='command')
|
||||||
|
# config.bind('<Return>', 'command-accept', mode='command')
|
||||||
|
# config.bind('<Shift-Delete>', 'completion-item-del', mode='command')
|
||||||
|
# config.bind('<Shift-Tab>', 'completion-item-focus prev', mode='command')
|
||||||
|
# config.bind('<Tab>', 'completion-item-focus next', mode='command')
|
||||||
|
# config.bind('<Up>', 'command-history-prev', mode='command')
|
||||||
|
|
||||||
|
## Bindings for hint mode
|
||||||
|
# config.bind('<Ctrl-B>', 'hint all tab-bg', mode='hint')
|
||||||
|
# config.bind('<Ctrl-F>', 'hint links', mode='hint')
|
||||||
|
# config.bind('<Ctrl-R>', 'hint --rapid links tab-bg', mode='hint')
|
||||||
|
# config.bind('<Escape>', 'mode-leave', mode='hint')
|
||||||
|
# config.bind('<Return>', 'follow-hint', mode='hint')
|
||||||
|
|
||||||
|
## Bindings for insert mode
|
||||||
|
# config.bind('<Ctrl-E>', 'open-editor', mode='insert')
|
||||||
|
# config.bind('<Escape>', 'leave-mode', mode='insert')
|
||||||
|
# config.bind('<Shift-Ins>', 'insert-text {primary}', mode='insert')
|
||||||
|
|
||||||
|
## Bindings for passthrough mode
|
||||||
|
# config.bind('<Ctrl-V>', 'leave-mode', mode='passthrough')
|
||||||
|
|
||||||
|
## Bindings for prompt mode
|
||||||
|
# config.bind('<Alt-B>', 'rl-backward-word', mode='prompt')
|
||||||
|
# config.bind('<Alt-Backspace>', 'rl-backward-kill-word', mode='prompt')
|
||||||
|
# config.bind('<Alt-D>', 'rl-kill-word', mode='prompt')
|
||||||
|
# config.bind('<Alt-F>', 'rl-forward-word', mode='prompt')
|
||||||
|
# config.bind('<Ctrl-?>', 'rl-delete-char', mode='prompt')
|
||||||
|
# config.bind('<Ctrl-A>', 'rl-beginning-of-line', mode='prompt')
|
||||||
|
# config.bind('<Ctrl-B>', 'rl-backward-char', mode='prompt')
|
||||||
|
# config.bind('<Ctrl-E>', 'rl-end-of-line', mode='prompt')
|
||||||
|
# config.bind('<Ctrl-F>', 'rl-forward-char', mode='prompt')
|
||||||
|
config.bind('<Ctrl-B>', 'rl-backward-word', mode='prompt')
|
||||||
|
config.bind('<Ctrl-F>', 'rl-forward-word', mode='prompt')
|
||||||
|
# config.bind('<Ctrl-H>', 'rl-backward-delete-char', mode='prompt')
|
||||||
|
# config.bind('<Ctrl-K>', 'rl-kill-line', mode='prompt')
|
||||||
|
# config.bind('<Ctrl-U>', 'rl-unix-line-discard', mode='prompt')
|
||||||
|
# config.bind('<Ctrl-W>', 'rl-unix-word-rubout', mode='prompt')
|
||||||
|
# config.bind('<Ctrl-X>', 'prompt-open-download', mode='prompt')
|
||||||
|
# config.bind('<Ctrl-Y>', 'rl-yank', mode='prompt')
|
||||||
|
# config.bind('<Down>', 'prompt-item-focus next', mode='prompt')
|
||||||
|
# config.bind('<Escape>', 'leave-mode', mode='prompt')
|
||||||
|
# config.bind('<Return>', 'prompt-accept', mode='prompt')
|
||||||
|
# config.bind('<Shift-Tab>', 'prompt-item-focus prev', mode='prompt')
|
||||||
|
# config.bind('<Tab>', 'prompt-item-focus next', mode='prompt')
|
||||||
|
# config.bind('<Up>', 'prompt-item-focus prev', mode='prompt')
|
||||||
|
# config.bind('n', 'prompt-accept no', mode='prompt')
|
||||||
|
# config.bind('y', 'prompt-accept yes', mode='prompt')
|
||||||
|
|
||||||
|
## Bindings for register mode
|
||||||
|
# config.bind('<Escape>', 'leave-mode', mode='register')
|
||||||
|
|
||||||
|
## Per-domain settings
|
||||||
|
c.content.user_stylesheets = glob.glob(os.path.expanduser('~/.local/share/qutebrowser/userstyles.css'))
|
||||||
|
|
||||||
|
|
||||||
|
## Load theme
|
||||||
|
for path in glob.glob(os.path.expanduser('~/.config/qutebrowser/extra/*.py')):
|
||||||
|
config.source(path)
|
23
config/qutebrowser/greasemonkey/let-there-be-light.user.js
Normal file
23
config/qutebrowser/greasemonkey/let-there-be-light.user.js
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
// ==UserScript==
|
||||||
|
// @name Let there be Light
|
||||||
|
// @description Change page background to white.
|
||||||
|
// @version 0.1
|
||||||
|
// @author Ingvix
|
||||||
|
// @include *
|
||||||
|
// ==/UserScript==
|
||||||
|
|
||||||
|
// Needed to counterbalance my colors.webpage.bg hack to prevent the blinding
|
||||||
|
// flash of white between page loads.
|
||||||
|
(function () {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
function _bg(element) {
|
||||||
|
return window.getComputedStyle(element).backgroundColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_bg(document.documentElement) === "rgba(0, 0, 0, 0)" &&
|
||||||
|
_bg(document.body) === "rgba(0, 0, 0, 0)") {
|
||||||
|
var sheet = window.document.styleSheets[0];
|
||||||
|
sheet.insertRule('body { background-color: white; }', sheet.cssRules.length);
|
||||||
|
}
|
||||||
|
})();
|
|
@ -0,0 +1,21 @@
|
||||||
|
// ==UserScript==
|
||||||
|
// @name DomainStyles
|
||||||
|
// @namespace https://github.com/hlissner
|
||||||
|
// @description Make it possible to use per-domain stylesheets.
|
||||||
|
// @include *
|
||||||
|
// @run-at document-start
|
||||||
|
// @version 1
|
||||||
|
// @author Henrik Lissner
|
||||||
|
// ==/UserScript==
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
document.addEventListener('readystatechange', function onReadyStateChange() {
|
||||||
|
if (document.readyState == 'interactive') {
|
||||||
|
const doc = document.documentElement;
|
||||||
|
doc.setAttribute('qb-url', window.location.href);
|
||||||
|
doc.setAttribute('qb-domain', window.location.host);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
124
config/stumpwm/config
Normal file
124
config/stumpwm/config
Normal file
|
@ -0,0 +1,124 @@
|
||||||
|
;; -*- lisp -*-
|
||||||
|
;;
|
||||||
|
;; Author: Henrik Lissner <henrik@lissner.net>
|
||||||
|
;; URL: https://github.com/hlissner/doom-emacs
|
||||||
|
;;
|
||||||
|
;;;
|
||||||
|
(in-package :stumpwm)
|
||||||
|
;; (swank:create-server
|
||||||
|
;; :dont-close t
|
||||||
|
;; :port swank::default-server-port)
|
||||||
|
|
||||||
|
;;;
|
||||||
|
(defvar *config-dir* "~/.config/dotfiles/config/stumpwm")
|
||||||
|
|
||||||
|
(defcommand reload-dotfiles () ()
|
||||||
|
(load (concat *config-dir* "/config"))
|
||||||
|
(message "Config reloaded"))
|
||||||
|
(define-key *top-map* (kbd "s-r") "reload-dotfiles")
|
||||||
|
|
||||||
|
;; (load (concat *config-dir* "/core/core.lisp"))
|
||||||
|
|
||||||
|
|
||||||
|
(defun show-key-seq (key seq val)
|
||||||
|
(message (print-key-seq (reverse seq))))
|
||||||
|
(add-hook *key-press-hook* 'show-key-seq)
|
||||||
|
|
||||||
|
|
||||||
|
;;; Config
|
||||||
|
(setf *mouse-focus-policy* :click)
|
||||||
|
(set-font "-CTDB-Fira Sans-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1")
|
||||||
|
|
||||||
|
|
||||||
|
;;; Keybinds
|
||||||
|
(set-prefix-key (kbd "C-z"))
|
||||||
|
(define-key *top-map* (kbd "C-RET") "exec urxvt")
|
||||||
|
|
||||||
|
(let ((map *top-map*))
|
||||||
|
;; (gnew "a")
|
||||||
|
;; (gnew "b")
|
||||||
|
;; (gnew "c")
|
||||||
|
(dotimes (i 9)
|
||||||
|
(define-key map (kbd (format nil "s-~D" i))
|
||||||
|
(format nil "gselect ~D" i))
|
||||||
|
(define-key map (kbd (format nil "s-S-~D" i))
|
||||||
|
(format nil "gmove ~D" i))))
|
||||||
|
|
||||||
|
;; Window management
|
||||||
|
(define-key *top-map* (kbd "s-f") "float-this")
|
||||||
|
(define-key *top-map* (kbd "s-F") "unfloat-this")
|
||||||
|
|
||||||
|
(define-key *top-map* (kbd "s-h") "move-focus left")
|
||||||
|
(define-key *top-map* (kbd "s-j") "move-focus down")
|
||||||
|
(define-key *top-map* (kbd "s-k") "move-focus up")
|
||||||
|
(define-key *top-map* (kbd "s-l") "move-focus right")
|
||||||
|
|
||||||
|
(define-key *top-map* (kbd "s-H") "move-window left")
|
||||||
|
(define-key *top-map* (kbd "s-J") "move-window down")
|
||||||
|
(define-key *top-map* (kbd "s-K") "move-window up")
|
||||||
|
(define-key *top-map* (kbd "s-L") "move-window right")
|
||||||
|
|
||||||
|
(define-key *top-map* (kbd "s-RET") "exec xst")
|
||||||
|
(define-key *top-map* (kbd "s-SPC") "exec rofi/appmenu")
|
||||||
|
|
||||||
|
(define-key *top-map* (kbd "s-TAB") "next-in-frame")
|
||||||
|
(define-key *top-map* (kbd "s-ISO_Left_Tab") "prev-in-frame")
|
||||||
|
|
||||||
|
(define-key *top-map* (kbd "s-`") "exec scratch")
|
||||||
|
|
||||||
|
|
||||||
|
(defvar *window-manipulation-map* (make-sparse-keymap))
|
||||||
|
|
||||||
|
(defcommand kill-or-delete-window () ()
|
||||||
|
(and (delete-window)
|
||||||
|
(remove-split)))
|
||||||
|
|
||||||
|
(define-key *top-map* (kbd "s-q") "delete-window")
|
||||||
|
(define-key *top-map* (kbd "s-Q") "kill-or-delete-window")
|
||||||
|
(define-key *top-map* (kbd "s-w") *window-manipulation-map*)
|
||||||
|
(let ((map *window-manipulation-map*))
|
||||||
|
(define-key map (kbd "s-c") "remove-split")
|
||||||
|
(define-key map (kbd "s-s") "hsplit")
|
||||||
|
(define-key map (kbd "s-v") "vsplit"))
|
||||||
|
|
||||||
|
|
||||||
|
;;; Modeline
|
||||||
|
(setf *bar-med-color* "^B^3")
|
||||||
|
(setf *bar-hi-color* "^B^3")
|
||||||
|
(setf *bar-crit-color* "^B^1")
|
||||||
|
|
||||||
|
(setf *colors*
|
||||||
|
'("#101216" ; fg
|
||||||
|
"#f9a03f" ; orange
|
||||||
|
"#8BD49C" ; green
|
||||||
|
"#8abeb7" ; cyan
|
||||||
|
"#5EC4FF" ; blue
|
||||||
|
"#cc6666" ; red
|
||||||
|
"#E27E8D" ; magenta
|
||||||
|
"#f0c674" ; yellow
|
||||||
|
))
|
||||||
|
|
||||||
|
(update-color-map (current-screen))
|
||||||
|
|
||||||
|
(setf *group-format* " %t ")
|
||||||
|
(setf *window-format* "%m%s%20t ")
|
||||||
|
(setf *mode-line-timeout* 1)
|
||||||
|
|
||||||
|
(setf *time-modeline-string* "^B^3 %e %b %H:%M ^n")
|
||||||
|
|
||||||
|
(set-focus-color (elt *colors* 6))
|
||||||
|
(set-unfocus-color (elt *colors* 0))
|
||||||
|
|
||||||
|
(setf *screen-mode-line-format*
|
||||||
|
(list "^B^3%g ^n^b %W ^> "
|
||||||
|
" %B %d"
|
||||||
|
))
|
||||||
|
|
||||||
|
(setf *mode-line-border-width* 0)
|
||||||
|
(setf *mode-line-pad-x* 0)
|
||||||
|
(setf *mode-line-pad-y* 0)
|
||||||
|
(setf *mode-line-background-color* (elt *colors* 0))
|
||||||
|
(setf *mode-line-foreground-color* (elt *colors* 1))
|
||||||
|
|
||||||
|
(unless (head-mode-line (current-head))
|
||||||
|
(toggle-mode-line (current-screen) (current-head)))
|
|
@ -13,43 +13,42 @@ super + apostrophe
|
||||||
# Attach to a detached session. If none is available create a new one, rather
|
# Attach to a detached session. If none is available create a new one, rather
|
||||||
# than attach to one that is already attached to elsewhere.
|
# than attach to one that is already attached to elsewhere.
|
||||||
super + Return
|
super + Return
|
||||||
kitty
|
|
||||||
|
|
||||||
ctrl + super + Return
|
|
||||||
xst -e bash -c "(tmux ls | grep -qEv 'attached|scratch' && tmux at) || tmux"
|
xst -e bash -c "(tmux ls | grep -qEv 'attached|scratch' && tmux at) || tmux"
|
||||||
|
|
||||||
|
ctrl + super + Return
|
||||||
|
xst
|
||||||
|
|
||||||
|
# Open a disposable, floating terminal window, for quick shell commands.
|
||||||
|
super + grave
|
||||||
|
scratch
|
||||||
|
|
||||||
|
# Open a disposable scratch buffer in a floating Emacs window, to run arbitrary
|
||||||
|
# code or quickly note something down.
|
||||||
|
super + shift + grave
|
||||||
|
emacsclient --eval "(open-scratch-frame)"
|
||||||
|
|
||||||
|
# Invoke emacs-everywhere at point.
|
||||||
|
super + e
|
||||||
|
emacsclient --eval "(emacs-everywhere)"
|
||||||
|
|
||||||
super + space
|
super + space
|
||||||
rofi -show drun -modi drun,run -show-icons -theme theme/appmenu.rasi
|
$DOTFILES_BIN/rofi/appmenu
|
||||||
|
|
||||||
super + Tab
|
super + Tab
|
||||||
rofi -show window -show-icons -theme theme/windowmenu.rasi
|
$DOTFILES_BIN/rofi/windowmenu
|
||||||
|
|
||||||
super + e
|
|
||||||
rofimoji --selector-args "-theme theme/emojimenu.rasi" --skin-tone moderate --action copy
|
|
||||||
|
|
||||||
super + a
|
|
||||||
paste
|
|
||||||
|
|
||||||
super + p
|
super + p
|
||||||
passmenu
|
$DOTFILES_BIN/rofi/bwmenu
|
||||||
|
|
||||||
super + s
|
super + shift + p
|
||||||
powermenu
|
$DOTFILES_BIN/rofi/bwmenu -r
|
||||||
|
|
||||||
super + o
|
super + slash
|
||||||
screenshot
|
$DOTFILES_BIN/rofi/filemenu -x
|
||||||
|
|
||||||
super + w
|
super + Escape
|
||||||
wifimenu
|
pkill -USR1 -x sxhkd
|
||||||
|
|
||||||
super + b
|
|
||||||
bluetoothmenu
|
|
||||||
|
|
||||||
# super + Escape
|
|
||||||
# pkill -USR1 -x sxhkd
|
|
||||||
|
|
||||||
super + n
|
|
||||||
xkblayout-state set +1
|
|
||||||
|
|
||||||
#
|
#
|
||||||
##
|
##
|
||||||
|
@ -58,15 +57,16 @@ super + n
|
||||||
super + {_,ctrl + }f
|
super + {_,ctrl + }f
|
||||||
bspc node -t ~{floating,fullscreen}
|
bspc node -t ~{floating,fullscreen}
|
||||||
|
|
||||||
super + {_,shift + }{h,j,k,l}
|
|
||||||
bspc node -{f,s} {west,south,north,east}
|
|
||||||
|
|
||||||
super + ctrl + {h,j,k,l}
|
super + {_,ctrl +}{h,j,k,l}
|
||||||
bspc node -p {west,south,north,east}
|
$DOTFILES_BIN/bspwm/focus {_,-m }{west,south,north,east}
|
||||||
|
|
||||||
|
super + shift + {_,ctrl +}{h,j,k,l}
|
||||||
|
$DOTFILES_BIN/bspwm/swap {_,-m }{west,south,north,east}
|
||||||
|
|
||||||
## Resize by preselection
|
## Resize by preselection
|
||||||
super + alt + {1-9}
|
super + alt + {1-9}
|
||||||
$DOTFLES/bin/bspwm/presel 0.{1-9}
|
$DOTFILES/bin/bspwm/presel 0.{1-9}
|
||||||
|
|
||||||
super + alt + {h,j,k,l}
|
super + alt + {h,j,k,l}
|
||||||
bspc node -p {west,south,north,east}
|
bspc node -p {west,south,north,east}
|
||||||
|
@ -95,8 +95,6 @@ super + shift + {Left,Down,Up,Right}
|
||||||
|
|
||||||
#
|
#
|
||||||
## Media keys
|
## Media keys
|
||||||
super + u
|
|
||||||
mpv-ify
|
|
||||||
|
|
||||||
# screenshot region
|
# screenshot region
|
||||||
Print
|
Print
|
27
config/tmux/aliases.zsh
Normal file
27
config/tmux/aliases.zsh
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
alias ta='tmux attach'
|
||||||
|
alias tl='tmux ls'
|
||||||
|
|
||||||
|
if [[ -n $TMUX ]]; then # From inside tmux
|
||||||
|
alias tf='tmux find-window'
|
||||||
|
# Detach all other clients to this session
|
||||||
|
alias mine='tmux detach -a'
|
||||||
|
# Send command to other tmux window
|
||||||
|
tt() {
|
||||||
|
tmux send-keys -t .+ C-u && \
|
||||||
|
tmux set-buffer "$*" && \
|
||||||
|
tmux paste-buffer -t .+ && \
|
||||||
|
tmux send-keys -t .+ Enter;
|
||||||
|
}
|
||||||
|
# Create new session (from inside one)
|
||||||
|
tn() {
|
||||||
|
local name="${1:-`basename $PWD`}"
|
||||||
|
TMUX= tmux new-session -d -s "$name"
|
||||||
|
tmux switch-client -t "$name"
|
||||||
|
tmux display-message "Session #S created"
|
||||||
|
}
|
||||||
|
else # From outside tmux
|
||||||
|
# Start grouped session so I can be in two different windows in one session
|
||||||
|
tdup() { tmux new-session -t "${1:-`tmux display-message -p '#S'`}"; }
|
||||||
|
fi
|
23
config/tmux/swap-pane.sh
Executable file
23
config/tmux/swap-pane.sh
Executable file
|
@ -0,0 +1,23 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
CONF="$TMUX_PLUGINS_PATH/lastpane"
|
||||||
|
swap() { tmux swap-pane -s"$1" -t"$2"; }
|
||||||
|
|
||||||
|
target=
|
||||||
|
case $1 in
|
||||||
|
up) target="U" ;;
|
||||||
|
down) target="D" ;;
|
||||||
|
left) target="L" ;;
|
||||||
|
right) target="R" ;;
|
||||||
|
master) target="M" ;;
|
||||||
|
*) exit 1 ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
src_pane=$(tmux display-message -p "#P")
|
||||||
|
tmux select-pane -${target}
|
||||||
|
|
||||||
|
dst_pane=$(tmux display-message -p "#P")
|
||||||
|
tmux select-pane -${src_pane}
|
||||||
|
|
||||||
|
[[ "$target" == M ]] && dst_pane=0
|
||||||
|
swap "$src_pane" "$dst_pane"
|
||||||
|
tmux select-pane -t"$dst_pane"
|
124
config/tmux/tmux.conf
Normal file
124
config/tmux/tmux.conf
Normal file
|
@ -0,0 +1,124 @@
|
||||||
|
# tmux.conf
|
||||||
|
# By Henrik Lissner <henrik@lissner.net>
|
||||||
|
# https://github.com/hlissner/dotfiles
|
||||||
|
########################################
|
||||||
|
|
||||||
|
set -g default-terminal "xterm-256color"
|
||||||
|
|
||||||
|
new-session # spawn session if attaching when none are running
|
||||||
|
|
||||||
|
setw -g automatic-rename on # rename window after current program
|
||||||
|
set -g renumber-windows on # renumber windows when one is closed
|
||||||
|
# Zero-based indexing is fine in programming languages, but not so much in a
|
||||||
|
# multiplexer when zero is on the other side of the keyboard.
|
||||||
|
set -g base-index 1
|
||||||
|
setw -g pane-base-index 1
|
||||||
|
# display tmux messages longer
|
||||||
|
set -g display-time 1500
|
||||||
|
set -g display-panes-time 800
|
||||||
|
# Address vim-mode switching delay (http://superuser.com/a/252717/65504)
|
||||||
|
set -s escape-time 0
|
||||||
|
set -sg repeat-time 600
|
||||||
|
set -g history-limit 10000
|
||||||
|
# Rather than constraining window size to the maximum size of any client
|
||||||
|
# connected to the *session*, constrain window size to the maximum size of any
|
||||||
|
# client connected to *that window*. Much more reasonable.
|
||||||
|
setw -g aggressive-resize off
|
||||||
|
# For terminals that support them, propagate these events to programs that
|
||||||
|
# understand them.
|
||||||
|
set -s focus-events on
|
||||||
|
# Enable mouse + mouse wheel
|
||||||
|
set -g mouse on
|
||||||
|
|
||||||
|
########################################
|
||||||
|
# Keybinds #
|
||||||
|
########################################
|
||||||
|
|
||||||
|
# Rebind prefix to C-c. Press twice to send literal C-c.
|
||||||
|
unbind C-b
|
||||||
|
set -g prefix C-c
|
||||||
|
bind C-c send-prefix
|
||||||
|
|
||||||
|
# Vi-style keybinds
|
||||||
|
set -g status-keys vi
|
||||||
|
set -g mode-keys vi
|
||||||
|
|
||||||
|
bind c new-window -c "#{pane_current_path}"
|
||||||
|
bind v split-window -h -c "#{pane_current_path}"
|
||||||
|
bind s split-window -v -c "#{pane_current_path}"
|
||||||
|
|
||||||
|
bind h select-pane -L
|
||||||
|
bind j select-pane -D
|
||||||
|
bind k select-pane -U
|
||||||
|
bind l select-pane -R
|
||||||
|
bind H run '$TMUX_HOME/swap-pane.sh left'
|
||||||
|
bind J run '$TMUX_HOME/swap-pane.sh down'
|
||||||
|
bind K run '$TMUX_HOME/swap-pane.sh up'
|
||||||
|
bind L run '$TMUX_HOME/swap-pane.sh right'
|
||||||
|
bind M run '$TMUX_HOME/swap-pane.sh master'
|
||||||
|
|
||||||
|
bind o resize-pane -Z
|
||||||
|
bind S choose-session
|
||||||
|
bind W choose-window
|
||||||
|
bind / choose-session
|
||||||
|
bind . choose-window
|
||||||
|
|
||||||
|
# bind = select-layout tiled
|
||||||
|
bind | select-layout even-horizontal
|
||||||
|
bind _ select-layout even-vertical
|
||||||
|
|
||||||
|
# Disable confirmation
|
||||||
|
bind x kill-pane
|
||||||
|
bind X kill-window
|
||||||
|
bind q kill-session
|
||||||
|
bind Q kill-server
|
||||||
|
|
||||||
|
# Smart pane switching with awareness of vim splits
|
||||||
|
# See: https://github.com/christoomey/vim-tmux-navigator
|
||||||
|
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(diff)?$"'
|
||||||
|
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
|
||||||
|
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
|
||||||
|
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
|
||||||
|
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
|
||||||
|
bind -n C-\\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
|
||||||
|
bind C-w last-pane
|
||||||
|
bind C-n next-window
|
||||||
|
bind C-p previous-window
|
||||||
|
|
||||||
|
# break pane into a window
|
||||||
|
bind = select-layout even-vertical
|
||||||
|
bind + select-layout even-horizontal
|
||||||
|
bind - break-pane
|
||||||
|
bind _ join-pane
|
||||||
|
|
||||||
|
# reload config without killing server
|
||||||
|
bind r source-file $DOTFILES/config/tmux/tmux.conf \; display-message " Config reloaded..".
|
||||||
|
bind ^r refresh-client
|
||||||
|
|
||||||
|
|
||||||
|
########################################
|
||||||
|
# Copy mode #
|
||||||
|
########################################
|
||||||
|
|
||||||
|
bind Enter copy-mode # enter copy mode
|
||||||
|
bind b list-buffers # list paster buffers
|
||||||
|
bind B choose-buffer # choose which buffer to paste from
|
||||||
|
bind p paste-buffer # paste from the top paste buffer
|
||||||
|
bind P run "xclip -selection clipboard -o | tmux load-buffer - ; tmux paste-buffer"
|
||||||
|
|
||||||
|
bind -T copy-mode-vi v send-keys -X begin-selection
|
||||||
|
bind -T copy-mode-vi C-v send-keys -X rectangle-toggle
|
||||||
|
bind -T copy-mode-vi Escape send-keys -X cancel
|
||||||
|
bind -T copy-mode-vi C-g send-keys -X cancel
|
||||||
|
bind -T copy-mode-vi H send-keys -X start-of-line
|
||||||
|
bind -T copy-mode-vi L send-keys -X end-of-line
|
||||||
|
|
||||||
|
|
||||||
|
########################################
|
||||||
|
# Local config #
|
||||||
|
########################################
|
||||||
|
set -g @open-editor 'C-e'
|
||||||
|
set -g @open-S 'https://www.duckduckgo.com/'
|
||||||
|
|
||||||
|
source $TMUX_HOME/extraInit
|
||||||
|
if '[ -f ~/.tmux.conf ]' 'source ~/.tmux.conf'
|
5
config/zsh/.zshenv
Normal file
5
config/zsh/.zshenv
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
## Auto-generated by my nix config
|
||||||
|
[ -f "${0:a:h}/extra.zshenv" ] && source "${0:a:h}/extra.zshenv"
|
||||||
|
|
||||||
|
# If you have host-local configuration, this is where you'd put it
|
||||||
|
[ -f ~/.zshenv ] && source ~/.zshenv
|
51
config/zsh/.zshrc
Normal file
51
config/zsh/.zshrc
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
[ -d "$ZGEN_DIR" ] || git clone https://github.com/tarjoilija/zgen "$ZGEN_DIR"
|
||||||
|
source $ZGEN_SOURCE
|
||||||
|
if ! zgen saved; then
|
||||||
|
echo "Initializing zgen"
|
||||||
|
zgen load hlissner/zsh-autopair autopair.zsh
|
||||||
|
zgen load zsh-users/zsh-history-substring-search
|
||||||
|
zgen load zdharma/history-search-multi-word
|
||||||
|
zgen load zsh-users/zsh-completions src
|
||||||
|
zgen load junegunn/fzf shell
|
||||||
|
[ -z "$SSH_CONNECTION" ] && zgen load zdharma/fast-syntax-highlighting
|
||||||
|
zgen save
|
||||||
|
fi
|
||||||
|
|
||||||
|
source $ZDOTDIR/config.zsh
|
||||||
|
if [[ $TERM != dumb ]]; then
|
||||||
|
source $ZDOTDIR/keybinds.zsh
|
||||||
|
source $ZDOTDIR/completion.zsh
|
||||||
|
source $ZDOTDIR/aliases.zsh
|
||||||
|
|
||||||
|
##
|
||||||
|
function _cache {
|
||||||
|
command -v "$1" >/dev/null || return 1
|
||||||
|
local cache_dir="$XDG_CACHE_HOME/${SHELL##*/}"
|
||||||
|
local cache="$cache_dir/$1"
|
||||||
|
if [[ ! -f $cache || ! -s $cache ]]; then
|
||||||
|
echo "Caching $1"
|
||||||
|
mkdir -p $cache_dir
|
||||||
|
"$@" >$cache
|
||||||
|
fi
|
||||||
|
source $cache || rm -f $cache
|
||||||
|
}
|
||||||
|
|
||||||
|
# fd > find
|
||||||
|
if command -v fd >/dev/null; then
|
||||||
|
export FZF_DEFAULT_OPTS="--reverse --ansi"
|
||||||
|
export FZF_DEFAULT_COMMAND="fd ."
|
||||||
|
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
|
||||||
|
export FZF_ALT_C_COMMAND="fd -t d . $HOME"
|
||||||
|
fi
|
||||||
|
_cache fasd --init posix-alias zsh-{hook,{c,w}comp{,-install}}
|
||||||
|
|
||||||
|
## Auto-generated by my nix config
|
||||||
|
source $ZDOTDIR/extra.zshrc
|
||||||
|
|
||||||
|
##
|
||||||
|
autoload -Uz compinit && compinit -u -d $ZSH_CACHE/zcompdump
|
||||||
|
autopair-init
|
||||||
|
|
||||||
|
# If you have host-local configuration, this is where you'd put it
|
||||||
|
[ -f ~/.zshrc ] && source ~/.zshrc
|
||||||
|
fi
|
74
config/zsh/aliases.zsh
Normal file
74
config/zsh/aliases.zsh
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
alias ..='cd ..'
|
||||||
|
alias ...='cd ../..'
|
||||||
|
alias ....='cd ../../..'
|
||||||
|
alias -- -='cd -'
|
||||||
|
alias cdg='cd `git rev-parse --show-toplevel`'
|
||||||
|
|
||||||
|
alias q=exit
|
||||||
|
alias clr=clear
|
||||||
|
alias sudo='sudo '
|
||||||
|
alias rm='rm -i'
|
||||||
|
alias cp='cp -i'
|
||||||
|
alias mv='mv -i'
|
||||||
|
alias mkdir='mkdir -pv'
|
||||||
|
alias wget='wget -c'
|
||||||
|
alias path='echo -e ${PATH//:/\\n}'
|
||||||
|
alias ports='netstat -tulanp'
|
||||||
|
|
||||||
|
alias mk=make
|
||||||
|
alias gurl='curl --compressed'
|
||||||
|
|
||||||
|
alias shutdown='sudo shutdown'
|
||||||
|
alias reboot='sudo reboot'
|
||||||
|
|
||||||
|
# An rsync that respects gitignore
|
||||||
|
rcp() {
|
||||||
|
# -a = -rlptgoD
|
||||||
|
# -r = recursive
|
||||||
|
# -l = copy symlinks as symlinks
|
||||||
|
# -p = preserve permissions
|
||||||
|
# -t = preserve mtimes
|
||||||
|
# -g = preserve owning group
|
||||||
|
# -o = preserve owner
|
||||||
|
# -z = use compression
|
||||||
|
# -P = show progress on transferred file
|
||||||
|
# -J = don't touch mtimes on symlinks (always errors)
|
||||||
|
rsync -azPJ \
|
||||||
|
--include=.git/ \
|
||||||
|
--filter=':- .gitignore' \
|
||||||
|
--filter=":- $XDG_CONFIG_HOME/git/ignore" \
|
||||||
|
"$@"
|
||||||
|
}; compdef rcp=rsync
|
||||||
|
alias rcpd='rcp --delete --delete-after'
|
||||||
|
alias rcpu='rcp --chmod=go='
|
||||||
|
alias rcpdu='rcpd --chmod=go='
|
||||||
|
|
||||||
|
alias y='xclip -selection clipboard -in'
|
||||||
|
alias p='xclip -selection clipboard -out'
|
||||||
|
|
||||||
|
alias jc='journalctl -xe'
|
||||||
|
alias sc=systemctl
|
||||||
|
alias ssc='sudo systemctl'
|
||||||
|
|
||||||
|
if command -v exa >/dev/null; then
|
||||||
|
alias exa="exa --group-directories-first --git";
|
||||||
|
alias l="exa -1";
|
||||||
|
alias ll="exa -lg";
|
||||||
|
alias la="LC_COLLATE=C exa -la";
|
||||||
|
fi
|
||||||
|
|
||||||
|
autoload -U zmv
|
||||||
|
|
||||||
|
take() {
|
||||||
|
mkdir "$1" && cd "$1";
|
||||||
|
}; compdef take=mkdir
|
||||||
|
|
||||||
|
zman() {
|
||||||
|
PAGER="less -g -I -s '+/^ "$1"'" man zshall;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Create a reminder with human-readable durations, e.g. 15m, 1h, 40s, etc
|
||||||
|
r() {
|
||||||
|
local time=$1; shift
|
||||||
|
sched "$time" "notify-send --urgency=critical 'Reminder' '$@'; ding";
|
||||||
|
}; compdef r=sched
|
174
config/zsh/completion.zsh
Normal file
174
config/zsh/completion.zsh
Normal file
|
@ -0,0 +1,174 @@
|
||||||
|
fpath+=( $ZDOTDIR/completions )
|
||||||
|
|
||||||
|
## Options
|
||||||
|
setopt COMPLETE_IN_WORD # Complete from both ends of a word.
|
||||||
|
setopt PATH_DIRS # Perform path search even on command names with slashes.
|
||||||
|
setopt AUTO_MENU # Show completion menu on a successive tab press.
|
||||||
|
setopt AUTO_LIST # Automatically list choices on ambiguous completion.
|
||||||
|
setopt AUTO_PARAM_SLASH # If completed parameter is a directory, add a trailing slash.
|
||||||
|
setopt AUTO_PARAM_KEYS
|
||||||
|
setopt FLOW_CONTROL # Disable start/stop characters in shell editor.
|
||||||
|
unsetopt MENU_COMPLETE # Do not autoselect the first completion entry.
|
||||||
|
unsetopt COMPLETE_ALIASES # Completion for aliases
|
||||||
|
unsetopt ALWAYS_TO_END # Move cursor to the end of a completed word.
|
||||||
|
unsetopt CASE_GLOB
|
||||||
|
|
||||||
|
# Use caching to make completion for commands such as dpkg and apt usable.
|
||||||
|
zstyle ':completion::complete:*' use-cache on
|
||||||
|
zstyle ':completion::complete:*' cache-path "$ZSH_CACHE/zcompcache"
|
||||||
|
|
||||||
|
# Case-insensitive (all), partial-word, and then substring completion.
|
||||||
|
zstyle ':completion:*' matcher-list '' \
|
||||||
|
'm:{a-z\-}={A-Z\_}' \
|
||||||
|
'r:[^[:alpha:]]||[[:alpha:]]=** r:|=* m:{a-z\-}={A-Z\_}' \
|
||||||
|
'r:[[:ascii:]]||[[:ascii:]]=** r:|=* m:{a-z\-}={A-Z\_}'
|
||||||
|
|
||||||
|
# Group matches and describe.
|
||||||
|
zstyle ':completion:*:*:*:*:*' menu select
|
||||||
|
zstyle ':completion:*:matches' group 'yes'
|
||||||
|
zstyle ':completion:*:options' description 'yes'
|
||||||
|
zstyle ':completion:*:options' auto-description '%d'
|
||||||
|
zstyle ':completion:*:corrections' format ' %F{green}-- %d (errors: %e) --%f'
|
||||||
|
zstyle ':completion:*:descriptions' format ' %F{yellow}-- %d --%f'
|
||||||
|
zstyle ':completion:*:messages' format ' %F{purple} -- %d --%f'
|
||||||
|
zstyle ':completion:*:warnings' format ' %F{red}-- no matches found --%f'
|
||||||
|
zstyle ':completion:*:default' list-prompt '%S%M matches%s'
|
||||||
|
zstyle ':completion:*' format ' %F{yellow}-- %d --%f'
|
||||||
|
zstyle ':completion:*' group-name ''
|
||||||
|
zstyle ':completion:*' verbose yes
|
||||||
|
|
||||||
|
# Fuzzy match mistyped completions.
|
||||||
|
zstyle ':completion:*' completer _complete _list _match _approximate
|
||||||
|
zstyle ':completion:*:match:*' original only
|
||||||
|
zstyle ':completion:*:approximate:*' max-errors 1 numeric
|
||||||
|
|
||||||
|
# Increase the number of errors based on the length of the typed word.
|
||||||
|
zstyle -e ':completion:*:approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3))numeric)'
|
||||||
|
|
||||||
|
# Don't complete unavailable commands.
|
||||||
|
zstyle ':completion:*:functions' ignored-patterns '(_*|pre(cmd|exec))'
|
||||||
|
|
||||||
|
# Array completion element sorting.
|
||||||
|
zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters
|
||||||
|
|
||||||
|
# Directories
|
||||||
|
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
|
||||||
|
zstyle ':completion:*:*:cd:*' ignore-parents parent pwd
|
||||||
|
zstyle ':completion:*:*:cd:*' tag-order local-directories directory-stack path-directories
|
||||||
|
zstyle ':completion:*:*:cd:*:directory-stack' menu yes select
|
||||||
|
zstyle ':completion:*:-tilde-:*' group-order 'named-directories' 'path-directories' 'users' 'expand'
|
||||||
|
zstyle ':completion:*' squeeze-slashes true
|
||||||
|
zstyle ':completion:*' special-dirs true
|
||||||
|
|
||||||
|
# History
|
||||||
|
zstyle ':completion:*:history-words' stop yes
|
||||||
|
zstyle ':completion:*:history-words' remove-all-dups yes
|
||||||
|
zstyle ':completion:*:history-words' list false
|
||||||
|
zstyle ':completion:*:history-words' menu yes
|
||||||
|
|
||||||
|
# Environmental Variables
|
||||||
|
zstyle ':completion::*:(-command-|export):*' fake-parameters ${${${_comps[(I)-value-*]#*,}%%,*}:#-*-}
|
||||||
|
|
||||||
|
# Populate hostname completion.
|
||||||
|
zstyle -e ':completion:*:hosts' hosts 'reply=(
|
||||||
|
${=${=${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) 2>/dev/null)"}%%[#| ]*}//\]:[0-9]*/ }//,/ }//\[/ }
|
||||||
|
${=${${${${(@M)${(f)"$(cat ~/.ssh/config 2>/dev/null)"}:#Host *}#Host }:#*\**}:#*\?*}}
|
||||||
|
)'
|
||||||
|
|
||||||
|
# Don't complete uninteresting users...
|
||||||
|
zstyle ':completion:*:*:*:users' ignored-patterns \
|
||||||
|
adm amanda apache avahi beaglidx bin cacti canna clamav daemon \
|
||||||
|
dbus distcache dovecot fax ftp games gdm gkrellmd gopher \
|
||||||
|
hacluster haldaemon halt hsqldb ident junkbust ldap lp mail \
|
||||||
|
mailman mailnull mldonkey mysql nagios \
|
||||||
|
named netdump news nfsnobody nobody nscd ntp nut nx openvpn \
|
||||||
|
operator pcap postfix postgres privoxy pulse pvm quagga radvd \
|
||||||
|
rpc rpcuser rpm shutdown squid sshd sync uucp vcsa xfs '_*'
|
||||||
|
|
||||||
|
# ... unless we really want to.
|
||||||
|
zstyle '*' single-ignored show
|
||||||
|
|
||||||
|
# Ignore multiple entries.
|
||||||
|
zstyle ':completion:*:(rm|kill|diff):*' ignore-line other
|
||||||
|
zstyle ':completion:*:rm:*' file-patterns '*:all-files'
|
||||||
|
|
||||||
|
# Kill
|
||||||
|
zstyle ':completion:*:*:*:*:processes' command 'ps -u $LOGNAME -o pid,user,command -w'
|
||||||
|
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;36=0=01'
|
||||||
|
zstyle ':completion:*:*:kill:*' menu yes select
|
||||||
|
zstyle ':completion:*:*:kill:*' force-list always
|
||||||
|
zstyle ':completion:*:*:kill:*' insert-ids single
|
||||||
|
|
||||||
|
# Man
|
||||||
|
zstyle ':completion:*:manuals' separate-sections true
|
||||||
|
zstyle ':completion:*:manuals.(^1*)' insert-sections true
|
||||||
|
|
||||||
|
# Media Players
|
||||||
|
zstyle ':completion:*:*:mpg123:*' file-patterns '*.(mp3|MP3):mp3\ files *(-/):directories'
|
||||||
|
zstyle ':completion:*:*:mpg321:*' file-patterns '*.(mp3|MP3):mp3\ files *(-/):directories'
|
||||||
|
zstyle ':completion:*:*:ogg123:*' file-patterns '*.(ogg|OGG|flac):ogg\ files *(-/):directories'
|
||||||
|
zstyle ':completion:*:*:mocp:*' file-patterns '*.(wav|WAV|mp3|MP3|ogg|OGG|flac):ogg\ files *(-/):directories'
|
||||||
|
|
||||||
|
# SSH/SCP/RSYNC
|
||||||
|
zstyle ':completion:*:(scp|rsync):*' tag-order 'hosts:-host:host hosts:-domain:domain hosts:-ipaddr:ip\ address *'
|
||||||
|
zstyle ':completion:*:(scp|rsync):*' group-order users files all-files hosts-domain hosts-host hosts-ipaddr
|
||||||
|
zstyle ':completion:*:ssh:*' tag-order 'hosts:-host:host hosts:-domain:domain hosts:-ipaddr:ip\ address *'
|
||||||
|
zstyle ':completion:*:ssh:*' group-order users hosts-domain hosts-host users hosts-ipaddr
|
||||||
|
zstyle ':completion:*:(ssh|scp|rsync):*:hosts-host' ignored-patterns '*(.|:)*' loopback ip6-loopback localhost ip6-localhost broadcasthost
|
||||||
|
zstyle ':completion:*:(ssh|scp|rsync):*:hosts-domain' ignored-patterns '<->.<->.<->.<->' '^[-[:alnum:]]##(.[-[:alnum:]]##)##' '*@*'
|
||||||
|
zstyle ':completion:*:(ssh|scp|rsync):*:hosts-ipaddr' ignored-patterns '^(<->.<->.<->.<->|(|::)([[:xdigit:].]##:(#c,2))##(|%*))' '127.0.0.<->' '255.255.255.255' '::1' 'fe80::*'
|
||||||
|
|
||||||
|
# fzf
|
||||||
|
if command -v fzf >/dev/null; then
|
||||||
|
# fuzzy completion with 'z' when called without args
|
||||||
|
unalias z 2> /dev/null
|
||||||
|
z() {
|
||||||
|
[ $# -gt 0 ] && _z "$*" && return
|
||||||
|
cd "$(_z -l 2>&1 | fzf --height 40% --nth 2.. --reverse --inline-info +s --tac --query "${*##-* }" | sed 's/^[0-9,.]* *//')"
|
||||||
|
}
|
||||||
|
|
||||||
|
__git_log () {
|
||||||
|
# format str implies:
|
||||||
|
# --abbrev-commit
|
||||||
|
# --decorate
|
||||||
|
git log \
|
||||||
|
--color=always \
|
||||||
|
--graph \
|
||||||
|
--all \
|
||||||
|
--date=short \
|
||||||
|
--format="%C(bold blue)%h%C(reset) %C(green)%ad%C(reset) | %C(white)%s %C(red)[%an] %C(bold yellow)%d"
|
||||||
|
}
|
||||||
|
|
||||||
|
_fzf_complete_git() {
|
||||||
|
ARGS="$@"
|
||||||
|
|
||||||
|
# these are commands I commonly call on commit hashes.
|
||||||
|
# cp->cherry-pick, co->checkout
|
||||||
|
|
||||||
|
if [[ $ARGS == 'git cp'* || \
|
||||||
|
$ARGS == 'git cherry-pick'* || \
|
||||||
|
$ARGS == 'git co'* || \
|
||||||
|
$ARGS == 'git checkout'* || \
|
||||||
|
$ARGS == 'git reset'* || \
|
||||||
|
$ARGS == 'git show'* || \
|
||||||
|
$ARGS == 'git log'* ]]; then
|
||||||
|
_fzf_complete "--reverse --multi" "$@" < <(__git_log)
|
||||||
|
else
|
||||||
|
eval "zle ${fzf_default_completion:-expand-or-complete}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_fzf_complete_git_post() {
|
||||||
|
sed -e 's/^[^a-z0-9]*//' | awk '{print $1}'
|
||||||
|
}
|
||||||
|
|
||||||
|
# pass completion suggested by @d4ndo (#362) (slightly modified)
|
||||||
|
_fzf_complete_pass() {
|
||||||
|
_fzf_complete '+m' "$@" < <(
|
||||||
|
local pwdir=${PASSWORD_STORE_DIR-~/.password-store/}
|
||||||
|
find "$pwdir" -name "*.gpg" -print |
|
||||||
|
sed -e "s#${pwdir}/\{0,1\}##" |
|
||||||
|
sed -e 's/\(.*\)\.gpg/\1/'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
fi
|
36
config/zsh/completions/_hey
Executable file
36
config/zsh/completions/_hey
Executable file
|
@ -0,0 +1,36 @@
|
||||||
|
#compdef hey
|
||||||
|
|
||||||
|
_hey_dispatch () {
|
||||||
|
local cmd="$@"
|
||||||
|
local offset=$#
|
||||||
|
CURRENT=$((CURRENT-$offset))
|
||||||
|
words=($cmd "${words[$((2 + offset)),-1]}")
|
||||||
|
_$cmd
|
||||||
|
}
|
||||||
|
|
||||||
|
_hey_command_list () {
|
||||||
|
hey | sed '1,/Available commands:/d' | awk '{ print $1 }'
|
||||||
|
}
|
||||||
|
|
||||||
|
_hey () {
|
||||||
|
local -a commands
|
||||||
|
IFS=$'\n' commands=($(_hey_command_list))
|
||||||
|
|
||||||
|
if (( CURRENT == 2 )); then
|
||||||
|
_describe -t commands "hey commands" commands
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
integer ret=1
|
||||||
|
case ${words[2]} in
|
||||||
|
ch|channel) _hey_dispatch nix-channel ;;
|
||||||
|
b|build) _hey_dispatch nix-build ;;
|
||||||
|
ch|check) _hey_dispatch nix flake check ;;
|
||||||
|
sh|show) _hey_dispatch nix flake show ;;
|
||||||
|
s|search) _hey_dispatch nix search nixpkgs ;;
|
||||||
|
-*) _hey_dispatch nix-env ;;
|
||||||
|
*) _message "Command not found: ${words[2]}" ;;
|
||||||
|
esac
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
|
_hey
|
64
config/zsh/config.zsh
Normal file
64
config/zsh/config.zsh
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
# Stop TRAMP (in Emacs) from hanging or term/shell from echoing back commands
|
||||||
|
if [[ $TERM == dumb || -n $INSIDE_EMACS ]]; then
|
||||||
|
unsetopt zle prompt_cr prompt_subst
|
||||||
|
whence -w precmd >/dev/null && unfunction precmd
|
||||||
|
whence -w preexec >/dev/null && unfunction preexec
|
||||||
|
PS1='$ '
|
||||||
|
fi
|
||||||
|
|
||||||
|
## General
|
||||||
|
export _FASD_DATA="$XDG_CACHE_HOME/fasd"
|
||||||
|
export _FASD_VIMINFO="$XDG_CACHE_HOME/viminfo"
|
||||||
|
|
||||||
|
# Treat these characters as part of a word.
|
||||||
|
WORDCHARS='_-*?[]~&.;!#$%^(){}<>'
|
||||||
|
|
||||||
|
unsetopt BRACE_CCL # Allow brace character class list expansion.
|
||||||
|
setopt COMBINING_CHARS # Combine zero-length punc chars (accents) with base char
|
||||||
|
setopt RC_QUOTES # Allow 'Henry''s Garage' instead of 'Henry'\''s Garage'
|
||||||
|
setopt HASH_LIST_ALL
|
||||||
|
unsetopt CORRECT_ALL
|
||||||
|
unsetopt NOMATCH
|
||||||
|
unsetopt MAIL_WARNING # Don't print a warning message if a mail file has been accessed.
|
||||||
|
unsetopt BEEP # Hush now, quiet now.
|
||||||
|
setopt IGNOREEOF
|
||||||
|
|
||||||
|
## Jobs
|
||||||
|
setopt LONG_LIST_JOBS # List jobs in the long format by default.
|
||||||
|
setopt AUTO_RESUME # Attempt to resume existing job before creating a new process.
|
||||||
|
setopt NOTIFY # Report status of background jobs immediately.
|
||||||
|
unsetopt BG_NICE # Don't run all background jobs at a lower priority.
|
||||||
|
unsetopt HUP # Don't kill jobs on shell exit.
|
||||||
|
unsetopt CHECK_JOBS # Don't report on jobs when shell exit.
|
||||||
|
|
||||||
|
## History
|
||||||
|
HISTFILE="$XDG_CACHE_HOME/zhistory"
|
||||||
|
HISTSIZE=1000 # Max events to store in internal history.
|
||||||
|
SAVEHIST=1000 # Max events to store in history file.
|
||||||
|
|
||||||
|
setopt BANG_HIST # Don't treat '!' specially during expansion.
|
||||||
|
setopt EXTENDED_HISTORY # Write the history file in the ':start:elapsed;command' format.
|
||||||
|
setopt APPEND_HISTORY # Appends history to history file on exit
|
||||||
|
setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits.
|
||||||
|
setopt SHARE_HISTORY # Share history between all sessions.
|
||||||
|
setopt HIST_EXPIRE_DUPS_FIRST # Expire a duplicate event first when trimming history.
|
||||||
|
setopt HIST_IGNORE_DUPS # Do not record an event that was just recorded again.
|
||||||
|
setopt HIST_IGNORE_ALL_DUPS # Delete an old recorded event if a new event is a duplicate.
|
||||||
|
setopt HIST_FIND_NO_DUPS # Do not display a previously found event.
|
||||||
|
setopt HIST_IGNORE_SPACE # Do not record an event starting with a space.
|
||||||
|
setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file.
|
||||||
|
setopt HIST_VERIFY # Do not execute immediately upon history expansion.
|
||||||
|
setopt HIST_BEEP # Beep when accessing non-existent history.
|
||||||
|
|
||||||
|
## Directories
|
||||||
|
DIRSTACKSIZE=9
|
||||||
|
setopt AUTO_CD # Auto changes to a directory without typing cd.
|
||||||
|
setopt AUTO_PUSHD # Push the old directory onto the stack on cd.
|
||||||
|
setopt PUSHD_IGNORE_DUPS # Do not store duplicates in the stack.
|
||||||
|
setopt PUSHD_SILENT # Do not print the directory stack after pushd or popd.
|
||||||
|
setopt PUSHD_TO_HOME # Push to home directory when no argument is given.
|
||||||
|
setopt CDABLE_VARS # Change directory to a path stored in a variable.
|
||||||
|
setopt MULTIOS # Write to multiple descriptors.
|
||||||
|
setopt EXTENDED_GLOB # Use extended globbing syntax.
|
||||||
|
unsetopt GLOB_DOTS
|
||||||
|
unsetopt AUTO_NAME_DIRS # Don't add variable-stored paths to ~ list
|
127
config/zsh/keybinds.zsh
Normal file
127
config/zsh/keybinds.zsh
Normal file
|
@ -0,0 +1,127 @@
|
||||||
|
# The surround module wasn't working if KEYTIMEOUT was <= 10. Specifically,
|
||||||
|
# (delete|change)-surround immediately abort into insert mode if KEYTIMEOUT <=
|
||||||
|
# 8. If <= 10, then add-surround does the same. At 11, all these issues vanish.
|
||||||
|
# Very strange!
|
||||||
|
export KEYTIMEOUT=15
|
||||||
|
|
||||||
|
autoload -U is-at-least
|
||||||
|
|
||||||
|
## vi-mode ###############
|
||||||
|
bindkey -v
|
||||||
|
bindkey -M viins 'jk' vi-cmd-mode
|
||||||
|
bindkey -M viins ' ' magic-space
|
||||||
|
# bindkey -M viins '^I' expand-or-complete-prefix
|
||||||
|
|
||||||
|
# surround
|
||||||
|
autoload -Uz surround
|
||||||
|
zle -N delete-surround surround
|
||||||
|
zle -N add-surround surround
|
||||||
|
zle -N change-surround surround
|
||||||
|
bindkey -a cs change-surround
|
||||||
|
bindkey -a ds delete-surround
|
||||||
|
bindkey -a ys add-surround
|
||||||
|
|
||||||
|
# <5.0.8 doesn't have visual map
|
||||||
|
if is-at-least 5.0.8; then
|
||||||
|
bindkey -M visual S add-surround
|
||||||
|
|
||||||
|
# add vimmish text-object support to zsh
|
||||||
|
autoload -U select-quoted; zle -N select-quoted
|
||||||
|
for m in visual viopp; do
|
||||||
|
for c in {a,i}{\',\",\`}; do
|
||||||
|
bindkey -M $m $c select-quoted
|
||||||
|
done
|
||||||
|
done
|
||||||
|
autoload -U select-bracketed; zle -N select-bracketed
|
||||||
|
for m in visual viopp; do
|
||||||
|
for c in {a,i}${(s..)^:-'()[]{}<>bB'}; do
|
||||||
|
bindkey -M $m $c select-bracketed
|
||||||
|
done
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Open current prompt in external editor
|
||||||
|
autoload -Uz edit-command-line; zle -N edit-command-line
|
||||||
|
bindkey '^ ' edit-command-line
|
||||||
|
|
||||||
|
bindkey -M viins '^n' history-substring-search-down
|
||||||
|
bindkey -M viins '^p' history-substring-search-up
|
||||||
|
bindkey -M viins '^s' history-incremental-pattern-search-backward
|
||||||
|
bindkey -M viins '^u' backward-kill-line
|
||||||
|
bindkey -M viins '^w' backward-kill-word
|
||||||
|
bindkey -M viins '^b' backward-word
|
||||||
|
bindkey -M viins '^f' forward-word
|
||||||
|
bindkey -M viins '^g' push-line-or-edit
|
||||||
|
bindkey -M viins '^a' beginning-of-line
|
||||||
|
bindkey -M viins '^e' end-of-line
|
||||||
|
bindkey -M viins '^d' push-line-or-edit
|
||||||
|
|
||||||
|
bindkey -M vicmd '^k' kill-line
|
||||||
|
bindkey -M vicmd 'H' run-help
|
||||||
|
|
||||||
|
# Shift + Tab
|
||||||
|
bindkey -M viins '^[[Z' reverse-menu-complete
|
||||||
|
|
||||||
|
# bind UP and DOWN arrow keys
|
||||||
|
bindkey '^[[A' history-substring-search-up
|
||||||
|
bindkey '^[[B' history-substring-search-down
|
||||||
|
|
||||||
|
# C-z to toggle current process (background/foreground)
|
||||||
|
fancy-ctrl-z () {
|
||||||
|
if [[ $#BUFFER -eq 0 ]]; then
|
||||||
|
BUFFER="fg"
|
||||||
|
zle accept-line
|
||||||
|
else
|
||||||
|
zle push-input
|
||||||
|
zle clear-screen
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
zle -N fancy-ctrl-z
|
||||||
|
bindkey '^Z' fancy-ctrl-z
|
||||||
|
|
||||||
|
# Omni-Completion
|
||||||
|
bindkey -M viins '^x^f' fasd-complete-f # C-x C-f to do fasd-complete-f (only files)
|
||||||
|
bindkey -M viins '^x^d' fasd-complete-d # C-x C-d to do fasd-complete-d (only directories)
|
||||||
|
# Completing words in buffer in tmux
|
||||||
|
if [ -n "$TMUX" ]; then
|
||||||
|
_tmux_pane_words() {
|
||||||
|
local expl
|
||||||
|
local -a w
|
||||||
|
if [[ -z "$TMUX_PANE" ]]; then
|
||||||
|
_message "not running inside tmux!"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
w=( ${(u)=$(tmux capture-pane \; show-buffer \; delete-buffer)} )
|
||||||
|
_wanted values expl 'words from current tmux pane' compadd -a w
|
||||||
|
}
|
||||||
|
|
||||||
|
zle -C tmux-pane-words-prefix complete-word _generic
|
||||||
|
zle -C tmux-pane-words-anywhere complete-word _generic
|
||||||
|
|
||||||
|
bindkey -M viins '^x^n' tmux-pane-words-prefix
|
||||||
|
bindkey -M viins '^x^o' tmux-pane-words-anywhere
|
||||||
|
|
||||||
|
zstyle ':completion:tmux-pane-words-(prefix|anywhere):*' completer _tmux_pane_words
|
||||||
|
zstyle ':completion:tmux-pane-words-(prefix|anywhere):*' ignore-line current
|
||||||
|
zstyle ':completion:tmux-pane-words-anywhere:*' matcher-list 'b:=* m:{A-Za-z}={a-zA-Z}'
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Vim's C-x C-l in zsh
|
||||||
|
history-beginning-search-backward-then-append() {
|
||||||
|
zle history-beginning-search-backward
|
||||||
|
zle vi-add-eol
|
||||||
|
}
|
||||||
|
zle -N history-beginning-search-backward-then-append
|
||||||
|
bindkey -M viins '^x^l' history-beginning-search-backward-then-append
|
||||||
|
|
||||||
|
# Fix the DEL key
|
||||||
|
bindkey -M vicmd "^[[3~" delete-char
|
||||||
|
bindkey "^[[3~" delete-char
|
||||||
|
|
||||||
|
# Fix vimmish ESC
|
||||||
|
bindkey -sM vicmd '^[' '^G'
|
||||||
|
bindkey -rM viins '^X'
|
||||||
|
bindkey -M viins '^X,' _history-complete-newer \
|
||||||
|
'^X/' _history-complete-older \
|
||||||
|
'^X`' _bash_complete-word
|
||||||
|
|
67
default.nix
Normal file
67
default.nix
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
{ inputs, config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
with lib.my;
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
# I use home-manager to deploy files to $HOME; little else
|
||||||
|
[ inputs.home-manager.nixosModules.home-manager ]
|
||||||
|
# All my personal modules
|
||||||
|
++ (mapModulesRec' (toString ./modules) import);
|
||||||
|
|
||||||
|
# Common config for all nixos machines; and to ensure the flake operates
|
||||||
|
# soundly
|
||||||
|
environment.variables.DOTFILES = config.dotfiles.dir;
|
||||||
|
environment.variables.DOTFILES_BIN = config.dotfiles.binDir;
|
||||||
|
|
||||||
|
# Configure nix and nixpkgs
|
||||||
|
environment.variables.NIXPKGS_ALLOW_UNFREE = "1";
|
||||||
|
nix =
|
||||||
|
let filteredInputs = filterAttrs (n: _: n != "self") inputs;
|
||||||
|
nixPathInputs = mapAttrsToList (n: v: "${n}=${v}") filteredInputs;
|
||||||
|
registryInputs = mapAttrs (_: v: { flake = v; }) filteredInputs;
|
||||||
|
in {
|
||||||
|
package = pkgs.nixFlakes;
|
||||||
|
extraOptions = "experimental-features = nix-command flakes";
|
||||||
|
nixPath = nixPathInputs ++ [
|
||||||
|
"nixpkgs-overlays=${config.dotfiles.dir}/overlays"
|
||||||
|
"dotfiles=${config.dotfiles.dir}"
|
||||||
|
];
|
||||||
|
binaryCaches = [
|
||||||
|
"https://nix-community.cachix.org"
|
||||||
|
];
|
||||||
|
binaryCachePublicKeys = [
|
||||||
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||||
|
];
|
||||||
|
registry = registryInputs // { dotfiles.flake = inputs.self; };
|
||||||
|
autoOptimiseStore = true;
|
||||||
|
};
|
||||||
|
system.configurationRevision = with inputs; mkIf (self ? rev) self.rev;
|
||||||
|
system.stateVersion = "21.05";
|
||||||
|
|
||||||
|
## Some reasonable, global defaults
|
||||||
|
# This is here to appease 'nix flake check' for generic hosts with no
|
||||||
|
# hardware-configuration.nix or fileSystem config.
|
||||||
|
fileSystems."/".device = mkDefault "/dev/disk/by-label/nixos";
|
||||||
|
|
||||||
|
# Use the latest kernel
|
||||||
|
boot = {
|
||||||
|
kernelPackages = mkDefault pkgs.linuxPackages_5_12;
|
||||||
|
loader = {
|
||||||
|
efi.canTouchEfiVariables = mkDefault true;
|
||||||
|
systemd-boot.configurationLimit = 10;
|
||||||
|
systemd-boot.enable = mkDefault true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Just the bear necessities...
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
bind
|
||||||
|
cached-nix-shell
|
||||||
|
git
|
||||||
|
vim
|
||||||
|
wget
|
||||||
|
gnumake
|
||||||
|
unzip
|
||||||
|
];
|
||||||
|
}
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
"hedns": {
|
|
||||||
"TYPE": "HEDNS",
|
|
||||||
"username": "iamanish",
|
|
||||||
"password": "$HE_PASSWORD"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,59 +0,0 @@
|
||||||
// Providers:
|
|
||||||
|
|
||||||
var REG_NONE = NewRegistrar('none'); // No registrar.
|
|
||||||
var DNS_BIND = NewDnsProvider('bind'); // ISC BIND.
|
|
||||||
var DNS_HEDNS = NewDnsProvider('hedns');
|
|
||||||
|
|
||||||
D("lakhwara.com", REG_NONE,
|
|
||||||
DnsProvider(DNS_HEDNS),
|
|
||||||
DefaultTTL(300),
|
|
||||||
//SOA('@', 'ns1.he.net.', 'hostmaster.he.net.', 2022041702, 86400, 7200, 3600000, 86400, TTL(172800)),
|
|
||||||
A('anish', '69.61.2.203'),
|
|
||||||
A('@', '69.61.2.203'),
|
|
||||||
//A('coaching', '103.16.130.98'),
|
|
||||||
TXT('anish', 'datkey=dat://1a240a14fab2bae9c85ebad29bddc04505aaba24e5fb809c2ccb4cdf71e3a7d5'),
|
|
||||||
CNAME('fm1._domainkey', 'fm1.lakhwara.com.dkim.fmhosted.com.'),
|
|
||||||
CNAME('fm2._domainkey', 'fm2.lakhwara.com.dkim.fmhosted.com.'),
|
|
||||||
CNAME('fm3._domainkey', 'fm3.lakhwara.com.dkim.fmhosted.com.'),
|
|
||||||
MX('@', 10, 'in1-smtp.messagingengine.com.'),
|
|
||||||
MX('@', 20, 'in2-smtp.messagingengine.com.'),
|
|
||||||
//NAMESERVER('ns1.he.net.'),
|
|
||||||
//NAMESERVER('ns2.he.net.'),
|
|
||||||
//NAMESERVER('ns3.he.net.'),
|
|
||||||
//NAMESERVER('ns4.he.net.'),
|
|
||||||
//NAMESERVER('ns5.he.net.'),
|
|
||||||
TXT('@', 'v=spf1 include:spf.messagingengine.com ?all')
|
|
||||||
)
|
|
||||||
|
|
||||||
D('sealight.xyz', REG_NONE, DnsProvider(DNS_HEDNS),
|
|
||||||
DefaultTTL(86400),
|
|
||||||
//SOA('@', 'ns1.he.net.', 'hostmaster.he.net.', 2022121008, 86400, 7200, 3600000, 172800, TTL(172800)),
|
|
||||||
//NAMESERVER('ns1.he.net.'),
|
|
||||||
//NAMESERVER('ns2.he.net.'),
|
|
||||||
//NAMESERVER('ns3.he.net.'),
|
|
||||||
//NAMESERVER('ns4.he.net.'),
|
|
||||||
//NAMESERVER('ns5.he.net.'),
|
|
||||||
// capsul: helix
|
|
||||||
A('bridge', '69.61.2.203', TTL(300)),
|
|
||||||
A('rss', '69.61.2.203', TTL(300)),
|
|
||||||
A('git', '69.61.2.203', TTL(300)),
|
|
||||||
A('bin', '69.61.2.203', TTL(300)),
|
|
||||||
A('ci', '69.61.2.203', TTL(300)),
|
|
||||||
A('write', '69.61.2.203', TTL(300)),
|
|
||||||
// vultr -> nulled: lituus
|
|
||||||
A('@', '45.77.48.108', TTL(300)),
|
|
||||||
A('jitsi', '45.77.48.108', TTL(300)),
|
|
||||||
A('chat', '45.77.48.108', TTL(300)),
|
|
||||||
A('element', '45.77.48.108', TTL(300)),
|
|
||||||
A('turn', '45.77.48.108', TTL(300)),
|
|
||||||
//nullhex free email real estate
|
|
||||||
CNAME('key1._domainkey', 'key1.nullhex.com.'),
|
|
||||||
CNAME('autoconfig', 'autoconfig.nullhex.com.'),
|
|
||||||
MX('@', 10, 'smtp-in-1.nullhex.com.'),
|
|
||||||
MX('@', 20, 'smtp-in-2.nullhex.com.'),
|
|
||||||
TXT('@', 'v=spf1 a mx ~all'),
|
|
||||||
SRV('_autodiscover._tcp', 0, 1, 443, 'autodiscover.nullhex.com.'),
|
|
||||||
TXT('_dmarc', 'v=DMARC1; p=quarantine;'),
|
|
||||||
SRV('_imaps._tcp', 0, 1, 993, 'imap.nullhex.com.'),
|
|
||||||
SRV('_submissions._tcp', 0, 1, 465, 'smtp.nullhex.com.')
|
|
||||||
);
|
|
|
@ -1,26 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
|
||||||
echo "error: domain missing (sealight.xyz)"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
domain="$1"
|
|
||||||
errors=""
|
|
||||||
|
|
||||||
dig +short MX "$domain" | grep -q 'smtp-in-1.nullhex.com' || errors="smtp-in-1.nullhex.com record not found"
|
|
||||||
dig +short MX "$domain" | grep -q 'smtp-in-2.nullhex.com' || errors="$errors\nsmtp-in-2.nullhex.com record not found"
|
|
||||||
dig +short TXT "$domain" | grep -q '^"v=spf1 a mx ~all"$' || errors="$errors\nspf record not found"
|
|
||||||
dig +short CNAME "key1._domainkey.$domain" | grep -q 'key1.nullhex.com' || errors="$errors\nkey1._domainkey.$domain record not found"
|
|
||||||
dig +short TXT "_dmarc.$domain" | grep -q '^"v=DMARC1; p=quarantine;"$' || errors="$errors\ndmarc TXT record is missing"
|
|
||||||
dig +short SRV "_autodiscover._tcp.$domain" | grep -q '443 autodiscover.nullhex.com.' || errors="$errors\nautodiscover SRV record is missing"
|
|
||||||
dig +short SRV "_imaps._tcp.$domain" | grep -q '993 imap.nullhex.com.' || errors="$errors\nimap SRV record is missing"
|
|
||||||
dig +short SRV "_submissions._tcp.$domain" | grep -q '465 smtp.nullhex.com.' || errors="$errors\nsmtp SRV record is missing"
|
|
||||||
dig +short CNAME "autoconfig.$domain" | grep -q 'autoconfig.nullhex.com.' || errors="$errors\nautoconfig CNAME record is missing"
|
|
||||||
|
|
||||||
if [ ! -z "$errors" ]; then
|
|
||||||
echo "$errors"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo "success! u are redy"
|
|
||||||
fi
|
|
|
@ -1,22 +0,0 @@
|
||||||
; lakhwara.com Dumped Sun May 28 22:30:02 2023
|
|
||||||
;
|
|
||||||
lakhwara.com. 172800 IN SOA ns1.he.net. hostmaster.he.net. (
|
|
||||||
2022041702 ;serial
|
|
||||||
86400 ;refresh
|
|
||||||
7200 ;retry
|
|
||||||
3600000 ;expire
|
|
||||||
86400 ) ;minimum
|
|
||||||
anish.lakhwara.com. 86400 IN A 103.16.130.98
|
|
||||||
anish.lakhwara.com. 86400 IN TXT datkey=dat://1a240a14fab2bae9c85ebad29bddc04505aaba24e5fb809c2ccb4cdf71e3a7d5
|
|
||||||
fm1._domainkey.lakhwara.com. 86400 IN CNAME fm1.lakhwara.com.dkim.fmhosted.com.
|
|
||||||
fm2._domainkey.lakhwara.com. 86400 IN CNAME fm2.lakhwara.com.dkim.fmhosted.com.
|
|
||||||
fm3._domainkey.lakhwara.com. 86400 IN CNAME fm3.lakhwara.com.dkim.fmhosted.com.
|
|
||||||
lakhwara.com. 86400 IN A 103.16.130.98
|
|
||||||
lakhwara.com. 86400 IN MX 10 in1-smtp.messagingengine.com.
|
|
||||||
lakhwara.com. 86400 IN MX 20 in2-smtp.messagingengine.com.
|
|
||||||
lakhwara.com. 86400 IN NS ns1.he.net.
|
|
||||||
lakhwara.com. 86400 IN NS ns2.he.net.
|
|
||||||
lakhwara.com. 86400 IN NS ns3.he.net.
|
|
||||||
lakhwara.com. 86400 IN NS ns4.he.net.
|
|
||||||
lakhwara.com. 86400 IN NS ns5.he.net.
|
|
||||||
lakhwara.com. 86400 IN TXT "v=spf1 include:spf.messagingengine.com ?all"
|
|
|
@ -1,30 +0,0 @@
|
||||||
; sealight.xyz Dumped Sat Dec 10 03:57:51 2022
|
|
||||||
;
|
|
||||||
sealight.xyz. 172800 IN SOA ns1.he.net. hostmaster.he.net. (
|
|
||||||
2022121008 ;serial
|
|
||||||
86400 ;refresh
|
|
||||||
7200 ;retry
|
|
||||||
3600000 ;expire
|
|
||||||
172800 ) ;minimum
|
|
||||||
autoconfig.sealight.xyz. 86400 IN CNAME autoconfig.nullhex.com.
|
|
||||||
bridge.sealight.xyz. 300 IN A 69.61.38.225
|
|
||||||
chat.sealight.xyz. 300 IN A 45.77.48.108
|
|
||||||
element.sealight.xyz. 300 IN A 45.77.48.108
|
|
||||||
git.sealight.xyz. 300 IN A 69.61.38.225
|
|
||||||
jitsi.sealight.xyz. 300 IN A 69.61.38.225
|
|
||||||
key1._domainkey.sealight.xyz. 86400 IN CNAME key1.nullhex.com.
|
|
||||||
rss.sealight.xyz. 300 IN A 69.61.38.225
|
|
||||||
sealight.xyz. 300 IN A 45.77.48.108
|
|
||||||
sealight.xyz. 86400 IN MX 10 smtp-in-1.nullhex.com.
|
|
||||||
sealight.xyz. 86400 IN MX 20 smtp-in-2.nullhex.com.
|
|
||||||
sealight.xyz. 172800 IN NS ns1.he.net.
|
|
||||||
sealight.xyz. 172800 IN NS ns2.he.net.
|
|
||||||
sealight.xyz. 172800 IN NS ns3.he.net.
|
|
||||||
sealight.xyz. 172800 IN NS ns4.he.net.
|
|
||||||
sealight.xyz. 172800 IN NS ns5.he.net.
|
|
||||||
sealight.xyz. 86400 IN TXT "v=spf1 a mx ~all"
|
|
||||||
turn.sealight.xyz. 300 IN A 69.61.38.225
|
|
||||||
_autodiscover._tcp.sealight.xyz. 86400 IN SRV 0 1 443 autodiscover.nullhex.com.
|
|
||||||
_dmarc.sealight.xyz. 86400 IN TXT "v=DMARC1; p=quarantine;"
|
|
||||||
_imaps._tcp.sealight.xyz. 86400 IN SRV 0 1 993 imap.nullhex.com.
|
|
||||||
_submissions._tcp.sealight.xyz. 86400 IN SRV 0 1 465 smtp.nullhex.com.
|
|
590
flake.lock
590
flake.lock
|
@ -2,19 +2,16 @@
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"agenix": {
|
"agenix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"darwin": "darwin",
|
|
||||||
"home-manager": "home-manager",
|
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
]
|
||||||
"systems": "systems"
|
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1723293904,
|
"lastModified": 1626960455,
|
||||||
"narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=",
|
"narHash": "sha256-N3+qOtsADo59UcG8PxqNMhT94wqTQ73k08gpy1dLaWU=",
|
||||||
"owner": "ryantm",
|
"owner": "ryantm",
|
||||||
"repo": "agenix",
|
"repo": "agenix",
|
||||||
"rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41",
|
"rev": "fb00f178b3a49a39cc964049075439b575d36d60",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -23,600 +20,95 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"basant": {
|
"emacs-overlay": {
|
||||||
"inputs": {
|
|
||||||
"flake-utils": "flake-utils",
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
],
|
|
||||||
"poonam": [
|
|
||||||
"poonam"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1682226636,
|
"lastModified": 1627320437,
|
||||||
"narHash": "sha256-fmETHfUtQ5zOVr/4MT5wE7eNALCSQCnEUYZYmV3UEwg=",
|
"narHash": "sha256-1HGXjkm7kElz3VsGSciaQlZclUhyvfIXVl+FOooBTJo=",
|
||||||
"ref": "main",
|
|
||||||
"rev": "095d14ff2469c8f3de7cbf45d229c0f46a733aae",
|
|
||||||
"revCount": 77,
|
|
||||||
"type": "git",
|
|
||||||
"url": "ssh://gitea@git.sealight.xyz/aynish/basant"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"ref": "main",
|
|
||||||
"type": "git",
|
|
||||||
"url": "ssh://gitea@git.sealight.xyz/aynish/basant"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"darwin": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"agenix",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1700795494,
|
|
||||||
"narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=",
|
|
||||||
"owner": "lnl7",
|
|
||||||
"repo": "nix-darwin",
|
|
||||||
"rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "lnl7",
|
|
||||||
"ref": "master",
|
|
||||||
"repo": "nix-darwin",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"deploy-rs": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-compat": "flake-compat",
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
],
|
|
||||||
"utils": "utils"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1718194053,
|
|
||||||
"narHash": "sha256-FaGrf7qwZ99ehPJCAwgvNY5sLCqQ3GDiE/6uLhxxwSY=",
|
|
||||||
"owner": "serokell",
|
|
||||||
"repo": "deploy-rs",
|
|
||||||
"rev": "3867348fa92bc892eba5d9ddb2d7a97b9e127a8a",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "serokell",
|
|
||||||
"repo": "deploy-rs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"devshell": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1642188268,
|
|
||||||
"narHash": "sha256-DNz4xScpXIn7rSDohdayBpPR9H9OWCMDOgTYegX081k=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "devshell",
|
|
||||||
"rev": "696acc29668b644df1740b69e1601119bf6da83b",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "devshell",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"dirt-samples-src": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1698439458,
|
|
||||||
"narHash": "sha256-Mp8qBpsOvW9Zguv95Kv7EU6S3ICaF2aO02Wz6xGURtE=",
|
|
||||||
"owner": "tidalcycles",
|
|
||||||
"repo": "dirt-samples",
|
|
||||||
"rev": "9a6dff8f9ec3cd55b287290cf04e01afa6b8f532",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "tidalcycles",
|
|
||||||
"repo": "dirt-samples",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"disko": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1724031427,
|
|
||||||
"narHash": "sha256-o1HdAf+7IGv9M13R3c+zc/sJ0QgeEnhsvHBcodI4UpM=",
|
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "disko",
|
"repo": "emacs-overlay",
|
||||||
"rev": "4e719b38fa7c85f4f65d0308ca7084c91e7bdd6d",
|
"rev": "9da066d11fbedda841cae9d06c5391e1ebd65801",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "disko",
|
"repo": "emacs-overlay",
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-compat": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1696426674,
|
|
||||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-compat_2": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1641205782,
|
|
||||||
"narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=",
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-utils": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1638122382,
|
|
||||||
"narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "74f7e4319258e287b0f9cb95426c9853b282730b",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-utils_2": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1667395993,
|
|
||||||
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"grasp": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-utils": "flake-utils_2",
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1682644301,
|
|
||||||
"narHash": "sha256-gMBFZLf41s3+cnhxgZVRvj2JSAFYv4jn2xBKwEESthE=",
|
|
||||||
"ref": "main",
|
|
||||||
"rev": "a2d85675b930ffc26f6891b2e14491795907be4e",
|
|
||||||
"revCount": 137,
|
|
||||||
"type": "git",
|
|
||||||
"url": "ssh://gitea@git.sealight.xyz/aynish/grasp.git"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"ref": "main",
|
|
||||||
"type": "git",
|
|
||||||
"url": "ssh://gitea@git.sealight.xyz/aynish/grasp.git"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"hardware": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1723310128,
|
|
||||||
"narHash": "sha256-IiH8jG6PpR4h9TxSGMYh+2/gQiJW9MwehFvheSb5rPc=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixos-hardware",
|
|
||||||
"rev": "c54cf53e022b0b3c1d3b8207aa0f9b194c24f0cf",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixos-hardware",
|
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"agenix",
|
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1703113217,
|
"lastModified": 1627312560,
|
||||||
"narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=",
|
"narHash": "sha256-h2mpDJIu/rd4nZX4i5U1AFA/3MGXrmFRFy04FDxnvhE=",
|
||||||
"owner": "nix-community",
|
"owner": "rycee",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1",
|
"rev": "f6f6990fc811454cb3082ba3662b711488fd0554",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nix-community",
|
"owner": "rycee",
|
||||||
|
"ref": "master",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"home-manager_2": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1720042825,
|
|
||||||
"narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "home-manager",
|
|
||||||
"rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"ref": "release-24.05",
|
|
||||||
"repo": "home-manager",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nix-matrix-appservices": {
|
|
||||||
"inputs": {
|
|
||||||
"devshell": "devshell",
|
|
||||||
"flake-compat": "flake-compat_2",
|
|
||||||
"nixlib": "nixlib",
|
|
||||||
"nixpkgs": "nixpkgs"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1683490239,
|
|
||||||
"narHash": "sha256-QKzpvl2XrqbobWq/I/smDa9hEniwctjJybXPVILHP0w=",
|
|
||||||
"owner": "coffeetables",
|
|
||||||
"repo": "nix-matrix-appservices",
|
|
||||||
"rev": "e795d2fbc61da45d49802bb3e8f8d0c70ddc1e68",
|
|
||||||
"type": "gitlab"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "coffeetables",
|
|
||||||
"repo": "nix-matrix-appservices",
|
|
||||||
"type": "gitlab"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixlib": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1643502816,
|
|
||||||
"narHash": "sha256-Wrbt6Gs+hjXD3HUICPBJHKnHEUqiyx8rzHCgvqC1Bok=",
|
|
||||||
"owner": "divnix",
|
|
||||||
"repo": "nixpkgs.lib",
|
|
||||||
"rev": "ebed7ec5bcb5d01e298535989c6c321df18b631a",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "divnix",
|
|
||||||
"repo": "nixpkgs.lib",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixos-hardware": {
|
"nixos-hardware": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1723310128,
|
"lastModified": 1627212500,
|
||||||
"narHash": "sha256-IiH8jG6PpR4h9TxSGMYh+2/gQiJW9MwehFvheSb5rPc=",
|
"narHash": "sha256-KMUQCT3JSqznp+dR6BTvbwLqPFErjNlotVpkp/P/ZmM=",
|
||||||
"owner": "NixOS",
|
"owner": "nixos",
|
||||||
"repo": "nixos-hardware",
|
"repo": "nixos-hardware",
|
||||||
"rev": "c54cf53e022b0b3c1d3b8207aa0f9b194c24f0cf",
|
"rev": "03e7686c72345f237405c0b46b153dccd3ec9913",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "nixos",
|
||||||
"ref": "master",
|
|
||||||
"repo": "nixos-hardware",
|
"repo": "nixos-hardware",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1662099760,
|
"lastModified": 1627128856,
|
||||||
"narHash": "sha256-MdZLCTJPeHi/9fg6R9fiunyDwP3XHJqDd51zWWz9px0=",
|
"narHash": "sha256-yw3lA8zyNFhj309lmxvNByEEymRT1rRy5oE+jEPnsP4=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "67e45078141102f45eff1589a831aeaa3182b41e",
|
"rev": "dd14e5d78e90a2ccd6007e569820de9b4861a6c2",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
"id": "nixpkgs",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"type": "indirect"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs-unstable": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1627170405,
|
||||||
|
"narHash": "sha256-6t7ISnt0Iqc2jxIf5+/su6eFmZNWnPAOA1JeOv9lLRE=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"ref": "nixos-22.05",
|
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"rev": "ecaf3da9340231e5493eccc3db87604a3705da42",
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs_2": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1723938990,
|
|
||||||
"narHash": "sha256-9tUadhnZQbWIiYVXH8ncfGXGvkNq3Hag4RCBEMUk7MI=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "c42fcfbdfeae23e68fc520f9182dde9f38ad1890",
|
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nixos",
|
"id": "nixpkgs",
|
||||||
"ref": "nixos-24.05",
|
"ref": "nixpkgs-unstable",
|
||||||
"repo": "nixpkgs",
|
"type": "indirect"
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nur": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1724040334,
|
|
||||||
"narHash": "sha256-Ia4gRRmhFn4oJ4SJKJPDNPomsRRFWU+bqCK7yuiLW4E=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "NUR",
|
|
||||||
"rev": "24471a48600e18669d13d24c9640b9859357d2cf",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "NUR",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"poonam": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1730098805,
|
|
||||||
"narHash": "sha256-LvLTqCX3BZ92srebbpMFMCOOBXJ1GZn/rbayiEcXScE=",
|
|
||||||
"ref": "main",
|
|
||||||
"rev": "ec87c69f50283d106d16338963baaa614580ce4a",
|
|
||||||
"revCount": 1512,
|
|
||||||
"type": "git",
|
|
||||||
"url": "ssh://gitea@git.sealight.xyz/aynish/kitaab"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"ref": "main",
|
|
||||||
"type": "git",
|
|
||||||
"url": "ssh://gitea@git.sealight.xyz/aynish/kitaab"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"agenix": "agenix",
|
"agenix": "agenix",
|
||||||
"basant": "basant",
|
"emacs-overlay": "emacs-overlay",
|
||||||
"deploy-rs": "deploy-rs",
|
"home-manager": "home-manager",
|
||||||
"disko": "disko",
|
|
||||||
"grasp": "grasp",
|
|
||||||
"hardware": "hardware",
|
|
||||||
"home-manager": "home-manager_2",
|
|
||||||
"nix-matrix-appservices": "nix-matrix-appservices",
|
|
||||||
"nixos-hardware": "nixos-hardware",
|
"nixos-hardware": "nixos-hardware",
|
||||||
"nixpkgs": "nixpkgs_2",
|
"nixpkgs": "nixpkgs",
|
||||||
"nur": "nur",
|
"nixpkgs-unstable": "nixpkgs-unstable"
|
||||||
"poonam": "poonam",
|
|
||||||
"rust-overlay": "rust-overlay",
|
|
||||||
"tidalcycles": "tidalcycles",
|
|
||||||
"unstable": "unstable",
|
|
||||||
"vimwikicli": "vimwikicli"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"rust-overlay": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1724034091,
|
|
||||||
"narHash": "sha256-b1g7w0sw+MDAhUAeCoX1vlTghsqcDZkxr+k9OZmxPa8=",
|
|
||||||
"owner": "oxalica",
|
|
||||||
"repo": "rust-overlay",
|
|
||||||
"rev": "c7d36e0947826e0751a5214ffe82533fbc909bc0",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "oxalica",
|
|
||||||
"repo": "rust-overlay",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"superdirt-src": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1697377840,
|
|
||||||
"narHash": "sha256-9qU9CHYAXbN1IE3xXDqGipuroifVaSVXj3c/cDfwM80=",
|
|
||||||
"owner": "musikinformatik",
|
|
||||||
"repo": "superdirt",
|
|
||||||
"rev": "c7f32998572984705d340e7c1b9ed9ad998a39b6",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "musikinformatik",
|
|
||||||
"repo": "superdirt",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"systems": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1681028828,
|
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"systems_2": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1681028828,
|
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tidal-src": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1712519522,
|
|
||||||
"narHash": "sha256-LbvxQmVxHElidCgvt+w0g1k+QQbNLebK46vtRCgsLeQ=",
|
|
||||||
"owner": "tidalcycles",
|
|
||||||
"repo": "tidal",
|
|
||||||
"rev": "88f09edf6bef2228d5f530dea872b08a9d803066",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "tidalcycles",
|
|
||||||
"ref": "v1.9.5",
|
|
||||||
"repo": "tidal",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tidalcycles": {
|
|
||||||
"inputs": {
|
|
||||||
"dirt-samples-src": "dirt-samples-src",
|
|
||||||
"nixpkgs": [
|
|
||||||
"unstable"
|
|
||||||
],
|
|
||||||
"superdirt-src": "superdirt-src",
|
|
||||||
"tidal-src": "tidal-src",
|
|
||||||
"vim-tidal-src": "vim-tidal-src",
|
|
||||||
"vowel-src": "vowel-src"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1723223284,
|
|
||||||
"narHash": "sha256-NAT+g5nsaJZkpR0sCZjerd1xx233ZUdRH3ZWwZhzq/c=",
|
|
||||||
"owner": "mitchmindtree",
|
|
||||||
"repo": "tidalcycles.nix",
|
|
||||||
"rev": "82f3e8e8d02eb9f0c9dfe9ab3773b825c6bc1982",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "mitchmindtree",
|
|
||||||
"repo": "tidalcycles.nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"unstable": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1723637854,
|
|
||||||
"narHash": "sha256-med8+5DSWa2UnOqtdICndjDAEjxr5D7zaIiK4pn0Q7c=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "c3aa7b8938b17aebd2deecf7be0636000d62a2b9",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixos-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"utils": {
|
|
||||||
"inputs": {
|
|
||||||
"systems": "systems_2"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1701680307,
|
|
||||||
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"vim-tidal-src": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1685703852,
|
|
||||||
"narHash": "sha256-8gyk17YLeKpLpz3LRtxiwbpsIbZka9bb63nK5/9IUoA=",
|
|
||||||
"owner": "tidalcycles",
|
|
||||||
"repo": "vim-tidal",
|
|
||||||
"rev": "e440fe5bdfe07f805e21e6872099685d38e8b761",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "tidalcycles",
|
|
||||||
"repo": "vim-tidal",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"vimwikicli": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1662448409,
|
|
||||||
"narHash": "sha256-Xd8CuFcEpEQK/TjNBXcp1HqPJCc7LwkMqKa1WiAP1Zc=",
|
|
||||||
"ref": "main",
|
|
||||||
"rev": "a73c4695cf116c2e8194a5caa837c2f9e1a7e2fb",
|
|
||||||
"revCount": 7,
|
|
||||||
"type": "git",
|
|
||||||
"url": "ssh://gitea@git.sealight.xyz/aynish/vimwiki-cli"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"ref": "main",
|
|
||||||
"type": "git",
|
|
||||||
"url": "ssh://gitea@git.sealight.xyz/aynish/vimwiki-cli"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"vowel-src": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1641306144,
|
|
||||||
"narHash": "sha256-zfF6cvAGDNYWYsE8dOIo38b+dIymd17Pexg0HiPFbxM=",
|
|
||||||
"owner": "supercollider-quarks",
|
|
||||||
"repo": "vowel",
|
|
||||||
"rev": "ab59caa870201ecf2604b3efdd2196e21a8b5446",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "supercollider-quarks",
|
|
||||||
"repo": "vowel",
|
|
||||||
"type": "github"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
320
flake.nix
320
flake.nix
|
@ -1,275 +1,85 @@
|
||||||
|
# flake.nix --- the heart of my dotfiles
|
||||||
|
#
|
||||||
|
# Author: Henrik Lissner <henrik@lissner.net>
|
||||||
|
# URL: https://github.com/hlissner/dotfiles
|
||||||
|
# License: MIT
|
||||||
|
#
|
||||||
|
# Welcome to ground zero. Where the whole flake gets set up and all its modules
|
||||||
|
# are loaded.
|
||||||
|
|
||||||
{
|
{
|
||||||
description = "Sealight NixOS Config";
|
description = "A grossly incandescent nixos config.";
|
||||||
|
|
||||||
inputs = {
|
inputs =
|
||||||
# Nixpkgs
|
{
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
|
# Core dependencies.
|
||||||
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "nixpkgs/nixos-unstable"; # primary nixpkgs
|
||||||
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
nixpkgs-unstable.url = "nixpkgs/nixpkgs-unstable"; # for packages on the edge
|
||||||
|
home-manager.url = "github:rycee/home-manager/master";
|
||||||
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
agenix.url = "github:ryantm/agenix";
|
||||||
|
agenix.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
# ngipkgs.url = "github:Chickensoupwithrice/ngipkgs?ref=aynish/atomic-server-module";
|
# Extras
|
||||||
# ngipkgs-local.url = "path:/home/anish/usr/ngipkgs";
|
emacs-overlay.url = "github:nix-community/emacs-overlay";
|
||||||
|
nixos-hardware.url = "github:nixos/nixos-hardware";
|
||||||
# Home manager
|
|
||||||
home-manager.url = "github:nix-community/home-manager/release-24.05";
|
|
||||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
hardware.url = "github:nixos/nixos-hardware";
|
|
||||||
|
|
||||||
# Tools
|
|
||||||
agenix.url = "github:ryantm/agenix";
|
|
||||||
agenix.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
deploy-rs.url = "github:serokell/deploy-rs";
|
|
||||||
deploy-rs.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
disko.url = "github:nix-community/disko";
|
|
||||||
disko.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
|
|
||||||
# My Packages
|
|
||||||
poonam.url = "git+ssh://gitea@git.sealight.xyz/aynish/kitaab?ref=main";
|
|
||||||
poonam.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
basant.url = "git+ssh://gitea@git.sealight.xyz/aynish/basant?ref=main";
|
|
||||||
vimwikicli.url =
|
|
||||||
"git+ssh://gitea@git.sealight.xyz/aynish/vimwiki-cli?ref=main";
|
|
||||||
basant.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
basant.inputs.poonam.follows = "poonam";
|
|
||||||
vimwikicli.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
grasp.url = "git+ssh://gitea@git.sealight.xyz/aynish/grasp.git?ref=main";
|
|
||||||
grasp.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
|
|
||||||
# Matrix
|
|
||||||
nix-matrix-appservices.url = "gitlab:coffeetables/nix-matrix-appservices";
|
|
||||||
|
|
||||||
# Others
|
|
||||||
nur.url = "github:nix-community/NUR";
|
|
||||||
rust-overlay = {
|
|
||||||
url = "github:oxalica/rust-overlay";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
};
|
||||||
tidalcycles.url = "github:mitchmindtree/tidalcycles.nix";
|
|
||||||
tidalcycles.inputs.nixpkgs.follows = "unstable";
|
|
||||||
# TODO hundred rabbits software
|
|
||||||
# TODO needs secrets
|
|
||||||
# dhyan.url = "git+ssh://gitea@git.sealight.xyz/aynish/dhyan?ref=main";
|
|
||||||
# dhyan.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
# TODO needs secrets
|
|
||||||
# muneem.url = "git+ssh://gitea@git.sealight.xyz/aynish/muneem?ref=main";
|
|
||||||
# muneem.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs = { self, nixpkgs, unstable, nixos-hardware, home-manager, deploy-rs
|
outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, ... }:
|
||||||
, agenix, disko, basant, grasp, nix-matrix-appservices, nur, tidalcycles
|
|
||||||
, rust-overlay, vimwikicli, ... }@inputs:
|
|
||||||
let
|
let
|
||||||
forAllSystems = nixpkgs.lib.genAttrs [
|
inherit (lib.my) mapModules mapModulesRec mapHosts;
|
||||||
"aarch64-linux"
|
|
||||||
"i686-linux"
|
|
||||||
"x86_64-linux"
|
|
||||||
"aarch64-darwin"
|
|
||||||
"x86_64-darwin"
|
|
||||||
];
|
|
||||||
unstableOverlay = final: prev: {
|
|
||||||
# We already have these in scope
|
|
||||||
unstable = unstable.legacyPackages.${prev.system};
|
|
||||||
deploy = deploy-rs.packages.${prev.system}.deploy-rs;
|
|
||||||
};
|
|
||||||
vimwikiOverlay = final: prev: {
|
|
||||||
vimwiki-cli = vimwikicli.packages.${prev.system}.vimwiki-cli;
|
|
||||||
};
|
|
||||||
|
|
||||||
nixpkgsFor = forAllSystems (system:
|
system = "x86_64-linux";
|
||||||
import nixpkgs {
|
|
||||||
inherit system;
|
|
||||||
config.allowUnfreePredicate = pkg:
|
|
||||||
builtins.elem (nixpkgs.lib.getName pkg) [
|
|
||||||
"ripcord"
|
|
||||||
"vcv-rack"
|
|
||||||
"SunVox"
|
|
||||||
"renoise"
|
|
||||||
];
|
|
||||||
# config.permittedInsecurePackages = [
|
|
||||||
# "python3.10-django-3.1.14" # Needed for archivebox deployments on curve
|
|
||||||
# # Check when archive box updates it's dependeny
|
|
||||||
# ];
|
|
||||||
overlays = [
|
|
||||||
rust-overlay.overlays.default
|
|
||||||
tidalcycles.overlays.default
|
|
||||||
agenix.overlays.default
|
|
||||||
nur.overlay
|
|
||||||
nix-matrix-appservices.overlay
|
|
||||||
unstableOverlay
|
|
||||||
vimwikiOverlay
|
|
||||||
self.overlays.additions
|
|
||||||
self.overlays.modifications
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
# for when space matters
|
mkPkgs = pkgs: extraOverlays: import pkgs {
|
||||||
litePkgsFor = forAllSystems (system:
|
inherit system;
|
||||||
import nixpkgs {
|
config.allowUnfree = true; # forgive me Stallman senpai
|
||||||
inherit system;
|
overlays = extraOverlays ++ (lib.attrValues self.overlays);
|
||||||
# config.permittedInsecurePackages = [
|
};
|
||||||
# "forgejo-1.19.4-0" # Needed for archivebox deployments on curve
|
pkgs = mkPkgs nixpkgs [ self.overlay ];
|
||||||
# # Check when archive box updates it's dependeny
|
pkgs' = mkPkgs nixpkgs-unstable [];
|
||||||
# ];
|
|
||||||
overlays = [
|
lib = nixpkgs.lib.extend
|
||||||
agenix.overlays.default
|
(self: super: { my = import ./lib { inherit pkgs inputs; lib = self; }; });
|
||||||
self.overlays.additions
|
|
||||||
self.overlays.modifications
|
|
||||||
tidalcycles.overlays.default # needed for nvim which comes pre-installed lol
|
|
||||||
];
|
|
||||||
});
|
|
||||||
in {
|
in {
|
||||||
# Your custom packages
|
lib = lib.my;
|
||||||
# Acessible through 'nix build', 'nix shell', etc
|
|
||||||
packages = forAllSystems (system:
|
|
||||||
let pkgs = nixpkgsFor.${system};
|
|
||||||
in import ./pkgs { pkgs = pkgs; });
|
|
||||||
# Devshell for bootstrapping
|
|
||||||
# Acessible through 'nix develop' or 'nix-shell' (legacy)
|
|
||||||
devShells = forAllSystems (system:
|
|
||||||
let pkgs = nixpkgsFor.${system};
|
|
||||||
in import ./shell.nix { pkgs = pkgs; });
|
|
||||||
|
|
||||||
# Your custom packages and modifications, exported as overlays
|
overlay =
|
||||||
overlays = import ./overlays;
|
final: prev: {
|
||||||
# Reusable nixos modules you might want to export
|
unstable = pkgs';
|
||||||
# These are usually stuff you would upstream into nixpkgs
|
my = self.packages."${system}";
|
||||||
nixosModules = import ./modules/nixos;
|
|
||||||
# Reusable home-manager modules you might want to export
|
|
||||||
# These are usually stuff you would upstream into home-manager
|
|
||||||
homeManagerModules = import ./modules/home-manager;
|
|
||||||
|
|
||||||
# NixOS configuration entrypoint
|
|
||||||
nixosConfigurations = {
|
|
||||||
curve = nixpkgs.lib.nixosSystem rec {
|
|
||||||
specialArgs = { inherit inputs self; };
|
|
||||||
system = "x86_64-linux";
|
|
||||||
pkgs = nixpkgsFor.${system};
|
|
||||||
modules = [
|
|
||||||
./hosts/curve
|
|
||||||
agenix.nixosModules.age
|
|
||||||
self.nixosModules.backup
|
|
||||||
self.nixosModules.wireguard
|
|
||||||
self.nixosModules.wallabag
|
|
||||||
nixos-hardware.nixosModules.lenovo-thinkpad-x270
|
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
{
|
|
||||||
nix.registry.nixpkgs.flake = nixpkgs;
|
|
||||||
nix.registry.unstable.flake = unstable;
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
home-manager.users.anish = import ./home/gui;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
helix = nixpkgs.lib.nixosSystem rec {
|
overlays =
|
||||||
specialArgs = { inherit inputs self; };
|
mapModules ./overlays import;
|
||||||
system = "x86_64-linux";
|
|
||||||
pkgs = litePkgsFor.${system};
|
|
||||||
modules = [
|
|
||||||
./hosts/helix
|
|
||||||
agenix.nixosModules.age
|
|
||||||
self.nixosModules.backup
|
|
||||||
self.nixosModules.wireguard
|
|
||||||
basant.nixosModule
|
|
||||||
# self.nixosModules.microbin
|
|
||||||
disko.nixosModules.disko
|
|
||||||
{
|
|
||||||
nixpkgs.flake.setNixPath = false;
|
|
||||||
nixpkgs.flake.setFlakeRegistry = false;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
lituus = nixpkgs.lib.nixosSystem rec {
|
packages."${system}" =
|
||||||
specialArgs = { inherit inputs self; };
|
mapModules ./packages (p: pkgs.callPackage p {});
|
||||||
system = "x86_64-linux";
|
|
||||||
pkgs = nixpkgsFor.${system};
|
|
||||||
modules = [
|
|
||||||
./hosts/lituus
|
|
||||||
agenix.nixosModules.age
|
|
||||||
self.nixosModules.backup
|
|
||||||
self.nixosModules.hesienbridge
|
|
||||||
nix-matrix-appservices.nixosModule
|
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
{
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
home-manager.users.anish = import ./home/core;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
box = nixpkgs.lib.nixosSystem rec {
|
nixosModules =
|
||||||
specialArgs = { inherit inputs self; };
|
{ dotfiles = import ./.; } // mapModulesRec ./modules import;
|
||||||
system = "x86_64-linux";
|
|
||||||
pkgs = nixpkgsFor.${system};
|
nixosConfigurations =
|
||||||
modules = [
|
mapHosts ./hosts {};
|
||||||
./hosts/box
|
|
||||||
agenix.nixosModules.age
|
devShell."${system}" =
|
||||||
self.nixosModules.backup
|
import ./shell.nix { inherit pkgs; };
|
||||||
self.nixosModules.wireguard
|
|
||||||
self.nixosModules.gonic
|
templates = {
|
||||||
self.nixosModules.gpodder2go
|
full = {
|
||||||
self.nixosModules.wallabag
|
path = ./.;
|
||||||
self.nixosModules.ulogger-server
|
description = "A grossly incandescent nixos config";
|
||||||
grasp.nixosModule
|
};
|
||||||
home-manager.nixosModules.home-manager
|
minimal = {
|
||||||
{
|
path = ./templates/minimal;
|
||||||
nix.registry.nixpkgs.flake = nixpkgs;
|
description = "A grossly incandescent and minimal nixos config";
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
home-manager.users.anish = import ./home/dev;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
defaultTemplate = self.templates.minimal;
|
||||||
|
|
||||||
# Standalone home-manager configuration entrypoint
|
defaultApp."${system}" = {
|
||||||
# Available through 'home-manager --flake .#your-username@your-hostname'
|
type = "app";
|
||||||
homeConfigurations = {
|
program = ./bin/hey;
|
||||||
"anish@work" = home-manager.lib.homeManagerConfiguration {
|
|
||||||
pkgs =
|
|
||||||
nixpkgsFor."x86_64-linux"; # Home-manager requires 'pkgs' instance
|
|
||||||
extraSpecialArgs = { inherit inputs; };
|
|
||||||
modules = [ ./home/core.nix ./home/profiles/firefox ];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
deploy.nodes = {
|
|
||||||
box = {
|
|
||||||
hostname = "mossnet.lan";
|
|
||||||
autoRollback = false;
|
|
||||||
magicRollback = false;
|
|
||||||
remoteBuild = true;
|
|
||||||
profiles.system = {
|
|
||||||
user = "root";
|
|
||||||
path = deploy-rs.lib.x86_64-linux.activate.nixos
|
|
||||||
self.nixosConfigurations.box;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
lituus = {
|
|
||||||
hostname = "sealight.xyz";
|
|
||||||
# autoRollback = false;
|
|
||||||
profiles.system = {
|
|
||||||
user = "root";
|
|
||||||
path = deploy-rs.lib.x86_64-linux.activate.nixos
|
|
||||||
self.nixosConfigurations.lituus;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
helix = {
|
|
||||||
hostname = "git.sealight.xyz";
|
|
||||||
autoRollback = false;
|
|
||||||
magicRollback = false;
|
|
||||||
profiles.system = {
|
|
||||||
user = "root";
|
|
||||||
path = deploy-rs.lib.x86_64-linux.activate.nixos
|
|
||||||
self.nixosConfigurations.helix;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
checks = builtins.mapAttrs
|
|
||||||
(system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
{ self, pkgs, ... }:
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
../profiles/cli
|
|
||||||
../profiles/direnv
|
|
||||||
../profiles/git
|
|
||||||
];
|
|
||||||
home.stateVersion = "22.05";
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
{ self, pkgs, ... }: {
|
|
||||||
imports =
|
|
||||||
[ ../profiles/cli ../profiles/nvim ../profiles/direnv ../profiles/git ];
|
|
||||||
home.stateVersion = "22.05";
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
../core
|
|
||||||
../profiles/nvim
|
|
||||||
../profiles/firefox
|
|
||||||
../profiles/desktop
|
|
||||||
../profiles/email
|
|
||||||
../profiles/cal
|
|
||||||
../profiles/sync/kitaab
|
|
||||||
../profiles/ssh
|
|
||||||
../profiles/task
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -1,62 +0,0 @@
|
||||||
# This is your home-manager configuration file
|
|
||||||
# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix)
|
|
||||||
|
|
||||||
{ inputs, outputs, lib, config, pkgs, ... }: {
|
|
||||||
# You can import other home-manager modules here
|
|
||||||
imports = [
|
|
||||||
# If you want to use modules your own flake exports (from modules/home-manager):
|
|
||||||
# outputs.homeManagerModules.example
|
|
||||||
|
|
||||||
# Or modules exported from other flakes (such as nix-colors):
|
|
||||||
# inputs.nix-colors.homeManagerModules.default
|
|
||||||
|
|
||||||
# You can also split up your configuration and import pieces of it here:
|
|
||||||
# ./nvim.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
nixpkgs = {
|
|
||||||
# You can add overlays here
|
|
||||||
overlays = [
|
|
||||||
# If you want to use overlays your own flake exports (from overlays dir):
|
|
||||||
# outputs.overlays.modifications
|
|
||||||
# outputs.overlays.additions
|
|
||||||
|
|
||||||
# Or overlays exported from other flakes:
|
|
||||||
# neovim-nightly-overlay.overlays.default
|
|
||||||
|
|
||||||
# Or define it inline, for example:
|
|
||||||
# (final: prev: {
|
|
||||||
# hi = final.hello.overrideAttrs (oldAttrs: {
|
|
||||||
# patches = [ ./change-hello-to-hi.patch ];
|
|
||||||
# });
|
|
||||||
# })
|
|
||||||
];
|
|
||||||
# Configure your nixpkgs instance
|
|
||||||
config = {
|
|
||||||
# Disable if you don't want unfree packages
|
|
||||||
allowUnfree = true;
|
|
||||||
# Workaround for https://github.com/nix-community/home-manager/issues/2942
|
|
||||||
allowUnfreePredicate = (_: true);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# TODO: Set your username
|
|
||||||
home = {
|
|
||||||
username = "anish";
|
|
||||||
homeDirectory = "/home/anish/";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Add stuff for your user as you see fit:
|
|
||||||
# programs.neovim.enable = true;
|
|
||||||
# home.packages = with pkgs; [ steam ];
|
|
||||||
|
|
||||||
# Enable home-manager and git
|
|
||||||
programs.home-manager.enable = true;
|
|
||||||
# programs.git.enable = true;
|
|
||||||
|
|
||||||
# Nicely reload system units when changing configs
|
|
||||||
# systemd.user.startServices = "sd-switch";
|
|
||||||
|
|
||||||
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
|
||||||
home.stateVersion = "22.05";
|
|
||||||
}
|
|
|
@ -1,98 +0,0 @@
|
||||||
{ pkgs, config, age, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
khal
|
|
||||||
khard
|
|
||||||
vdirsyncer
|
|
||||||
];
|
|
||||||
|
|
||||||
xdg.configFile = {
|
|
||||||
"vdirsyncer/config".text = ''
|
|
||||||
[general]
|
|
||||||
status_path = "/home/anish/.config/vdirsyncer/status/"
|
|
||||||
|
|
||||||
[pair contacts]
|
|
||||||
a = "contacts_local"
|
|
||||||
b = "contacts_remote"
|
|
||||||
collections = ["from b"]
|
|
||||||
metadata = ["displayname"]
|
|
||||||
|
|
||||||
[storage contacts_local]
|
|
||||||
type = "filesystem"
|
|
||||||
path = "~/.contacts/"
|
|
||||||
fileext = ".vcf"
|
|
||||||
|
|
||||||
[storage contacts_remote]
|
|
||||||
type = "carddav"
|
|
||||||
url = "http://mossnet.lan:5252/anish"
|
|
||||||
username = "anish"
|
|
||||||
password.fetch = ["command", "echo", "acceptsanypassword"]
|
|
||||||
|
|
||||||
[pair calendar]
|
|
||||||
a = "calendar_local"
|
|
||||||
b = "calendar_remote"
|
|
||||||
collections = ["from b"]
|
|
||||||
metadata = ["displayname"]
|
|
||||||
|
|
||||||
[storage calendar_local]
|
|
||||||
type = "filesystem"
|
|
||||||
path = "~/.calendar/"
|
|
||||||
fileext = ".ics"
|
|
||||||
|
|
||||||
[storage calendar_remote]
|
|
||||||
type = "caldav"
|
|
||||||
url = "http://mossnet.lan:5252/anish"
|
|
||||||
username = "anish"
|
|
||||||
password.fetch = ["command", "echo", "allpasswordsaccepted"]
|
|
||||||
'';
|
|
||||||
|
|
||||||
"khal/config".text = ''
|
|
||||||
[calendars]
|
|
||||||
|
|
||||||
[[calendar_local]]
|
|
||||||
path = ~/.calendar/*
|
|
||||||
type = discover
|
|
||||||
|
|
||||||
[[contacts_local]]
|
|
||||||
path = ~/.contacts/*
|
|
||||||
type = birthdays
|
|
||||||
|
|
||||||
[locale]
|
|
||||||
timeformat = %H:%M
|
|
||||||
dateformat = %Y-%m-%d
|
|
||||||
longdateformat = %Y-%m-%d
|
|
||||||
datetimeformat = %Y-%m-%d %H:%M
|
|
||||||
longdatetimeformat = %Y-%m-%d %H:%M
|
|
||||||
'';
|
|
||||||
|
|
||||||
"khard/khard.conf".text = ''
|
|
||||||
[addressbooks]
|
|
||||||
[[personal]]
|
|
||||||
path = ~/.contacts/*
|
|
||||||
|
|
||||||
[general]
|
|
||||||
debug = no
|
|
||||||
default_action = list
|
|
||||||
editor = nvim, -i, NONE
|
|
||||||
merge_editor = nvim, -d
|
|
||||||
|
|
||||||
[contact table]
|
|
||||||
display = first_name
|
|
||||||
group_by_addressbook = no
|
|
||||||
reverse = no
|
|
||||||
show_nicknames = yes
|
|
||||||
show_uids = no
|
|
||||||
sort = last_name
|
|
||||||
localize_dates = yes
|
|
||||||
preferred_phone_number_type = pref, cell, home
|
|
||||||
preferred_email_address_type = pref, home, work
|
|
||||||
|
|
||||||
[vcard]
|
|
||||||
private_objects = Jabber,
|
|
||||||
preferred_version = 3.0
|
|
||||||
search_in_source_files = no
|
|
||||||
skip_unparsable = no
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
working_directory=$(pwd)
|
|
||||||
vim_directory="${working_directory//\//%}.vim"
|
|
||||||
trash "$HOME/.local/share/nvim/sessions/${vim_directory}"
|
|
|
@ -1,19 +0,0 @@
|
||||||
`dasht-docsets-intstall`
|
|
||||||
|
|
||||||
Bash
|
|
||||||
Clojure
|
|
||||||
Docker
|
|
||||||
Elixir
|
|
||||||
HTML
|
|
||||||
JavaScript
|
|
||||||
Jinja
|
|
||||||
Lua_5.4
|
|
||||||
Nginx
|
|
||||||
OpenGL_4
|
|
||||||
PostgreSQL
|
|
||||||
Processing
|
|
||||||
Python_3
|
|
||||||
React
|
|
||||||
Rust
|
|
||||||
TypeScript
|
|
||||||
Vim
|
|
|
@ -1,315 +0,0 @@
|
||||||
{ lib, pkgs, config, ... }:
|
|
||||||
{
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
binutils
|
|
||||||
coreutils
|
|
||||||
dnsutils
|
|
||||||
dasht
|
|
||||||
dosfstools
|
|
||||||
#git
|
|
||||||
git-machete
|
|
||||||
bottom
|
|
||||||
gptfdisk
|
|
||||||
starship
|
|
||||||
iputils
|
|
||||||
jq
|
|
||||||
manix
|
|
||||||
moreutils
|
|
||||||
nix-index
|
|
||||||
cached-nix-shell
|
|
||||||
nmap
|
|
||||||
ripgrep
|
|
||||||
skim
|
|
||||||
tealdeer
|
|
||||||
usbutils
|
|
||||||
utillinux
|
|
||||||
whois
|
|
||||||
iftop
|
|
||||||
wget
|
|
||||||
curl
|
|
||||||
eza
|
|
||||||
bat
|
|
||||||
fd
|
|
||||||
ncdu
|
|
||||||
du-dust
|
|
||||||
# dia-cli
|
|
||||||
duf
|
|
||||||
trash-cli
|
|
||||||
nix-index
|
|
||||||
silver-searcher
|
|
||||||
tcpdump
|
|
||||||
mtr
|
|
||||||
file
|
|
||||||
lsof
|
|
||||||
atool
|
|
||||||
strace
|
|
||||||
zip
|
|
||||||
unzip
|
|
||||||
rsync
|
|
||||||
tmux
|
|
||||||
pwgen
|
|
||||||
glow
|
|
||||||
pass
|
|
||||||
less
|
|
||||||
gdb
|
|
||||||
xxd
|
|
||||||
taskwarrior
|
|
||||||
gnupg
|
|
||||||
syncthing
|
|
||||||
dijo
|
|
||||||
#ssb-patchwork
|
|
||||||
fontconfig
|
|
||||||
pandoc
|
|
||||||
taskwarrior-tui
|
|
||||||
python3Packages.howdoi
|
|
||||||
vimwiki-cli
|
|
||||||
|
|
||||||
(pkgs.writeScriptBin "jq-repl" ''
|
|
||||||
#!/usr/bin/env bash
|
|
||||||
if [[ -z $1 ]] || [[ $1 == "-" ]]; then
|
|
||||||
input=$(mktemp)
|
|
||||||
trap "rm -f $input" EXIT
|
|
||||||
cat /dev/stdin > $input
|
|
||||||
else
|
|
||||||
input=$1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "" \ | fzf --phony --preview-window="up:90%" --print-query --preview "jq --color-output -r {q} $input"
|
|
||||||
'')
|
|
||||||
(pkgs.writeScriptBin "clear-vim-trash" (builtins.readFile ./bin/clear-vim-trash.sh))
|
|
||||||
(pkgs.writeScriptBin "flakify" ''
|
|
||||||
#!/usr/bin/env zsh
|
|
||||||
if [ ! -e flake.nix ]; then
|
|
||||||
nix flake new -t github:nix-community/nix-direnv .
|
|
||||||
elif [ ! -e .envrc ]; then
|
|
||||||
echo "use flake" > .envrc
|
|
||||||
direnv allow
|
|
||||||
fi
|
|
||||||
vim flake.nix
|
|
||||||
'')
|
|
||||||
(pkgs.writeScriptBin "mx" ''
|
|
||||||
#!/usr/bin/env bash
|
|
||||||
manix "" | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | fzf --preview="manix '{}'" | xargs manix
|
|
||||||
'')
|
|
||||||
(pkgs.writeScriptBin "monitor" ''
|
|
||||||
# hotplug
|
|
||||||
connect() {
|
|
||||||
# Turn it on if it was off
|
|
||||||
xrandr --output HDMI-2 --auto
|
|
||||||
xrandr --output HDMI-2 --same-as eDP-1
|
|
||||||
}
|
|
||||||
|
|
||||||
disconnect() {
|
|
||||||
xrandr --output HDMI-2 --off
|
|
||||||
}
|
|
||||||
|
|
||||||
xrandr | grep "HDMI-2 connected" &>>/dev/null && connect || disconnect
|
|
||||||
'')
|
|
||||||
(pkgs.writeScriptBin "disconnect-keyboard" ''
|
|
||||||
# keyboard on curve is busted
|
|
||||||
get_keyboard_id() {
|
|
||||||
xinput list | grep 'AT Translated Set' | cut -f2 | cut -d'=' -f2 | xinput float
|
|
||||||
}
|
|
||||||
|
|
||||||
disconnect_keyboard() {
|
|
||||||
id=$(get_keyboard_id)
|
|
||||||
xinput float $id
|
|
||||||
unset id
|
|
||||||
}
|
|
||||||
|
|
||||||
attach_keyboard() {
|
|
||||||
id=$(get_keyboard_id)
|
|
||||||
xinput reattach $id 3
|
|
||||||
unset id
|
|
||||||
}
|
|
||||||
|
|
||||||
disconnect_keyboard
|
|
||||||
'')
|
|
||||||
];
|
|
||||||
|
|
||||||
programs.zsh = {
|
|
||||||
enable = true;
|
|
||||||
enableCompletion = true;
|
|
||||||
autosuggestion.enable = false;
|
|
||||||
|
|
||||||
initExtra = ''
|
|
||||||
bindkey -v
|
|
||||||
autopair-init
|
|
||||||
'';
|
|
||||||
sessionVariables = {
|
|
||||||
EDITOR = "nvim";
|
|
||||||
TERMINFO_DIRS = "${pkgs.kitty.terminfo.outPath}/share/terminfo"; # Needed to run home-manager switch on non-nixOS
|
|
||||||
};
|
|
||||||
plugins = [
|
|
||||||
{
|
|
||||||
name = "zsh-autopair";
|
|
||||||
src = pkgs.fetchFromGitHub {
|
|
||||||
owner = "hlissner";
|
|
||||||
repo = "zsh-autopair";
|
|
||||||
rev = "34a8bca0c18fcf3ab1561caef9790abffc1d3d49";
|
|
||||||
sha256 = "1h0vm2dgrmb8i2pvsgis3lshc5b0ad846836m62y8h3rdb3zmpy1";
|
|
||||||
};
|
|
||||||
file = "autopair.zsh";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "zsh-syntax-highlighting";
|
|
||||||
src = pkgs.fetchFromGitHub {
|
|
||||||
owner = "zsh-users";
|
|
||||||
repo = "zsh-syntax-highlighting";
|
|
||||||
rev = "0.6.0";
|
|
||||||
sha256 = "0zmq66dzasmr5pwribyh4kbkk23jxbpdw4rjxx0i7dx8jjp2lzl4";
|
|
||||||
};
|
|
||||||
file = "zsh-syntax-highlighting.zsh";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "zsh-autoquoter";
|
|
||||||
src = pkgs.fetchFromGitHub {
|
|
||||||
owner = "ianthehenry";
|
|
||||||
repo = "zsh-autoquoter";
|
|
||||||
rev = "819a615fbfd2ad25c5d311080e3a325696b45de7";
|
|
||||||
sha256 = "r0jdo+YFTOejvNMTqzXi5ftcLzDpuKejX0wMFwqKdJY=";
|
|
||||||
};
|
|
||||||
file = "zsh-autoquoter.zsh";
|
|
||||||
}
|
|
||||||
# {
|
|
||||||
# name = "zsh-nix-shell";
|
|
||||||
# file = "nix-shell.plugin.zsh";
|
|
||||||
# src = pkgs.fetchFromGitHub {
|
|
||||||
# owner = "chisui";
|
|
||||||
# repo = "zsh-nix-shell";
|
|
||||||
# rev = "v0.5.0";
|
|
||||||
# sha256 = "0za4aiwwrlawnia4f29msk822rj9bgcygw6a8a6iikiwzjjz0g91";
|
|
||||||
# };
|
|
||||||
# }
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.starship = {
|
|
||||||
enable = true;
|
|
||||||
enableZshIntegration = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.fzf = {
|
|
||||||
enable = true;
|
|
||||||
enableZshIntegration = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.direnv = {
|
|
||||||
enable = true;
|
|
||||||
enableZshIntegration = true;
|
|
||||||
nix-direnv.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.zoxide = {
|
|
||||||
enable = true;
|
|
||||||
enableZshIntegration = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.kdeconnect.enable = true;
|
|
||||||
|
|
||||||
home.shellAliases = {
|
|
||||||
# quick cd
|
|
||||||
".." = "cd ..";
|
|
||||||
"..." = "cd ../..";
|
|
||||||
"...." = "cd ../../..";
|
|
||||||
"....." = "cd ../../../..";
|
|
||||||
|
|
||||||
icat = "kitty +kitten icat";
|
|
||||||
yt = "ytfzf -T kitty -t ";
|
|
||||||
gen-secret = "< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c\${1:-32};echo;";
|
|
||||||
|
|
||||||
# modern cli tools
|
|
||||||
ls = "eza --icons";
|
|
||||||
l = "esa -l --icons";
|
|
||||||
la = "eza -la --icons";
|
|
||||||
tree = "ls --tree --icons";
|
|
||||||
cat = "bat";
|
|
||||||
unzip = "aunpack";
|
|
||||||
copy = "xclip -selection clipboard";
|
|
||||||
paste = "xclip -selection clipboard -o";
|
|
||||||
rm = "echo USE TRASH, FOOL: trash ";
|
|
||||||
trash = "trash-put";
|
|
||||||
make-secret = "< /dev/urandom \\tr -dc _A-Za-z0-9 | head -c \${1:-32};echo;";
|
|
||||||
|
|
||||||
# task warrior
|
|
||||||
t = "task -BLOCKED -idea -backlog";
|
|
||||||
tw = "t rc.context:work";
|
|
||||||
# TODO find a reasonable way to manage this from a non-nix managed file in ~/.task/context or something
|
|
||||||
# we can do something like task rc.context:$(cat ~/.task/context) to read context
|
|
||||||
# and write a little script make-context = cat $@ > ~/.task/context or something
|
|
||||||
tt = "taskwarrior-tui -r list";
|
|
||||||
ti = "task +idea";
|
|
||||||
tb = "task +backlog list";
|
|
||||||
ttb = "taskwarrior-tui -r backlog";
|
|
||||||
tr = "task newest limit:page";
|
|
||||||
twait = "task +wait";
|
|
||||||
ta = "task add";
|
|
||||||
tai = "task add +idea";
|
|
||||||
tn = "task-note";
|
|
||||||
ts = "task sync";
|
|
||||||
# taskwarrior task lists
|
|
||||||
twt = "task tags +PENDING | tail -n +4 | cut -d ' ' -f1 | fzf --preview 'task +{}'";
|
|
||||||
# task warrior projects list
|
|
||||||
tp = "task projects +PENDING | tail -n +4 | head -n -2 | cut -d ' ' -f1 | fzf --preview 'task pro:{}'";
|
|
||||||
|
|
||||||
# keeping for posterity but now sxhkbd handles screenshot with <Super+O>
|
|
||||||
# scrot = "flameshot screen -c -p ~/screenshots/";
|
|
||||||
# scrotgui = "flameshot gui -p ~/screenshots/";
|
|
||||||
|
|
||||||
# git
|
|
||||||
g = "git";
|
|
||||||
|
|
||||||
# grep
|
|
||||||
grep = "rg";
|
|
||||||
gi = "grep -i";
|
|
||||||
|
|
||||||
# internet ip
|
|
||||||
myip = "dig +short myip.opendns.com @208.67.222.222 2>&1";
|
|
||||||
|
|
||||||
# nix
|
|
||||||
n = "nix";
|
|
||||||
np = "n profile";
|
|
||||||
ni = "np install";
|
|
||||||
nr = "np remove";
|
|
||||||
ns = "n search --no-update-lock-file";
|
|
||||||
nf = "n flake";
|
|
||||||
nfl = "nf lock";
|
|
||||||
nepl = "n repl '<nixpkgs>'";
|
|
||||||
srch = "ns nixpkgs";
|
|
||||||
orch = "ns override";
|
|
||||||
nrb = "cd /tmp; sudo nixos-rebuild switch --flake '/home/anish/usr/helm#curve'; cd $OLDPWD";
|
|
||||||
nrt = "cd /tmp; sudo nixos-rebuild test --flake '/home/anish/usr/helm#curve'; cd $OLDPWD";
|
|
||||||
ned = "cd /home/anish/usr/helm; vim; cd $OLDPWD";
|
|
||||||
ncd = "cd /home/anish/usr/helm";
|
|
||||||
mn = ''
|
|
||||||
manix "" | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | sk --preview="manix '{}'" | xargs manix
|
|
||||||
'';
|
|
||||||
|
|
||||||
# sudo
|
|
||||||
s = "sudo -E ";
|
|
||||||
pls = "s";
|
|
||||||
si = "sudo -i";
|
|
||||||
se = "sudoedit";
|
|
||||||
|
|
||||||
# top
|
|
||||||
top = "btm";
|
|
||||||
|
|
||||||
# systemd
|
|
||||||
ctl = "systemctl";
|
|
||||||
stl = "s systemctl";
|
|
||||||
utl = "systemctl --user";
|
|
||||||
ut = "systemctl --user start";
|
|
||||||
un = "systemctl --user stop";
|
|
||||||
up = "s systemctl start";
|
|
||||||
dn = "s systemctl stop";
|
|
||||||
jtl = "journalctl";
|
|
||||||
|
|
||||||
# quick ssh
|
|
||||||
kssh = "kitty +kitten ssh";
|
|
||||||
smm = "ssh 10.0.69.4"; # box over wireguard
|
|
||||||
sm = "ssh mossnet.lan"; # box regular
|
|
||||||
sl = "ssh sealight.xyz"; # lituus
|
|
||||||
sh = "ssh git.sealight.xyz"; # helix
|
|
||||||
sb = "ssh cyberian@69.61.38.246"; # bonfire for allwell
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,92 +0,0 @@
|
||||||
[aws]
|
|
||||||
symbol = " "
|
|
||||||
|
|
||||||
[character]
|
|
||||||
success_symbol = "[❯](bold purple)"
|
|
||||||
vicmd_symbol = "[❮](bold purple)"
|
|
||||||
|
|
||||||
[battery]
|
|
||||||
full_symbol = " "
|
|
||||||
charging_symbol = " "
|
|
||||||
discharging_symbol = " "
|
|
||||||
|
|
||||||
[conda]
|
|
||||||
symbol = " "
|
|
||||||
|
|
||||||
[directory]
|
|
||||||
style = "cyan"
|
|
||||||
read_only = " 🔒"
|
|
||||||
|
|
||||||
[docker_context]
|
|
||||||
symbol = " "
|
|
||||||
|
|
||||||
[elixir]
|
|
||||||
symbol = " "
|
|
||||||
|
|
||||||
[elm]
|
|
||||||
symbol = " "
|
|
||||||
|
|
||||||
[git_branch]
|
|
||||||
format = "[$symbol$branch]($style) "
|
|
||||||
symbol = " "
|
|
||||||
style = "bold dimmed white"
|
|
||||||
|
|
||||||
[git_status]
|
|
||||||
format = '([「$all_status$ahead_behind」]($style) )'
|
|
||||||
conflicted = "⚠️"
|
|
||||||
ahead = "⟫${count} "
|
|
||||||
behind = "⟪${count}"
|
|
||||||
diverged = "🔀 "
|
|
||||||
untracked = "📁 "
|
|
||||||
stashed = "↪ "
|
|
||||||
modified = "𝚫 "
|
|
||||||
staged = "✔ "
|
|
||||||
renamed = "⇆ "
|
|
||||||
deleted = "✘ "
|
|
||||||
style = "bold bright-white"
|
|
||||||
|
|
||||||
[golang]
|
|
||||||
symbol = " "
|
|
||||||
|
|
||||||
[hg_branch]
|
|
||||||
symbol = " "
|
|
||||||
|
|
||||||
[java]
|
|
||||||
symbol = " "
|
|
||||||
|
|
||||||
[julia]
|
|
||||||
symbol = " "
|
|
||||||
|
|
||||||
[memory_usage]
|
|
||||||
symbol = " "
|
|
||||||
disabled = false
|
|
||||||
|
|
||||||
[nim]
|
|
||||||
symbol = " "
|
|
||||||
|
|
||||||
[nix_shell]
|
|
||||||
format = '[$symbol$state]($style) '
|
|
||||||
symbol = " "
|
|
||||||
pure_msg = "λ"
|
|
||||||
impure_msg = "⎔"
|
|
||||||
|
|
||||||
[nodejs]
|
|
||||||
symbol = " "
|
|
||||||
|
|
||||||
[package]
|
|
||||||
symbol = " "
|
|
||||||
|
|
||||||
[php]
|
|
||||||
symbol = " "
|
|
||||||
|
|
||||||
[python]
|
|
||||||
symbol = " "
|
|
||||||
|
|
||||||
[ruby]
|
|
||||||
symbol = " "
|
|
||||||
|
|
||||||
[rust]
|
|
||||||
symbol = " "
|
|
||||||
|
|
||||||
[status]
|
|
||||||
disabled = false
|
|
|
@ -1,44 +0,0 @@
|
||||||
!
|
|
||||||
! Generated with :
|
|
||||||
! XRDB2Xreources.py
|
|
||||||
!
|
|
||||||
*.foreground: #1F2430
|
|
||||||
*.background: #0f1419
|
|
||||||
*.cursorColor: #f29718
|
|
||||||
!
|
|
||||||
! Black
|
|
||||||
*.color0: #000000
|
|
||||||
*.color8: #323232
|
|
||||||
!
|
|
||||||
! Red
|
|
||||||
*.color1: #ff3333
|
|
||||||
*.color9: #ff6565
|
|
||||||
!
|
|
||||||
! Green
|
|
||||||
*.color2: #b8cc52
|
|
||||||
*.color10: #eafe84
|
|
||||||
!
|
|
||||||
! Yellow
|
|
||||||
*.color3: #e7c547
|
|
||||||
*.color11: #fff779
|
|
||||||
!
|
|
||||||
! Blue
|
|
||||||
*.color4: #36a3d9
|
|
||||||
*.color12: #68d5ff
|
|
||||||
!
|
|
||||||
! Magenta
|
|
||||||
*.color5: #f07178
|
|
||||||
*.color13: #ffa3aa
|
|
||||||
!
|
|
||||||
! Cyan
|
|
||||||
*.color6: #95e6cb
|
|
||||||
*.color14: #c7fffd
|
|
||||||
!
|
|
||||||
! White
|
|
||||||
*.color7: #ffffff
|
|
||||||
*.color15: #ffffff
|
|
||||||
!
|
|
||||||
! Bold, Italic, Underline
|
|
||||||
*.colorBD: #e6e1cf
|
|
||||||
!*.colorIT:
|
|
||||||
!*.colorUL:
|
|
|
@ -1,23 +0,0 @@
|
||||||
|
|
||||||
background #0A0E14
|
|
||||||
foreground #B3B1AD
|
|
||||||
cursor #E6B450
|
|
||||||
selection_background #273747
|
|
||||||
color0 #000000
|
|
||||||
color8 #4D5566
|
|
||||||
color1 #FF3333
|
|
||||||
color9 #D96C75
|
|
||||||
color2 #C2D94C
|
|
||||||
color10 #91B362
|
|
||||||
color3 #FF8F40
|
|
||||||
color11 #F29668
|
|
||||||
color4 #59C2FF
|
|
||||||
color12 #6994BF
|
|
||||||
color5 #D4BFFF
|
|
||||||
color13 #A37ACC
|
|
||||||
color6 #95E6CB
|
|
||||||
color14 #4CBF99
|
|
||||||
color7 #ffffff
|
|
||||||
color15 #F0F0F0
|
|
||||||
selection_foreground #B3B1AD
|
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
#: This is a port of ayu Mirage color scheme
|
|
||||||
#: based on :
|
|
||||||
#: https://github.com/ayu-theme/ayu-colors
|
|
||||||
|
|
||||||
background #1F2430
|
|
||||||
foreground #CBCCC6
|
|
||||||
cursor #FFCC66
|
|
||||||
selection_background #33415E
|
|
||||||
color0 #000000
|
|
||||||
color8 #4D5566
|
|
||||||
color1 #FF3333
|
|
||||||
color9 #F27983
|
|
||||||
color2 #BAE67E
|
|
||||||
color10 #A6CC70
|
|
||||||
color3 #FFA759
|
|
||||||
color11 #F29E74
|
|
||||||
color4 #73D0FF
|
|
||||||
color12 #77A8D9
|
|
||||||
color5 #D4BFFF
|
|
||||||
color13 #A37ACC
|
|
||||||
color6 #95E6CB
|
|
||||||
color14 #4CBF99
|
|
||||||
color7 #ffffff
|
|
||||||
color15 #F0F0F0
|
|
||||||
selection_foreground #CBCCC6
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.8 MiB |
|
@ -1,317 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
# __ _ _ _ _ _ _
|
|
||||||
# _ __ ___ / _(_) | |__ | |_ _ ___| |_ ___ ___ | |_| |__
|
|
||||||
# | '__/ _ \| |_| |_____| '_ \| | | | |/ _ \ __/ _ \ / _ \| __| '_ \
|
|
||||||
# | | | (_) | _| |_____| |_) | | |_| | __/ || (_) | (_) | |_| | | |
|
|
||||||
# |_| \___/|_| |_| |_.__/|_|\__,_|\___|\__\___/ \___/ \__|_| |_|
|
|
||||||
#
|
|
||||||
# Author: Nick Clyde (clydedroid)
|
|
||||||
#
|
|
||||||
# A script that generates a rofi menu that uses bluetoothctl to
|
|
||||||
# connect to bluetooth devices and display status info.
|
|
||||||
#
|
|
||||||
# Inspired by networkmanager-dmenu (https://github.com/firecat53/networkmanager-dmenu)
|
|
||||||
# Thanks to x70b1 (https://github.com/polybar/polybar-scripts/tree/master/polybar-scripts/system-bluetooth-bluetoothctl)
|
|
||||||
#
|
|
||||||
# Depends on:
|
|
||||||
# Arch repositories: rofi, bluez-utils (contains bluetoothctl)
|
|
||||||
|
|
||||||
# Constants
|
|
||||||
divider="---------"
|
|
||||||
goback="Back"
|
|
||||||
|
|
||||||
# Checks if bluetooth controller is powered on
|
|
||||||
power_on() {
|
|
||||||
if bluetoothctl show | grep -q "Powered: yes"; then
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Toggles power state
|
|
||||||
toggle_power() {
|
|
||||||
if power_on; then
|
|
||||||
bluetoothctl power off
|
|
||||||
show_menu
|
|
||||||
else
|
|
||||||
if rfkill list bluetooth | grep -q 'blocked: yes'; then
|
|
||||||
rfkill unblock bluetooth && sleep 3
|
|
||||||
fi
|
|
||||||
bluetoothctl power on
|
|
||||||
show_menu
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Checks if controller is scanning for new devices
|
|
||||||
scan_on() {
|
|
||||||
if bluetoothctl show | grep -q "Discovering: yes"; then
|
|
||||||
echo "Scan: on"
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
echo "Scan: off"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Toggles scanning state
|
|
||||||
toggle_scan() {
|
|
||||||
if scan_on; then
|
|
||||||
kill $(pgrep -f "bluetoothctl scan on")
|
|
||||||
bluetoothctl scan off
|
|
||||||
show_menu
|
|
||||||
else
|
|
||||||
bluetoothctl scan on &
|
|
||||||
echo "Scanning..."
|
|
||||||
sleep 5
|
|
||||||
show_menu
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Checks if controller is able to pair to devices
|
|
||||||
pairable_on() {
|
|
||||||
if bluetoothctl show | grep -q "Pairable: yes"; then
|
|
||||||
echo "Pairable: on"
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
echo "Pairable: off"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Toggles pairable state
|
|
||||||
toggle_pairable() {
|
|
||||||
if pairable_on; then
|
|
||||||
bluetoothctl pairable off
|
|
||||||
show_menu
|
|
||||||
else
|
|
||||||
bluetoothctl pairable on
|
|
||||||
show_menu
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Checks if controller is discoverable by other devices
|
|
||||||
discoverable_on() {
|
|
||||||
if bluetoothctl show | grep -q "Discoverable: yes"; then
|
|
||||||
echo "Discoverable: on"
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
echo "Discoverable: off"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Toggles discoverable state
|
|
||||||
toggle_discoverable() {
|
|
||||||
if discoverable_on; then
|
|
||||||
bluetoothctl discoverable off
|
|
||||||
show_menu
|
|
||||||
else
|
|
||||||
bluetoothctl discoverable on
|
|
||||||
show_menu
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Checks if a device is connected
|
|
||||||
device_connected() {
|
|
||||||
device_info=$(bluetoothctl info "$1")
|
|
||||||
if echo "$device_info" | grep -q "Connected: yes"; then
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Toggles device connection
|
|
||||||
toggle_connection() {
|
|
||||||
if device_connected $1; then
|
|
||||||
bluetoothctl disconnect $1
|
|
||||||
device_menu "$device"
|
|
||||||
else
|
|
||||||
bluetoothctl connect $1
|
|
||||||
device_menu "$device"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Checks if a device is paired
|
|
||||||
device_paired() {
|
|
||||||
device_info=$(bluetoothctl info "$1")
|
|
||||||
if echo "$device_info" | grep -q "Paired: yes"; then
|
|
||||||
echo "Paired: yes"
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
echo "Paired: no"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Toggles device paired state
|
|
||||||
toggle_paired() {
|
|
||||||
if device_paired $1; then
|
|
||||||
bluetoothctl remove $1
|
|
||||||
device_menu "$device"
|
|
||||||
else
|
|
||||||
bluetoothctl pair $1
|
|
||||||
device_menu "$device"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Checks if a device is trusted
|
|
||||||
device_trusted() {
|
|
||||||
device_info=$(bluetoothctl info "$1")
|
|
||||||
if echo "$device_info" | grep -q "Trusted: yes"; then
|
|
||||||
echo "Trusted: yes"
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
echo "Trusted: no"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Toggles device connection
|
|
||||||
toggle_trust() {
|
|
||||||
if device_trusted $1; then
|
|
||||||
bluetoothctl untrust $1
|
|
||||||
device_menu "$device"
|
|
||||||
else
|
|
||||||
bluetoothctl trust $1
|
|
||||||
device_menu "$device"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Prints a short string with the current bluetooth status
|
|
||||||
# Useful for status bars like polybar, etc.
|
|
||||||
print_status() {
|
|
||||||
if power_on; then
|
|
||||||
printf ''
|
|
||||||
|
|
||||||
paired_devices_cmd="devices Paired"
|
|
||||||
# Check if an outdated version of bluetoothctl is used to preserve backwards compatibility
|
|
||||||
if (( $(echo "$(bluetoothctl version | cut -d ' ' -f 2) < 5.65" | bc -l) )); then
|
|
||||||
paired_devices_cmd="paired-devices"
|
|
||||||
fi
|
|
||||||
|
|
||||||
mapfile -t paired_devices < <(bluetoothctl $paired_devices_cmd | grep Device | cut -d ' ' -f 2)
|
|
||||||
counter=0
|
|
||||||
|
|
||||||
for device in "${paired_devices[@]}"; do
|
|
||||||
if device_connected $device; then
|
|
||||||
device_alias=$(bluetoothctl info $device | grep "Alias" | cut -d ' ' -f 2-)
|
|
||||||
|
|
||||||
if [ $counter -gt 0 ]; then
|
|
||||||
printf ", %s" "$device_alias"
|
|
||||||
else
|
|
||||||
printf " %s" "$device_alias"
|
|
||||||
fi
|
|
||||||
|
|
||||||
((counter++))
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
printf "\n"
|
|
||||||
else
|
|
||||||
echo ""
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# A submenu for a specific device that allows connecting, pairing, and trusting
|
|
||||||
device_menu() {
|
|
||||||
device=$1
|
|
||||||
|
|
||||||
# Get device name and mac address
|
|
||||||
device_name=$(echo $device | cut -d ' ' -f 3-)
|
|
||||||
mac=$(echo $device | cut -d ' ' -f 2)
|
|
||||||
|
|
||||||
# Build options
|
|
||||||
if device_connected $mac; then
|
|
||||||
connected="Connected: yes"
|
|
||||||
else
|
|
||||||
connected="Connected: no"
|
|
||||||
fi
|
|
||||||
paired=$(device_paired $mac)
|
|
||||||
trusted=$(device_trusted $mac)
|
|
||||||
options="$connected\n$paired\n$trusted\n$divider\n$goback\nExit"
|
|
||||||
|
|
||||||
# Open rofi menu, read chosen option
|
|
||||||
chosen="$(echo -e "$options" | $rofi_command "$device_name")"
|
|
||||||
|
|
||||||
# Match chosen option to command
|
|
||||||
case $chosen in
|
|
||||||
"" | $divider)
|
|
||||||
echo "No option chosen."
|
|
||||||
;;
|
|
||||||
$connected)
|
|
||||||
toggle_connection $mac
|
|
||||||
;;
|
|
||||||
$paired)
|
|
||||||
toggle_paired $mac
|
|
||||||
;;
|
|
||||||
$trusted)
|
|
||||||
toggle_trust $mac
|
|
||||||
;;
|
|
||||||
$goback)
|
|
||||||
show_menu
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
# Opens a rofi menu with current bluetooth status and options to connect
|
|
||||||
show_menu() {
|
|
||||||
# Get menu options
|
|
||||||
if power_on; then
|
|
||||||
power="Power: on"
|
|
||||||
|
|
||||||
# Human-readable names of devices, one per line
|
|
||||||
# If scan is off, will only list paired devices
|
|
||||||
devices=$(bluetoothctl devices | grep Device | cut -d ' ' -f 3-)
|
|
||||||
|
|
||||||
# Get controller flags
|
|
||||||
scan=$(scan_on)
|
|
||||||
pairable=$(pairable_on)
|
|
||||||
discoverable=$(discoverable_on)
|
|
||||||
|
|
||||||
# Options passed to rofi
|
|
||||||
options="$devices\n$divider\n$power\n$scan\n$pairable\n$discoverable\nExit"
|
|
||||||
else
|
|
||||||
power="Power: off"
|
|
||||||
options="$power\nExit"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Open rofi menu, read chosen option
|
|
||||||
chosen="$(echo -e "$options" | $rofi_command "Bluetooth")"
|
|
||||||
|
|
||||||
# Match chosen option to command
|
|
||||||
case $chosen in
|
|
||||||
"" | $divider)
|
|
||||||
echo "No option chosen."
|
|
||||||
;;
|
|
||||||
$power)
|
|
||||||
toggle_power
|
|
||||||
;;
|
|
||||||
$scan)
|
|
||||||
toggle_scan
|
|
||||||
;;
|
|
||||||
$discoverable)
|
|
||||||
toggle_discoverable
|
|
||||||
;;
|
|
||||||
$pairable)
|
|
||||||
toggle_pairable
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
device=$(bluetoothctl devices | grep "$chosen")
|
|
||||||
# Open a submenu if a device is selected
|
|
||||||
if [[ $device ]]; then device_menu "$device"; fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
# Rofi command to pipe into, can add any options here
|
|
||||||
rofi_command="rofi -theme theme/passmenu.rasi -dmenu -no-fixed-num-lines -yoffset -100 -i -p"
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
--status)
|
|
||||||
print_status
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
show_menu
|
|
||||||
;;
|
|
||||||
esac
|
|
|
@ -1,71 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Get class of a wid
|
|
||||||
get_class() {
|
|
||||||
id=$1
|
|
||||||
if [ -z "$id" ]; then
|
|
||||||
echo ""
|
|
||||||
else
|
|
||||||
xprop -id "$id" | sed -n \
|
|
||||||
-e '/WM_CLASS/s/\( "\)/\n/g; s/[^\n]*\n\([^"]*\)[^\n]*/\1\n/g' \
|
|
||||||
-e '/WM_COMMAND/s/[^"]*/\n\n/1; s/\n"//1; s/\n\([^"]*\)".*/\n\1/; /\n/p' | sed '/^$/d' | head -n1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
get_pid() {
|
|
||||||
xprop _NET_WM_PID -id "$1" | awk '/[0-9]+/ {print $3}'
|
|
||||||
}
|
|
||||||
|
|
||||||
get_ppid() {
|
|
||||||
ps -o ppid= -p $1
|
|
||||||
}
|
|
||||||
|
|
||||||
check_swallowing_process() {
|
|
||||||
pid=$(get_pid $1)
|
|
||||||
[ -z $pid ] && return 0
|
|
||||||
gppid=$(get_ppid $(get_ppid $pid))
|
|
||||||
grep -i "^$(ps -o cmd= -p $gppid | awk '{print $1}' | sed 's_^.*/__')$" ~/.config/bspwm/terminals && return 0
|
|
||||||
[ "$(get_ppid "$(get_ppid "$(get_pid "$1")")")" = "$(get_pid "$2")" ] && return 0 || return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
swallow() {
|
|
||||||
addedtodesktop=$2
|
|
||||||
lasttermdesktop=$(bspc query -D -n last)
|
|
||||||
|
|
||||||
swallowerid=$1
|
|
||||||
swallowingid=$(bspc query -N -n last)
|
|
||||||
if [ "$addedtodesktop" = "$lasttermdesktop" ] && check_swallowing_process "$swallowerid" "$swallowingid"; then
|
|
||||||
grep -q "^$(get_class "$swallowerid")$" ~/.config/bspwm/{noswallow, terminals} && return
|
|
||||||
grep -i "^$(get_class "$swallowingid")$" ~/.config/bspwm/terminals || return
|
|
||||||
echo "$swallowerid $swallowingid" >> /tmp/swallowids
|
|
||||||
bspc node "$swallowingid" --flag hidden=on
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
spit() {
|
|
||||||
spitterid=$1
|
|
||||||
spitterdesktop=$2
|
|
||||||
grep "^$spitterid" /tmp/swallowids || return
|
|
||||||
spittingid=$(grep "^$spitterid" /tmp/swallowids | head -n1 | awk '{print $2}')
|
|
||||||
|
|
||||||
bspc node "$spittingid" --flag hidden=off
|
|
||||||
|
|
||||||
termdesktop=$(bspc query -D -n "$spittingid")
|
|
||||||
[ "$termdesktop" = "$spitterdesktop" ] || bspc node "$spittingid" -d "$spitterdesktop"
|
|
||||||
|
|
||||||
bspc node "$spittingid" -f
|
|
||||||
sed -i "/^$spitterid/d" /tmp/swallowids
|
|
||||||
}
|
|
||||||
|
|
||||||
bspc subscribe node_add node_remove | while read -r event
|
|
||||||
do
|
|
||||||
case $(echo "$event" | awk '{ print $1 }') in
|
|
||||||
node_add)
|
|
||||||
swallow $(echo "$event" | awk '{print $5 " " $3}')
|
|
||||||
;;
|
|
||||||
node_remove)
|
|
||||||
spit $(echo "$event" | awk '{print $4 " " $3}')
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
#! /usr/bin/env bash
|
|
||||||
|
|
||||||
connect() {
|
|
||||||
xrandr --output HDMI-2 --same-as eDP-1
|
|
||||||
}
|
|
||||||
|
|
||||||
disconnect() {
|
|
||||||
xrandr --output HDMI-2 --off
|
|
||||||
}
|
|
||||||
|
|
||||||
xrandr | grep "HDMI-2 connected" &>>/dev/null && connect || disconnect
|
|
|
@ -1,15 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# get into a shell that has poonam
|
|
||||||
cd ~/kitaab || exit;
|
|
||||||
nix develop;
|
|
||||||
# Use fzf to select a file and capture the output
|
|
||||||
selected_file=$(${pkgs.poonam}/main report --titles=false | head -n -2 | fzf --preview 'bat --color=always --terminal-width -1 ./vimwiki/{}')
|
|
||||||
echo $selected_file
|
|
||||||
|
|
||||||
# Add additional details to the file path
|
|
||||||
# file_path="./vimwiki/${selected_file}"
|
|
||||||
#
|
|
||||||
# # Open the file in vim for editing
|
|
||||||
# vim "${file_path}"
|
|
||||||
#
|
|
|
@ -1,3 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
URL="$(xclip -selection clipboard -o)"
|
|
||||||
mpv $URL
|
|
|
@ -1 +0,0 @@
|
||||||
curl -F "content=$(xclip -o)" -X POST https://bin.sealight.xyz/upload
|
|
|
@ -1,31 +0,0 @@
|
||||||
#!/usr/bin/env sh
|
|
||||||
|
|
||||||
rofi_command="rofi -theme theme/powermenu.rasi"
|
|
||||||
|
|
||||||
### Options ###
|
|
||||||
power_off="\tShutdown"
|
|
||||||
reboot="\tReboot"
|
|
||||||
lock="\tLock"
|
|
||||||
suspend="\tSleep"
|
|
||||||
log_out="\tLogout"
|
|
||||||
# Variable passed to rofi
|
|
||||||
options="$power_off\n$reboot\n$lock\n$suspend\n$log_out"
|
|
||||||
|
|
||||||
case "$(echo -e "$options" | $rofi_command -dmenu)" in
|
|
||||||
" Shutdown")
|
|
||||||
systemctl poweroff
|
|
||||||
;;
|
|
||||||
" Reboot")
|
|
||||||
systemctl reboot
|
|
||||||
;;
|
|
||||||
" Lock")
|
|
||||||
dm-tool lock
|
|
||||||
;;
|
|
||||||
" Sleep")
|
|
||||||
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause
|
|
||||||
systemctl suspend
|
|
||||||
;;
|
|
||||||
" Logout")
|
|
||||||
bspc quit
|
|
||||||
;;
|
|
||||||
esac
|
|
|
@ -1,56 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
timer=5
|
|
||||||
|
|
||||||
# Options
|
|
||||||
select=" "
|
|
||||||
window=" "
|
|
||||||
screen=" "
|
|
||||||
record=" "
|
|
||||||
delay=" "
|
|
||||||
cancel=" "
|
|
||||||
|
|
||||||
# Variable passed to rofi
|
|
||||||
options="$select\n$window\n$screen\n$delay\n$cancel"
|
|
||||||
|
|
||||||
rofi_command="rofi -theme theme/screenshotmenu.rasi"
|
|
||||||
|
|
||||||
setFilename() {
|
|
||||||
directory="/tmp/"
|
|
||||||
filename="IMG_$(date +%Y%m%d_%H%M%S).jpg"
|
|
||||||
filepath=$directory$filename
|
|
||||||
}
|
|
||||||
|
|
||||||
notify() {
|
|
||||||
dunstify "Screenshot saved and copied to clipboard" -i accessories-screenshot
|
|
||||||
}
|
|
||||||
|
|
||||||
chosen="$(echo -e "$options" | $rofi_command -dmenu)"
|
|
||||||
case $chosen in
|
|
||||||
$select)
|
|
||||||
setFilename
|
|
||||||
maim -Buosd 0.25 \
|
|
||||||
| tee $filepath | xclip -selection c -t image/png
|
|
||||||
notify
|
|
||||||
;;
|
|
||||||
$window)
|
|
||||||
setFilename
|
|
||||||
maim -Buod 0.25 -i $(xdotool getactivewindow) \
|
|
||||||
| tee $filepath | xclip -selection c -t image/png
|
|
||||||
notify
|
|
||||||
;;
|
|
||||||
$screen)
|
|
||||||
setFilename
|
|
||||||
maim -Buod 0.25 \
|
|
||||||
| tee $filepath | xclip -selection c -t image/png
|
|
||||||
notify
|
|
||||||
;;
|
|
||||||
$delay)
|
|
||||||
setFilename
|
|
||||||
maim -Buod $timer \
|
|
||||||
| tee $filepath | xclip -selection c -t image/png
|
|
||||||
notify
|
|
||||||
;;
|
|
||||||
$record)
|
|
||||||
kooha
|
|
||||||
esac
|
|
|
@ -1,115 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# rofi config without entry so to make select from available options only
|
|
||||||
rofiprompt=theme/passmenu.rasi
|
|
||||||
# normal rofi menu
|
|
||||||
rofidmenu=theme/passmenu.rasi
|
|
||||||
# rofi config for password
|
|
||||||
rofipass=theme/passmenu.rasi
|
|
||||||
|
|
||||||
# Power Status
|
|
||||||
flag=$(cat /sys/class/net/wl*/flags)
|
|
||||||
|
|
||||||
if [ "$flag" = "0x1003" ]; then
|
|
||||||
power="On"
|
|
||||||
else
|
|
||||||
power="Off"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Connection Status
|
|
||||||
state=$(cat /sys/class/net/wl*/operstate)
|
|
||||||
|
|
||||||
if [ "$state" = "up" ]; then
|
|
||||||
status=$(nmcli | grep "^wlp" | sed 's/\ connected\ to/Connected to/' | cut -d ':' -f2)
|
|
||||||
else
|
|
||||||
status="Disconnected"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ┌─┐┌─┐┬ ┬┌─┐┬─┐
|
|
||||||
# ├─┘│ ││││├┤ ├┬┘
|
|
||||||
# ┴ └─┘└┴┘└─┘┴└─
|
|
||||||
|
|
||||||
powertoggle=$( [ "$flag" = "0x1003" ] && echo "Power Off" || echo "Power On" )
|
|
||||||
|
|
||||||
powerswitch() {
|
|
||||||
if [ "$powertoggle" = "Power Off" ]; then
|
|
||||||
nmcli radio wifi off
|
|
||||||
elif [ "$powertoggle" = "Power On" ]; then
|
|
||||||
nmcli radio wifi on
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# ┌─┐┌─┐┌┐┌┌┐┌┌─┐┌─┐┌┬┐
|
|
||||||
# │ │ │││││││├┤ │ │
|
|
||||||
# └─┘└─┘┘└┘┘└┘└─┘└─┘ ┴
|
|
||||||
|
|
||||||
connections() {
|
|
||||||
list=$(nmcli --fields "SECURITY,SSID" device wifi list | tail -n +2 | sed "s/ */ /g" | sed -E "s/WPA*.?//g" | sed "s/^--//g" | sed "s/ //g")
|
|
||||||
networks=$(printf "$list" | rofi -theme $rofiprompt -dmenu -i -hover-select -p "Select Wifi Network
|
|
||||||
$status")
|
|
||||||
wifi=$( echo "$networks" | sed "s/ //g" | sed "s/ //g" | xargs)
|
|
||||||
[ -z "$networks" ] && exit
|
|
||||||
nopass="No Password"
|
|
||||||
pass=$(printf "$nopass\nCancel" | rofi -theme $rofipass -dmenu -i -hover-select -password -p "Wifi Password")
|
|
||||||
|
|
||||||
if [ "$pass" = "" ]; then
|
|
||||||
exit
|
|
||||||
elif [ "$pass" = "$nopass" ]; then
|
|
||||||
nmcli dev wifi con "$wifi" && printf "exit" | rofi -theme $rofiprompt -dmenu -only-match -i -p "Successfully Connected to $wifi" && exit
|
|
||||||
elif [ "$pass" = "Cancel" ]; then
|
|
||||||
exit
|
|
||||||
else
|
|
||||||
nmcli dev wifi con "$wifi" password "$pass" && printf "exit" | rofi -theme $rofiprompt -dmenu -i -only-match -p "Successfully Connected to $wifi" && exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf "exit" | rofi -theme $rofiprompt -dmenu -i -p -only-match "Failed to Connect $wifi" && exit
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# ┌┬┐┌─┐┌┐┌┬ ┬┌─┐┬
|
|
||||||
# │││├─┤││││ │├─┤│
|
|
||||||
# ┴ ┴┴ ┴┘└┘└─┘┴ ┴┴─┘
|
|
||||||
|
|
||||||
manual() {
|
|
||||||
|
|
||||||
wifi=$(rofi -theme $rofidmenu -dmenu -i -p "Enter Wifi Name")
|
|
||||||
|
|
||||||
[ -z "$wifi" ] && exit
|
|
||||||
nopass="Run Without Password"
|
|
||||||
pass=$(printf "$nopass\nCancel" | rofi -theme $rofipass -dmenu -i -password -p "Wifi Password")
|
|
||||||
|
|
||||||
if [ "$pass" = "" ]; then
|
|
||||||
exit
|
|
||||||
elif [ "$pass" = "$nopass" ]; then
|
|
||||||
nmcli dev wifi con "$wifi" && printf "exit" | rofi -theme $rofiprompt -dmenu -i -only-match -p "Successfully Connected to $wifi" && exit
|
|
||||||
elif [ "$pass" = "Cancel" ]; then
|
|
||||||
exit
|
|
||||||
else
|
|
||||||
nmcli dev wifi con "$wifi" password "$pass" && printf "exit" | rofi -theme $rofiprompt -dmenu -i -only-match -p "Successfully Connected to $wifi" && exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf "exit" | rofi -theme $rofiprompt -dmenu -only-match -i -p "Failed to Connect $wifi" && exit
|
|
||||||
}
|
|
||||||
|
|
||||||
# ┌─┐┌─┐┌┬┐┬┌─┐┌┐┌┌─┐
|
|
||||||
# │ │├─┘ │ ││ ││││└─┐
|
|
||||||
# └─┘┴ ┴ ┴└─┘┘└┘└─┘
|
|
||||||
|
|
||||||
options="$powertoggle\nConnections\nConnect Manually"
|
|
||||||
|
|
||||||
rofiwifi=$(printf "$options" | rofi -theme $rofiprompt -dmenu -i -hover-select -p "Wifi
|
|
||||||
Powered: $power
|
|
||||||
Status: $status")
|
|
||||||
|
|
||||||
case $rofiwifi in
|
|
||||||
$powertoggle)
|
|
||||||
powerswitch
|
|
||||||
;;
|
|
||||||
Connections)
|
|
||||||
notify-send "Scanning"
|
|
||||||
connections
|
|
||||||
;;
|
|
||||||
"Connect Manually")
|
|
||||||
manual
|
|
||||||
esac 2>/dev/null
|
|
||||||
|
|
|
@ -1,48 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# case $HOSTNAME in
|
|
||||||
# kuro) export LAN=eno1 ;;
|
|
||||||
# shiro) export LAN=wlp3s0 ;;
|
|
||||||
# esac
|
|
||||||
|
|
||||||
export MONITOR=$(xrandr -q | grep primary | cut -d' ' -f1)
|
|
||||||
export MONITORS=( $(xrandr -q | grep ' connected' | cut -d' ' -f1) )
|
|
||||||
MONITOR=${MONITOR:-${MONITORS[0]}}
|
|
||||||
|
|
||||||
# Only have workspaces for primary monitor
|
|
||||||
bspc monitor $MONITOR -d {1,2,3,4,5}
|
|
||||||
|
|
||||||
bspc config remove_disabled_monitors true
|
|
||||||
bspc config remove_unplugged_monitors true
|
|
||||||
|
|
||||||
bspc config borderless_monocle true
|
|
||||||
bspc config gapless_monocle true
|
|
||||||
|
|
||||||
bspc config border_width 1
|
|
||||||
bspc config window_gap 4
|
|
||||||
|
|
||||||
bspc config normal_border_color "#181a23"
|
|
||||||
bspc config active_border_color "#181a23"
|
|
||||||
bspc config focused_border_color "#bd93f9"
|
|
||||||
bspc config presel_feedback_color "#bd93f9"
|
|
||||||
|
|
||||||
bspc config split_ratio 0.71
|
|
||||||
|
|
||||||
# Extra padding for polybar
|
|
||||||
bspc config -m primary top_padding 34
|
|
||||||
bspc config -m primary bottom_padding 0
|
|
||||||
|
|
||||||
# Rules
|
|
||||||
bspc rule -r '*'
|
|
||||||
|
|
||||||
bspc rule -a Pinentry state=floating center=on
|
|
||||||
bspc rule -a Firefox state=fullscreen
|
|
||||||
bspc rule -a feh state=fullscreen
|
|
||||||
|
|
||||||
# bspswallow
|
|
||||||
pgrep bspswallow || bspswallow &
|
|
||||||
|
|
||||||
# polybar
|
|
||||||
for file in "$XDG_CONFIG_HOME"/bspwm/rc.d/*; do
|
|
||||||
source "$file"
|
|
||||||
done
|
|
|
@ -1,191 +0,0 @@
|
||||||
{ pkgs, config, lib, ... }:
|
|
||||||
let
|
|
||||||
dracula-gtk = pkgs.fetchFromGitHub {
|
|
||||||
owner = "dracula";
|
|
||||||
repo = "gtk";
|
|
||||||
rev = "502f212d83bc67e8f0499574546b99ec6c8e16f9";
|
|
||||||
sha256 = "1wx9nzq7cqyvpaq4j60bs8g7gh4jk8qg4016yi4c331l4iw1ymsa";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
home.pointerCursor = {
|
|
||||||
x11.enable = true;
|
|
||||||
x11.defaultCursor = "left_ptr";
|
|
||||||
package = pkgs.capitaine-cursors;
|
|
||||||
name = "capitaine-cursors";
|
|
||||||
};
|
|
||||||
# Install themes
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
ayu-theme-gtk
|
|
||||||
dracula-theme
|
|
||||||
capitaine-cursors
|
|
||||||
paper-icon-theme
|
|
||||||
papirus-icon-theme
|
|
||||||
libsForQt5.qtstyleplugin-kvantum
|
|
||||||
qt5ct
|
|
||||||
gtk-engine-murrine
|
|
||||||
gtk_engines
|
|
||||||
maim
|
|
||||||
kitty
|
|
||||||
libreoffice
|
|
||||||
inotify-tools
|
|
||||||
offpunk
|
|
||||||
termpdfpy
|
|
||||||
libsForQt5.kontact
|
|
||||||
thunderbird
|
|
||||||
];
|
|
||||||
|
|
||||||
# GTK4 color scheme?
|
|
||||||
dconf.settings = {
|
|
||||||
"org/gnome/desktop/interface" = {
|
|
||||||
color-scheme = "prefer-dark";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Move required config files around
|
|
||||||
xdg.enable = true; # This doesn't seem to do anything so we have below
|
|
||||||
xdg.configHome = "/home/anish/.config"; # TODO bad hardcode
|
|
||||||
xdg.configFile = {
|
|
||||||
"Kvantum/Dracula/Dracula.kvconfig".source = "${dracula-gtk}/kde/kvantum/Dracula-purple-solid/Dracula-purple-solid.kvconfig";
|
|
||||||
"Kvantum/Dracula/Dracula.svg".source = "${dracula-gtk}/kde/kvantum/Dracula-purple-solid/Dracula-purple-solid.svg";
|
|
||||||
"Kvantum/kvantum.kvconfig".text = "[General]\ntheme=Dracula";
|
|
||||||
};
|
|
||||||
xdg.mimeApps.defaultApplications = {
|
|
||||||
|
|
||||||
};
|
|
||||||
home.file = {
|
|
||||||
".config/bspwm/rc.d/polybar".source = ./run.sh;
|
|
||||||
".config/bspwm/bspwmrc".source = ./bspwmrc;
|
|
||||||
".config/sxhkdrc".source = ./sxhkdrc;
|
|
||||||
".config/rofi/theme" = {
|
|
||||||
source = ./rofi;
|
|
||||||
recursive = true;
|
|
||||||
};
|
|
||||||
".config/polybar" = {
|
|
||||||
source = ./polybar;
|
|
||||||
recursive = true;
|
|
||||||
};
|
|
||||||
".config/dunst/dunstrc".source = ./dunstrc;
|
|
||||||
".config/kitty/kitty.conf".source = ./kitty.conf;
|
|
||||||
".config/kitty/ayu.conf".source = ./ayu-kitty.conf;
|
|
||||||
".config/zathura/zathurarc".source = ./zathurarc;
|
|
||||||
".background-image".source = ./background.jpg;
|
|
||||||
#gtk4 theme
|
|
||||||
".config/gtk-4.0/settings.ini".text = ''
|
|
||||||
[Settings]
|
|
||||||
gtk-application-prefer-dark-theme=1
|
|
||||||
'';
|
|
||||||
# gtk3 theme
|
|
||||||
".config/gtk-3.0/settings.ini".text = ''
|
|
||||||
[Settings]
|
|
||||||
gtk-theme-name=Dracula
|
|
||||||
gtk-icon-theme-name=Paper
|
|
||||||
gtk-cursor-theme-name=Capitaine Cursors - White
|
|
||||||
gtk-fallback-icon-theme=gnome
|
|
||||||
gtk-application-prefer-dark-theme=1
|
|
||||||
gtk-xft-hinting=1
|
|
||||||
gtk-xft-hintstyle=hintfull
|
|
||||||
gtk-xft-rgba=none
|
|
||||||
'';
|
|
||||||
# GTK2 global theme (widget and icon theme)
|
|
||||||
".config/gtk-2.0/gtkrc".text = ''
|
|
||||||
gtk-theme-name=Ayu-Mirage
|
|
||||||
gtk-icon-theme-name=Capitaine Cursors - White
|
|
||||||
gtk-font-name="Sans 10"
|
|
||||||
'';
|
|
||||||
".local/bin/passmenu".source = ./bin/passmenu;
|
|
||||||
".local/bin/paste".source = ./bin/paste;
|
|
||||||
".local/bin/bluetoothmenu".source = ./bin/bluetoothmenu;
|
|
||||||
".local/bin/wifimenu".source = ./bin/wifimenu;
|
|
||||||
".local/bin/powermenu".source = ./bin/powermenu;
|
|
||||||
".local/bin/screenshot".source = ./bin/screenshot;
|
|
||||||
".local/bin/mpv-ify".source = ./bin/mpv-ify;
|
|
||||||
".local/bin/bspswallow".source = ./bin/bspswallow;
|
|
||||||
".config/bspwm/terminals".text = "Kitty";
|
|
||||||
# ".local/bin/hotplug-monitor.sh".source = ./bin/hotplug-monitor.sh;
|
|
||||||
};
|
|
||||||
|
|
||||||
xdg.desktopEntries = {
|
|
||||||
ocr = {
|
|
||||||
name = "OCR image";
|
|
||||||
exec = "${pkgs.writeScript "ocr" ''
|
|
||||||
${pkgs.xfce.xfce4-screenshooter}/bin/xfce4-screenshooter -r --save /tmp/ocr-tmp.png
|
|
||||||
${pkgs.tesseract}/bin/tesseract /tmp/ocr-tmp.png | ${pkgs.xclip}/bin/xclip -sel clip
|
|
||||||
rm /tmp/ocr-tmp.png
|
|
||||||
''}";
|
|
||||||
};
|
|
||||||
screenshot = {
|
|
||||||
name = "Screenshot";
|
|
||||||
exec = "screenshot";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
qt = {
|
|
||||||
enable = true;
|
|
||||||
platformTheme.name = "gtk";
|
|
||||||
style = { name = "qt5ct-style"; };
|
|
||||||
};
|
|
||||||
|
|
||||||
# set up env
|
|
||||||
xsession.enable = true;
|
|
||||||
|
|
||||||
xresources.properties = {
|
|
||||||
"*.foreground" = "#95E6CB";
|
|
||||||
"*.background" = "#1F2430";
|
|
||||||
"*.cursorColor" = "#BAE67E";
|
|
||||||
# Black
|
|
||||||
"*.color0" = "#1F2430";
|
|
||||||
"*.color8" = "#F28779";
|
|
||||||
# Red
|
|
||||||
"*.color1" = "#A6CC70";
|
|
||||||
"*.color9" = "#FFCC66";
|
|
||||||
# Green
|
|
||||||
"*.color2" = "#5CCFE6";
|
|
||||||
"*.color10" = "#F29E74";
|
|
||||||
# Yellow
|
|
||||||
"*.color3" = "#77A8D9";
|
|
||||||
"*.color11" = "#5C6773";
|
|
||||||
# Blue
|
|
||||||
"*.color4" = "#707A8C";
|
|
||||||
"*.color12" = "#F27983";
|
|
||||||
# Magenta
|
|
||||||
"*.color5" = "#BAE67E";
|
|
||||||
"*.color13" = "#FFD580";
|
|
||||||
# Cyan
|
|
||||||
"*.color6" = "#73D0FF";
|
|
||||||
"*.color14" = "#FFA759";
|
|
||||||
# White
|
|
||||||
"*.color7" = "#95E6CB";
|
|
||||||
"*.color15" = "#CBCCC6";
|
|
||||||
# Bold, Italic, Underline
|
|
||||||
"*.colorBD" = "#e6e1cf";
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.autorandr.enable = true;
|
|
||||||
services.udiskie.automount = true;
|
|
||||||
|
|
||||||
services.mpris-proxy.enable = true; # bluetooth media control
|
|
||||||
|
|
||||||
# Compositor
|
|
||||||
# services.picom = {
|
|
||||||
# enable = true;
|
|
||||||
# fade = true;
|
|
||||||
# fadeDelta = 1;
|
|
||||||
# fadeSteps = [ "0.01" "0.022" ];
|
|
||||||
# shadow = true;
|
|
||||||
# shadowOffsets = [ (-10) (-10) ];
|
|
||||||
# shadowOpacity = "0.22";
|
|
||||||
# # activeOpacity = "1.00";
|
|
||||||
# # inactiveOpacity = "0.92";
|
|
||||||
# extraOptions = ''
|
|
||||||
# shadow-radius = 12;
|
|
||||||
# # blur-background = true;
|
|
||||||
# # blur-background-frame = true;
|
|
||||||
# # blur-background-fixed = true;
|
|
||||||
# blur-kern = "7x7box";
|
|
||||||
# blur-strength = 320;
|
|
||||||
# corner-radius = 3
|
|
||||||
# '';
|
|
||||||
# };
|
|
||||||
}
|
|
|
@ -1,443 +0,0 @@
|
||||||
# vim: ft=cfg
|
|
||||||
|
|
||||||
# See dunst(5) for all configuration options
|
|
||||||
|
|
||||||
[global]
|
|
||||||
### Display ###
|
|
||||||
|
|
||||||
# Which monitor should the notifications be displayed on.
|
|
||||||
monitor = 0
|
|
||||||
|
|
||||||
# Display notification on focused monitor. Possible modes are:
|
|
||||||
# mouse: follow mouse pointer
|
|
||||||
# keyboard: follow window with keyboard focus
|
|
||||||
# none: don't follow anything
|
|
||||||
#
|
|
||||||
# "keyboard" needs a window manager that exports the
|
|
||||||
# _NET_ACTIVE_WINDOW property.
|
|
||||||
# This should be the case for almost all modern window managers.
|
|
||||||
#
|
|
||||||
# If this option is set to mouse or keyboard, the monitor option
|
|
||||||
# will be ignored.
|
|
||||||
follow = none
|
|
||||||
|
|
||||||
### Geometry ###
|
|
||||||
|
|
||||||
# dynamic width from 0 to 300
|
|
||||||
# width = (0, 300)
|
|
||||||
# constant width of 300
|
|
||||||
width = (160, 320)
|
|
||||||
|
|
||||||
# The maximum height of a single notification, excluding the frame.
|
|
||||||
height = 400
|
|
||||||
|
|
||||||
# Position the notification in the top right corner
|
|
||||||
origin = top-right
|
|
||||||
|
|
||||||
# Offset from the origin
|
|
||||||
offset = 12x36
|
|
||||||
|
|
||||||
# Scale factor. It is auto-detected if value is 0.
|
|
||||||
scale = 0
|
|
||||||
|
|
||||||
# Maximum number of notification (0 means no limit)
|
|
||||||
notification_limit = 5
|
|
||||||
|
|
||||||
### Progress bar ###
|
|
||||||
|
|
||||||
# Turn on the progess bar. It appears when a progress hint is passed with
|
|
||||||
# for example dunstify -h int:value:12
|
|
||||||
progress_bar = true
|
|
||||||
|
|
||||||
# Set the progress bar height. This includes the frame, so make sure
|
|
||||||
# it's at least twice as big as the frame width.
|
|
||||||
progress_bar_height = 2
|
|
||||||
|
|
||||||
# Set the frame width of the progress bar
|
|
||||||
progress_bar_frame_width = 0
|
|
||||||
|
|
||||||
# Set the minimum width for the progress bar
|
|
||||||
progress_bar_min_width = 160
|
|
||||||
|
|
||||||
# Set the maximum width for the progress bar
|
|
||||||
progress_bar_max_width = 320
|
|
||||||
|
|
||||||
|
|
||||||
# Show how many messages are currently hidden (because of
|
|
||||||
# notification_limit).
|
|
||||||
indicate_hidden = yes
|
|
||||||
|
|
||||||
# The transparency of the window. Range: [0; 100].
|
|
||||||
# This option will only work if a compositing window manager is
|
|
||||||
# present (e.g. xcompmgr, compiz, etc.). (X11 only)
|
|
||||||
transparency = 0
|
|
||||||
|
|
||||||
# Draw a line of "separator_height" pixel height between two
|
|
||||||
# notifications.
|
|
||||||
# Set to 0 to disable.
|
|
||||||
separator_height = 1
|
|
||||||
|
|
||||||
# Padding between text and separator.
|
|
||||||
padding = 8
|
|
||||||
|
|
||||||
# Horizontal padding.
|
|
||||||
horizontal_padding = 8
|
|
||||||
|
|
||||||
# Padding between text and icon.
|
|
||||||
text_icon_padding = 8
|
|
||||||
|
|
||||||
# Defines width in pixels of frame around the notification window.
|
|
||||||
# Set to 0 to disable.
|
|
||||||
frame_width = 1
|
|
||||||
|
|
||||||
# Defines color of the frame around the notification window.
|
|
||||||
frame_color = "#414868"
|
|
||||||
|
|
||||||
# Define a color for the separator.
|
|
||||||
# possible values are:
|
|
||||||
# * auto: dunst tries to find a color fitting to the background;
|
|
||||||
# * foreground: use the same color as the foreground;
|
|
||||||
# * frame: use the same color as the frame;
|
|
||||||
# * anything else will be interpreted as a X color.
|
|
||||||
separator_color = frame
|
|
||||||
|
|
||||||
# Sort messages by urgency.
|
|
||||||
sort = yes
|
|
||||||
|
|
||||||
# Don't remove messages, if the user is idle (no mouse or keyboard input)
|
|
||||||
# for longer than idle_threshold seconds.
|
|
||||||
# Set to 0 to disable.
|
|
||||||
# A client can set the 'transient' hint to bypass this. See the rules
|
|
||||||
# section for how to disable this if necessary
|
|
||||||
# idle_threshold = 120
|
|
||||||
|
|
||||||
### Text ###
|
|
||||||
|
|
||||||
font = Iosevka Nerd Font 10
|
|
||||||
|
|
||||||
# The spacing between lines. If the height is smaller than the
|
|
||||||
# font height, it will get raised to the font height.
|
|
||||||
line_height = 0
|
|
||||||
|
|
||||||
# Possible values are:
|
|
||||||
# full: Allow a small subset of html markup in notifications:
|
|
||||||
# <b>bold</b>
|
|
||||||
# <i>italic</i>
|
|
||||||
# <s>strikethrough</s>
|
|
||||||
# <u>underline</u>
|
|
||||||
#
|
|
||||||
# For a complete reference see
|
|
||||||
# <https://docs.gtk.org/Pango/pango_markup.html>.
|
|
||||||
#
|
|
||||||
# strip: This setting is provided for compatibility with some broken
|
|
||||||
# clients that send markup even though it's not enabled on the
|
|
||||||
# server. Dunst will try to strip the markup but the parsing is
|
|
||||||
# simplistic so using this option outside of matching rules for
|
|
||||||
# specific applications *IS GREATLY DISCOURAGED*.
|
|
||||||
#
|
|
||||||
# no: Disable markup parsing, incoming notifications will be treated as
|
|
||||||
# plain text. Dunst will not advertise that it has the body-markup
|
|
||||||
# capability if this is set as a global setting.
|
|
||||||
#
|
|
||||||
# It's important to note that markup inside the format option will be parsed
|
|
||||||
# regardless of what this is set to.
|
|
||||||
markup = full
|
|
||||||
|
|
||||||
# The format of the message. Possible variables are:
|
|
||||||
# %a appname
|
|
||||||
# %s summary
|
|
||||||
# %b body
|
|
||||||
# %i iconname (including its path)
|
|
||||||
# %I iconname (without its path)
|
|
||||||
# %p progress value if set ([ 0%] to [100%]) or nothing
|
|
||||||
# %n progress value if set without any extra characters
|
|
||||||
# %% Literal %
|
|
||||||
# Markup is allowed
|
|
||||||
format = "<b>%s</b>\n%b"
|
|
||||||
|
|
||||||
# Alignment of message text.
|
|
||||||
# Possible values are "left", "center" and "right".
|
|
||||||
alignment = left
|
|
||||||
|
|
||||||
# Vertical alignment of message text and icon.
|
|
||||||
# Possible values are "top", "center" and "bottom".
|
|
||||||
vertical_alignment = top
|
|
||||||
|
|
||||||
# Show age of message if message is older than show_age_threshold
|
|
||||||
# seconds.
|
|
||||||
# Set to -1 to disable.
|
|
||||||
show_age_threshold = -1
|
|
||||||
|
|
||||||
# Specify where to make an ellipsis in long lines.
|
|
||||||
# Possible values are "start", "middle" and "end".
|
|
||||||
ellipsize = end
|
|
||||||
|
|
||||||
# Ignore newlines '\n' in notifications.
|
|
||||||
ignore_newline = no
|
|
||||||
|
|
||||||
# Stack together notifications with the same content
|
|
||||||
stack_duplicates = true
|
|
||||||
|
|
||||||
# Hide the count of stacked notifications with the same content
|
|
||||||
hide_duplicate_count = true
|
|
||||||
|
|
||||||
# Display indicators for URLs (U) and actions (A).
|
|
||||||
show_indicators = no
|
|
||||||
|
|
||||||
### Icons ###
|
|
||||||
|
|
||||||
# Align icons left/right/off
|
|
||||||
icon_position = left
|
|
||||||
|
|
||||||
# Scale small icons up to this size, set to 0 to disable. Helpful
|
|
||||||
# for e.g. small files or high-dpi screens. In case of conflict,
|
|
||||||
# max_icon_size takes precedence over this.
|
|
||||||
min_icon_size = 0
|
|
||||||
|
|
||||||
# Scale larger icons down to this size, set to 0 to disable
|
|
||||||
max_icon_size = 160
|
|
||||||
|
|
||||||
# Paths to default icons.
|
|
||||||
icon_path = /usr/share/icons/kora/status/symbolic/:/usr/share/icons/kora/status/scalable/:/usr/share/icons/kora/apps/scalable/:/usr/share/icons/kora/mimes/scalable/:/usr/share/icons/kora/devices/scalable:/usr/share/icons/kora/places/scalable
|
|
||||||
|
|
||||||
### History ###
|
|
||||||
|
|
||||||
# Should a notification popped up from history be sticky or timeout
|
|
||||||
# as if it would normally do.
|
|
||||||
sticky_history = no
|
|
||||||
|
|
||||||
# Maximum amount of notifications kept in history
|
|
||||||
history_length = 8
|
|
||||||
|
|
||||||
### Misc/Advanced ###
|
|
||||||
|
|
||||||
# dmenu path.
|
|
||||||
dmenu = /usr/bin/dmenu -p dunst
|
|
||||||
|
|
||||||
# Browser for opening urls in context menu.
|
|
||||||
browser = /usr/bin/xdg-open
|
|
||||||
|
|
||||||
# Always run rule-defined scripts, even if the notification is suppressed
|
|
||||||
always_run_script = true
|
|
||||||
|
|
||||||
# Define the title of the windows spawned by dunst
|
|
||||||
title = dunst
|
|
||||||
|
|
||||||
# Define the class of the windows spawned by dunst
|
|
||||||
class = dunst
|
|
||||||
|
|
||||||
# Define the corner radius of the notification window
|
|
||||||
# in pixel size. If the radius is 0, you have no rounded
|
|
||||||
# corners.
|
|
||||||
# The radius will be automatically lowered if it exceeds half of the
|
|
||||||
# notification height to avoid clipping text and/or icons.
|
|
||||||
corner_radius = 0
|
|
||||||
|
|
||||||
# Ignore the dbus closeNotification message.
|
|
||||||
# Useful to enforce the timeout set by dunst configuration. Without this
|
|
||||||
# parameter, an application may close the notification sent before the
|
|
||||||
# user defined timeout.
|
|
||||||
ignore_dbusclose = false
|
|
||||||
|
|
||||||
### Wayland ###
|
|
||||||
# These settings are Wayland-specific. They have no effect when using X11
|
|
||||||
|
|
||||||
# Uncomment this if you want to let notications appear under fullscreen
|
|
||||||
# applications (default: overlay)
|
|
||||||
# layer = top
|
|
||||||
|
|
||||||
# Set this to true to use X11 output on Wayland.
|
|
||||||
force_xwayland = false
|
|
||||||
|
|
||||||
### Legacy
|
|
||||||
|
|
||||||
# Use the Xinerama extension instead of RandR for multi-monitor support.
|
|
||||||
# This setting is provided for compatibility with older nVidia drivers that
|
|
||||||
# do not support RandR and using it on systems that support RandR is highly
|
|
||||||
# discouraged.
|
|
||||||
#
|
|
||||||
# By enabling this setting dunst will not be able to detect when a monitor
|
|
||||||
# is connected or disconnected which might break follow mode if the screen
|
|
||||||
# layout changes.
|
|
||||||
force_xinerama = false
|
|
||||||
|
|
||||||
### mouse
|
|
||||||
|
|
||||||
# Defines list of actions for each mouse event
|
|
||||||
# Possible values are:
|
|
||||||
# * none: Don't do anything.
|
|
||||||
# * do_action: Invoke the action determined by the action_name rule. If there is no
|
|
||||||
# such action, open the context menu.
|
|
||||||
# * open_url: If the notification has exactly one url, open it. If there are multiple
|
|
||||||
# ones, open the context menu.
|
|
||||||
# * close_current: Close current notification.
|
|
||||||
# * close_all: Close all notifications.
|
|
||||||
# * context: Open context menu for the notification.
|
|
||||||
# * context_all: Open context menu for all notifications.
|
|
||||||
# These values can be strung together for each mouse event, and
|
|
||||||
# will be executed in sequence.
|
|
||||||
mouse_left_click = do_action
|
|
||||||
mouse_middle_click = close_current
|
|
||||||
mouse_right_click = context
|
|
||||||
|
|
||||||
# Experimental features that may or may not work correctly. Do not expect them
|
|
||||||
# to have a consistent behaviour across releases.
|
|
||||||
[experimental]
|
|
||||||
# Calculate the dpi to use on a per-monitor basis.
|
|
||||||
# If this setting is enabled the Xft.dpi value will be ignored and instead
|
|
||||||
# dunst will attempt to calculate an appropriate dpi value for each monitor
|
|
||||||
# using the resolution and physical size. This might be useful in setups
|
|
||||||
# where there are multiple screens with very different dpi values.
|
|
||||||
per_monitor_dpi = false
|
|
||||||
|
|
||||||
|
|
||||||
[urgency_low]
|
|
||||||
# IMPORTANT: colors have to be defined in quotation marks.
|
|
||||||
# Otherwise the "#" and following would be interpreted as a comment.
|
|
||||||
background = "#24283b"
|
|
||||||
foreground = "#c0caf5"
|
|
||||||
highlight = "#bb9af7"
|
|
||||||
timeout = 3
|
|
||||||
# Icon for notifications with low urgency, uncomment to enable
|
|
||||||
icon = /dev/null
|
|
||||||
|
|
||||||
[urgency_normal]
|
|
||||||
background = "#24283b"
|
|
||||||
foreground = "#a9b1d6"
|
|
||||||
highlight = "#bb9af7"
|
|
||||||
timeout = 5
|
|
||||||
# Icon for notifications with normal urgency, uncomment to enable
|
|
||||||
icon = /dev/null
|
|
||||||
|
|
||||||
[urgency_critical]
|
|
||||||
background = "#24283b"
|
|
||||||
foreground = "#c0caf5"
|
|
||||||
frame_color = "#e9af68"
|
|
||||||
highlight = "#bb9af7"
|
|
||||||
timeout = 5
|
|
||||||
# Icon for notifications with critical urgency, uncomment to enable
|
|
||||||
#icon = /path/to/icon
|
|
||||||
|
|
||||||
# Every section that isn't one of the above is interpreted as a rules to
|
|
||||||
# override settings for certain messages.
|
|
||||||
#
|
|
||||||
# Messages can be matched by
|
|
||||||
# appname (discouraged, see desktop_entry)
|
|
||||||
# body
|
|
||||||
# category
|
|
||||||
# desktop_entry
|
|
||||||
# icon
|
|
||||||
# match_transient
|
|
||||||
# msg_urgency
|
|
||||||
# stack_tag
|
|
||||||
# summary
|
|
||||||
#
|
|
||||||
# and you can override the
|
|
||||||
# background
|
|
||||||
# foreground
|
|
||||||
# format
|
|
||||||
# frame_color
|
|
||||||
# fullscreen
|
|
||||||
# new_icon
|
|
||||||
# set_stack_tag
|
|
||||||
# set_transient
|
|
||||||
# set_category
|
|
||||||
# timeout
|
|
||||||
# urgency
|
|
||||||
# skip_display
|
|
||||||
# history_ignore
|
|
||||||
# action_name
|
|
||||||
# word_wrap
|
|
||||||
# ellipsize
|
|
||||||
# alignment
|
|
||||||
#
|
|
||||||
# Shell-like globbing will get expanded.
|
|
||||||
#
|
|
||||||
# Instead of the appname filter, it's recommended to use the desktop_entry filter.
|
|
||||||
# GLib based applications export their desktop-entry name. In comparison to the appname,
|
|
||||||
# the desktop-entry won't get localized.
|
|
||||||
#
|
|
||||||
# SCRIPTING
|
|
||||||
# You can specify a script that gets run when the rule matches by
|
|
||||||
# setting the "script" option.
|
|
||||||
# The script will be called as follows:
|
|
||||||
# script appname summary body icon urgency
|
|
||||||
# where urgency can be "LOW", "NORMAL" or "CRITICAL".
|
|
||||||
#
|
|
||||||
# NOTE: It might be helpful to run dunst -print in a terminal in order
|
|
||||||
# to find fitting options for rules.
|
|
||||||
|
|
||||||
# Disable the transient hint so that idle_threshold cannot be bypassed from the
|
|
||||||
# client
|
|
||||||
#[transient_disable]
|
|
||||||
# match_transient = yes
|
|
||||||
# set_transient = no
|
|
||||||
#
|
|
||||||
# Make the handling of transient notifications more strict by making them not
|
|
||||||
# be placed in history.
|
|
||||||
#[transient_history_ignore]
|
|
||||||
# match_transient = yes
|
|
||||||
# history_ignore = yes
|
|
||||||
|
|
||||||
# fullscreen values
|
|
||||||
# show: show the notifications, regardless if there is a fullscreen window opened
|
|
||||||
# delay: displays the new notification, if there is no fullscreen window active
|
|
||||||
# If the notification is already drawn, it won't get undrawn.
|
|
||||||
# pushback: same as delay, but when switching into fullscreen, the notification will get
|
|
||||||
# withdrawn from screen again and will get delayed like a new notification
|
|
||||||
#[fullscreen_delay_everything]
|
|
||||||
# fullscreen = delay
|
|
||||||
#[fullscreen_show_critical]
|
|
||||||
# msg_urgency = critical
|
|
||||||
# fullscreen = show
|
|
||||||
|
|
||||||
#[espeak]
|
|
||||||
# summary = "*"
|
|
||||||
# script = dunst_espeak.sh
|
|
||||||
|
|
||||||
#[script-test]
|
|
||||||
# summary = "*script*"
|
|
||||||
# script = dunst_test.sh
|
|
||||||
|
|
||||||
#[ignore]
|
|
||||||
# # This notification will not be displayed
|
|
||||||
# summary = "foobar"
|
|
||||||
# skip_display = true
|
|
||||||
|
|
||||||
#[history-ignore]
|
|
||||||
# # This notification will not be saved in history
|
|
||||||
# summary = "foobar"
|
|
||||||
# history_ignore = yes
|
|
||||||
|
|
||||||
#[skip-display]
|
|
||||||
# # This notification will not be displayed, but will be included in the history
|
|
||||||
# summary = "foobar"
|
|
||||||
# skip_display = yes
|
|
||||||
|
|
||||||
#[signed_on]
|
|
||||||
# appname = Pidgin
|
|
||||||
# summary = "*signed on*"
|
|
||||||
# urgency = low
|
|
||||||
#
|
|
||||||
#[signed_off]
|
|
||||||
# appname = Pidgin
|
|
||||||
# summary = *signed off*
|
|
||||||
# urgency = low
|
|
||||||
#
|
|
||||||
#[says]
|
|
||||||
# appname = Pidgin
|
|
||||||
# summary = *says*
|
|
||||||
# urgency = critical
|
|
||||||
#
|
|
||||||
#[twitter]
|
|
||||||
# appname = Pidgin
|
|
||||||
# summary = *twitter.com*
|
|
||||||
# urgency = normal
|
|
||||||
#
|
|
||||||
#[stack-volumes]
|
|
||||||
# appname = "some_volume_notifiers"
|
|
||||||
# set_stack_tag = "volume"
|
|
||||||
#
|
|
||||||
#[play_sound]
|
|
||||||
# summary = "*"
|
|
||||||
# script = ~/.local/share/sounds/notify_sound
|
|
|
@ -1,50 +0,0 @@
|
||||||
* {
|
|
||||||
all: unset;
|
|
||||||
color: #cdd6f4;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Calendar */
|
|
||||||
|
|
||||||
.cal-box {
|
|
||||||
background-color: #181825;
|
|
||||||
border-radius: 8px;
|
|
||||||
font-family: JetBrainsMono Nerd Font;
|
|
||||||
font-size: 1.2em;
|
|
||||||
|
|
||||||
.cal-inner-box {
|
|
||||||
padding: 1rem 1rem .3rem 1rem;
|
|
||||||
|
|
||||||
.cal {
|
|
||||||
&.highlight {
|
|
||||||
padding: 10rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
padding: .8rem .25rem 0rem;
|
|
||||||
margin-left: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
calendar:selected {
|
|
||||||
color: #9ece6a;
|
|
||||||
}
|
|
||||||
|
|
||||||
calendar.header {
|
|
||||||
color: #ad8ee6;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
calendar.button {
|
|
||||||
color: #449dab;
|
|
||||||
}
|
|
||||||
|
|
||||||
calendar.highlight {
|
|
||||||
color: #7aa2f7;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
calendar:indeterminate {
|
|
||||||
color: #8C8C8C;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
; includes:
|
|
||||||
;widgets
|
|
||||||
(include "widgets.yuck")
|
|
||||||
|
|
||||||
;; Calendar Windows ;;
|
|
||||||
|
|
||||||
(defwindow calendar
|
|
||||||
:geometry (geometry :x "-19px"
|
|
||||||
:y "50px"
|
|
||||||
:width "270px"
|
|
||||||
:height "60px"
|
|
||||||
:anchor "top right")
|
|
||||||
(cal))
|
|
|
@ -1,20 +0,0 @@
|
||||||
; widgets
|
|
||||||
|
|
||||||
(defpoll time0 :interval "10s" "date '+%H':%M")
|
|
||||||
(defpoll date :interval "10s" "date '+%b %d'")
|
|
||||||
|
|
||||||
;; Calendar Widgets ;;
|
|
||||||
(defwidget cal []
|
|
||||||
(box :class "cal-box"
|
|
||||||
:orientation "v"
|
|
||||||
(box :class "cal-inner-box"
|
|
||||||
(calendar :class "cal"
|
|
||||||
:day calendar_day
|
|
||||||
:month calendar_month
|
|
||||||
:year calendar_year))))
|
|
||||||
(defpoll calendar_day :interval "10h"
|
|
||||||
"date '+%d'")
|
|
||||||
(defpoll calendar_month :interval "10h"
|
|
||||||
"calendar")
|
|
||||||
(defpoll calendar_year :interval "10h"
|
|
||||||
"date '+%Y'")
|
|
|
@ -1,13 +0,0 @@
|
||||||
include ayu.conf
|
|
||||||
font_family Hermit
|
|
||||||
font_size 13
|
|
||||||
bold_font auto
|
|
||||||
italic_font auto
|
|
||||||
bold_italic_font auto
|
|
||||||
open_url_with default
|
|
||||||
mouse_map left click ungrabbed mouse_click_url_or_select
|
|
||||||
confirm_os_window_close 0
|
|
||||||
enable_audio_bell no
|
|
||||||
-- Allows zen-mode.nvim to increase font size
|
|
||||||
-- allow_remote_control socket-only
|
|
||||||
-- listen_on unix:/tmp/kitty
|
|
|
@ -1,379 +0,0 @@
|
||||||
[colors]
|
|
||||||
|
|
||||||
yellow = #ffd580
|
|
||||||
orange = #fe8019
|
|
||||||
blue = #73d0ff
|
|
||||||
green = #bae67e
|
|
||||||
red = #ff3333
|
|
||||||
bg = #1f2430
|
|
||||||
fg = #bfbab0
|
|
||||||
icons = #bae67e
|
|
||||||
cyan = #95e6cb
|
|
||||||
text = ${xrdb:color2}
|
|
||||||
unfocus = ${xrdb:color1}
|
|
||||||
accent = #604c7e
|
|
||||||
sky = #73d0ff
|
|
||||||
mauve = #bae67e
|
|
||||||
alert = ${colors.yellow}
|
|
||||||
|
|
||||||
bg-alt = #1E2029
|
|
||||||
fg-alt = #373844
|
|
||||||
bg-dark = #181a23
|
|
||||||
|
|
||||||
[bar/mybar]
|
|
||||||
; monitor = VGA-1
|
|
||||||
|
|
||||||
override-redirect = false
|
|
||||||
|
|
||||||
; Put the bar at the bottom of the screen
|
|
||||||
bottom = false
|
|
||||||
|
|
||||||
; Prefer fixed center position for the `modules-center` block
|
|
||||||
fixed-center = true
|
|
||||||
|
|
||||||
width = 100%
|
|
||||||
height = 34
|
|
||||||
|
|
||||||
; Background ARGB color (e.g. #f00, #ff992a, #ddff1023)
|
|
||||||
background = ${colors.bg}
|
|
||||||
|
|
||||||
; Foreground ARGB color (e.g. #f00, #ff992a, #ddff1023)
|
|
||||||
foreground = ${colors.fg}
|
|
||||||
|
|
||||||
line-size = 0
|
|
||||||
line-color = #fff
|
|
||||||
|
|
||||||
; Number of spaces to add at the beginning/end of the bar
|
|
||||||
; Individual side values can be defined using:
|
|
||||||
; padding-{left,right}
|
|
||||||
padding-right = 1
|
|
||||||
padding-left = 0
|
|
||||||
|
|
||||||
; Number of spaces to add before/after each module
|
|
||||||
; Individual side values can be defined using:
|
|
||||||
; module-margin-{left,right}
|
|
||||||
module-margin = 0
|
|
||||||
margin-bottom = 34
|
|
||||||
|
|
||||||
font-0 = "Iosevka Nerd Font,Iosevka NF:pixelsize=10;1" ; Icon Size
|
|
||||||
font-1 = "Iosevka Nerd Font,Iosevka NF:pixelsize=12;4" ; Large Text font
|
|
||||||
font-2 = "FiraCode Nerd Font:pixelsize=12;2"
|
|
||||||
font-3 = "Siji:pixelsize=10;2"
|
|
||||||
font-4 = "Iosevka Nerd Font,Iosevka NF:pixelsize=8;1" ; Small Icon Size
|
|
||||||
|
|
||||||
; Add module mpd for artist - title info
|
|
||||||
modules-left = bspwm sps volume
|
|
||||||
; modules-center = title
|
|
||||||
modules-right = wireless-network sps battery sps memory sps cpu sps date
|
|
||||||
|
|
||||||
; The separator will be inserted between the output of each module
|
|
||||||
separator =
|
|
||||||
|
|
||||||
; This value is used to add extra spacing between elements
|
|
||||||
; @deprecated: This parameter will be removed in an upcoming version
|
|
||||||
spacing = 0
|
|
||||||
|
|
||||||
; Opacity value between 0.0 and 1.0 used on fade in/out
|
|
||||||
dim-value = 1.0
|
|
||||||
|
|
||||||
wm-name = bspwm
|
|
||||||
|
|
||||||
tray-position = right
|
|
||||||
|
|
||||||
; If true, the bar will not shift its
|
|
||||||
; contents when the tray changes
|
|
||||||
tray-detached = false
|
|
||||||
|
|
||||||
; Tray icon max size
|
|
||||||
tray-maxsize = 16
|
|
||||||
|
|
||||||
tray-background = ${colors.bg}
|
|
||||||
;offset defined as pixel value (e.g. 35) or percentage (e.g. 50%)
|
|
||||||
|
|
||||||
tray-offset-x = 0
|
|
||||||
tray-offset-y = 0
|
|
||||||
|
|
||||||
; Pad the sides of each tray icon
|
|
||||||
tray-padding = 0
|
|
||||||
|
|
||||||
; Scale factor for tray clients
|
|
||||||
tray-scale = 1.0
|
|
||||||
|
|
||||||
wm-restack = bspwm
|
|
||||||
|
|
||||||
dpi-x = 133
|
|
||||||
dpi-y = 133
|
|
||||||
|
|
||||||
enable-ipc = false
|
|
||||||
|
|
||||||
; Fallback click handlers that will be called if
|
|
||||||
; there's no matching module handler found.
|
|
||||||
|
|
||||||
[module/bspwm]
|
|
||||||
type = internal/bspwm
|
|
||||||
pin-workspaces = true
|
|
||||||
enable-click = true
|
|
||||||
|
|
||||||
ws-icon-0 = 1;%{T2} %{T-}
|
|
||||||
ws-icon-1 = 2;%{T2} %{T-}
|
|
||||||
ws-icon-2 = 3;%{T2} %{T-}
|
|
||||||
ws-icon-3 = 4;%{T2} %{T-}
|
|
||||||
ws-icon-4 = 5;%{T2} %{T-}
|
|
||||||
ws-icon-default =
|
|
||||||
; fuzzy-match = true
|
|
||||||
|
|
||||||
format = <label-state> <label-mode>
|
|
||||||
label-padding = 1
|
|
||||||
label-foreground = ${colors.green}
|
|
||||||
|
|
||||||
label-focused = %icon%
|
|
||||||
label-focused-background = ${colors.yellow}
|
|
||||||
label-focused-foreground = ${colors.bg}
|
|
||||||
# label-focused-underline = ${colors.magenta}
|
|
||||||
; label-focused-foreground = ${xrdb:color2}
|
|
||||||
label-focused-padding = 1
|
|
||||||
|
|
||||||
label-occupied = %icon%
|
|
||||||
label-occupied-foreground = ${colors.accent}
|
|
||||||
label-occupied-padding = 1
|
|
||||||
|
|
||||||
label-urgent = %icon%
|
|
||||||
label-urgent-foreground = ${colors.alert}
|
|
||||||
; label-urgent-background = ${colors.alert}
|
|
||||||
label-urgent-padding = 1
|
|
||||||
; label-urgent-font = 3
|
|
||||||
|
|
||||||
label-empty = %icon%
|
|
||||||
label-empty-foreground = ${colors.fg-alt}
|
|
||||||
label-empty-padding = 1
|
|
||||||
|
|
||||||
[module/date]
|
|
||||||
type = internal/date
|
|
||||||
|
|
||||||
; Seconds to sleep between updates
|
|
||||||
interval = 1.0
|
|
||||||
|
|
||||||
; See "http://en.cppreference.com/w/cpp/io/manip/put_time" for details on how to format the date string
|
|
||||||
; NOTE: if you want to use syntax tags here you need to use %%{...}
|
|
||||||
date = %{T2} %{T-}%{T1} %d/%a%{T-}
|
|
||||||
|
|
||||||
; Optional time format
|
|
||||||
time = %{T2} %H:%M%{T-}
|
|
||||||
|
|
||||||
; if `date-alt` or `time-alt` is defined, clicking
|
|
||||||
; the module will toggle between formats
|
|
||||||
date-alt = %{T2} %{T-} %{T1} %a, %d %b %y%{T-}
|
|
||||||
time-alt = %{T2} %H:%M:%S%{T-}
|
|
||||||
|
|
||||||
label = %date%%time%
|
|
||||||
label-font = 0
|
|
||||||
label-foreground = ${colors.green}
|
|
||||||
|
|
||||||
[module/wireless-network]
|
|
||||||
type = internal/network
|
|
||||||
interface = wlp3s0
|
|
||||||
|
|
||||||
label-connected = %essid%
|
|
||||||
label-connected-font = 2
|
|
||||||
format-connected = <ramp-signal> <label-connected>
|
|
||||||
label-connected-foreground = #82b414
|
|
||||||
|
|
||||||
|
|
||||||
format-disconnected = <label-disconnected>
|
|
||||||
label-disconnected = ""
|
|
||||||
label-disconnected-foreground = #f92672
|
|
||||||
|
|
||||||
ramp-signal-foreground = #82b414
|
|
||||||
ramp-signal-0 = " "
|
|
||||||
ramp-signal-1 = " "
|
|
||||||
ramp-signal-2 = " "
|
|
||||||
ramp-signal-3 = " "
|
|
||||||
ramp-signal-4 = " "
|
|
||||||
ramp-signal-5 = " "
|
|
||||||
|
|
||||||
[module/cpu]
|
|
||||||
type = internal/cpu
|
|
||||||
|
|
||||||
; Seconds to sleep between updates
|
|
||||||
; Default: 1
|
|
||||||
interval = 0.5
|
|
||||||
|
|
||||||
label = %{T2} %{T-}%{T1} %percentage:2%%%{T-}
|
|
||||||
|
|
||||||
label-foreground = ${colors.cyan}
|
|
||||||
|
|
||||||
[module/memory]
|
|
||||||
type = internal/memory
|
|
||||||
|
|
||||||
; Seconds to sleep between updates
|
|
||||||
; Default: 1
|
|
||||||
interval = 0.5
|
|
||||||
format = <label>
|
|
||||||
|
|
||||||
; Available tokens:
|
|
||||||
; %percentage_used% (default)
|
|
||||||
; %percentage_free%
|
|
||||||
; %gb_used%
|
|
||||||
; %gb_free%
|
|
||||||
; %gb_total%
|
|
||||||
; %mb_used%
|
|
||||||
; %mb_free%
|
|
||||||
; %mb_total%
|
|
||||||
; %percentage_swap_used%
|
|
||||||
; %percentage_swap_free%
|
|
||||||
; %mb_swap_total%
|
|
||||||
; %mb_swap_free%
|
|
||||||
; %mb_swap_used%
|
|
||||||
; %gb_swap_total%
|
|
||||||
; %gb_swap_free%
|
|
||||||
; %gb_swap_used%
|
|
||||||
|
|
||||||
label = %{T2} %{T-}%{T1} %gb_used%%{T-}
|
|
||||||
|
|
||||||
label-foreground = ${colors.cyan}
|
|
||||||
|
|
||||||
[module/mpd]
|
|
||||||
type = internal/mpd
|
|
||||||
|
|
||||||
host = 0.0.0.0
|
|
||||||
port = 6600
|
|
||||||
|
|
||||||
interval = 2
|
|
||||||
|
|
||||||
format-online = <label-song>
|
|
||||||
format-online-background = ${colors.bg}
|
|
||||||
format-online-foreground = ${colors.yellow}
|
|
||||||
#format-online-padding = 20
|
|
||||||
|
|
||||||
label-song = %{T2}%artist% - %title%%{T-}
|
|
||||||
label-song-maxlen = 55
|
|
||||||
label-song-ellipsis = true
|
|
||||||
|
|
||||||
label-offline = "MPD is offline"
|
|
||||||
|
|
||||||
[module/mpd_i]
|
|
||||||
type = internal/mpd
|
|
||||||
|
|
||||||
interval = 2
|
|
||||||
|
|
||||||
format-online = <icon-prev> <toggle> <icon-next>
|
|
||||||
format-online-background = ${colors.bg}
|
|
||||||
format-online-foreground = ${colors.yellow}
|
|
||||||
#format-online-padding = 2
|
|
||||||
|
|
||||||
label-offline = "MPD is offline"
|
|
||||||
|
|
||||||
; Only applies if <icon-X> is used
|
|
||||||
icon-play = %{T1}奈%{T-}
|
|
||||||
icon-pause = %{T1}%{T-}
|
|
||||||
icon-stop = %{T1}%{T-}
|
|
||||||
icon-prev = %{T1}ﭣ%{T-}
|
|
||||||
icon-next = %{T1}ﭡ%{T-}
|
|
||||||
|
|
||||||
;An empty module used to add 1 unit spacings whenever needed
|
|
||||||
[module/sps]
|
|
||||||
type = custom/text
|
|
||||||
content = " "
|
|
||||||
content-padding = 0
|
|
||||||
|
|
||||||
[module/volume]
|
|
||||||
type = internal/pulseaudio
|
|
||||||
|
|
||||||
use-ui-max = false
|
|
||||||
|
|
||||||
interval = 5
|
|
||||||
|
|
||||||
format-volume = <ramp-volume> <bar-volume>
|
|
||||||
|
|
||||||
format-muted = <label-muted>
|
|
||||||
format-muted-prefix = " "
|
|
||||||
format-muted-prefix-font = 2
|
|
||||||
format-muted-prefix-foreground = ${colors.mauve}
|
|
||||||
|
|
||||||
label-volume = "%percentage%% "
|
|
||||||
label-muted = "Mute"
|
|
||||||
|
|
||||||
label-volume-foreground = ${colors.mauve}
|
|
||||||
label-muted-foreground = ${colors.mauve}
|
|
||||||
|
|
||||||
bar-volume-width = 8
|
|
||||||
bar-volume-gradient = false
|
|
||||||
bar-volume-indicator = |
|
|
||||||
bar-volume-indicator-font = 6
|
|
||||||
bar-volume-indicator-foreground = ${colors.mauve}
|
|
||||||
bar-volume-fill = ─
|
|
||||||
bar-volume-fill-font = 6
|
|
||||||
bar-volume-fill-foreground = ${colors.mauve}
|
|
||||||
bar-volume-empty = ─
|
|
||||||
bar-volume-empty-font = 6
|
|
||||||
bar-volume-empty-foreground = ${colors.fg-alt}
|
|
||||||
|
|
||||||
ramp-volume-0 = " "
|
|
||||||
ramp-volume-1 = " "
|
|
||||||
ramp-volume-2 = " "
|
|
||||||
ramp-volume-3 = " "
|
|
||||||
ramp-volume-4 = " "
|
|
||||||
ramp-volume-5 = " "
|
|
||||||
ramp-volume-6 = " "
|
|
||||||
ramp-volume-7 = " "
|
|
||||||
ramp-volume-8 = " "
|
|
||||||
ramp-volume-9 = " "
|
|
||||||
ramp-volume-font = 1
|
|
||||||
ramp-volume-foreground = ${colors.mauve}
|
|
||||||
|
|
||||||
ramp-headphones-0 =
|
|
||||||
ramp-headphones-1 =
|
|
||||||
|
|
||||||
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
|
||||||
|
|
||||||
[module/battery]
|
|
||||||
type = internal/battery
|
|
||||||
|
|
||||||
full-at = 99
|
|
||||||
|
|
||||||
adapter = ACAD
|
|
||||||
battery = BAT0
|
|
||||||
|
|
||||||
poll-interval = 2
|
|
||||||
time-format = %H:%M
|
|
||||||
|
|
||||||
format-charging = <animation-charging> <label-charging>
|
|
||||||
format-charging-prefix =
|
|
||||||
|
|
||||||
format-discharging = <ramp-capacity> <label-discharging>
|
|
||||||
|
|
||||||
format-full = <label-full>
|
|
||||||
format-full-prefix = " "
|
|
||||||
format-full-prefix-font = 2
|
|
||||||
format-full-prefix-foreground = ${colors.sky}
|
|
||||||
|
|
||||||
label-charging = "%percentage%% "
|
|
||||||
label-discharging = "%percentage%% "
|
|
||||||
label-full = "%percentage%%"
|
|
||||||
|
|
||||||
label-charging-foreground = ${colors.sky}
|
|
||||||
label-discharging-foreground = ${colors.sky}
|
|
||||||
label-charging-font = 2
|
|
||||||
label-discharging-font = 2
|
|
||||||
label-full-foreground = ${colors.sky}
|
|
||||||
label-full-font = 2
|
|
||||||
|
|
||||||
ramp-capacity-0 = " "
|
|
||||||
ramp-capacity-1 = " "
|
|
||||||
ramp-capacity-2 = " "
|
|
||||||
ramp-capacity-3 = " "
|
|
||||||
ramp-capacity-4 = " "
|
|
||||||
ramp-capacity-font = 1
|
|
||||||
ramp-capacity-foreground = ${colors.sky}
|
|
||||||
|
|
||||||
animation-charging-0 = " "
|
|
||||||
animation-charging-1 = " "
|
|
||||||
animation-charging-2 = " "
|
|
||||||
animation-charging-3 = " "
|
|
||||||
animation-charging-4 = " "
|
|
||||||
animation-charging-font = 1
|
|
||||||
animation-charging-foreground = ${colors.sky}
|
|
||||||
animation-charging-framerate = 750
|
|
||||||
|
|
||||||
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
|
||||||
|
|
|
@ -1,387 +0,0 @@
|
||||||
[colors]
|
|
||||||
black = ${xrdb:color0}
|
|
||||||
bblack = ${xrdb:color8}
|
|
||||||
red = ${xrdb:color1}
|
|
||||||
bred = ${xrdb:color9}
|
|
||||||
green = ${xrdb:color2}
|
|
||||||
bgreen = ${xrdb:color10}
|
|
||||||
yellow = ${xrdb:color3}
|
|
||||||
byellow = ${xrdb:color11}
|
|
||||||
blue = ${xrdb:color4}
|
|
||||||
bblue = ${xrdb:color12}
|
|
||||||
magenta = ${xrdb:color5}
|
|
||||||
bmagenta = ${xrdb:color13}
|
|
||||||
cyan = ${xrdb:color6}
|
|
||||||
bcyan = ${xrdb:color14}
|
|
||||||
white = ${xrdb:color7}
|
|
||||||
bwhite = ${xrdb:color15}
|
|
||||||
|
|
||||||
bg = ${xrdb:background}
|
|
||||||
fg = ${colors.magenta}
|
|
||||||
bg-alt = #1E2029
|
|
||||||
fg-alt = #373844
|
|
||||||
bg-dark = #181a23
|
|
||||||
|
|
||||||
alert = ${colors.yellow}
|
|
||||||
accent = #604c7e
|
|
||||||
|
|
||||||
|
|
||||||
[global/wm]
|
|
||||||
margin-top = 0
|
|
||||||
margin-bottom = 34
|
|
||||||
|
|
||||||
[bar/main]
|
|
||||||
monitor = ${env:MONITOR}
|
|
||||||
monitor-strict = true
|
|
||||||
enable-ipc = true
|
|
||||||
wm-restack = bspwm
|
|
||||||
# REQUIRED to move the window with hideit.sh
|
|
||||||
override-redirect = true
|
|
||||||
fixed-center = true
|
|
||||||
|
|
||||||
background = ${colors.bg}
|
|
||||||
foreground = ${colors.fg}
|
|
||||||
|
|
||||||
width = 100%
|
|
||||||
height = 34
|
|
||||||
offset-x = 0
|
|
||||||
offset-y = 0
|
|
||||||
# bottom = true
|
|
||||||
|
|
||||||
overline-size = 0
|
|
||||||
overline-color = #f00
|
|
||||||
underline-size = 0
|
|
||||||
underline-color = #00f
|
|
||||||
|
|
||||||
border-bottom-size = 0
|
|
||||||
border-top-size = 1
|
|
||||||
border-color = ${colors.bg-dark}
|
|
||||||
|
|
||||||
padding-left = 2
|
|
||||||
padding-right = 2
|
|
||||||
module-margin-left = 0
|
|
||||||
module-margin-right = 0
|
|
||||||
|
|
||||||
font-0 = "Fira Code:pixelsize=13;2"
|
|
||||||
font-1 = "Wuncon Siji:pixelsize=16;2"
|
|
||||||
font-2 = "Siji:pixelsize=10;2"
|
|
||||||
|
|
||||||
; modules-left = volume pad cpu memory pad pkg mail
|
|
||||||
modules-left = pulseaudio pad cpu memory pad fs
|
|
||||||
modules-center = bspwm
|
|
||||||
modules-right = syncthing redshift wlan pad network-up pad network-down pad battery pad date
|
|
||||||
|
|
||||||
;tray-position = center
|
|
||||||
;tray-padding = 2
|
|
||||||
;tray-transparent = true
|
|
||||||
;tray-background = #0063ff
|
|
||||||
|
|
||||||
[module/bspwm]
|
|
||||||
type = internal/bspwm
|
|
||||||
pin-workspaces = true
|
|
||||||
enable-click = true
|
|
||||||
|
|
||||||
# ws-icon-0 = 1;
|
|
||||||
# ws-icon-1 = 2;
|
|
||||||
# ws-icon-2 = 3;
|
|
||||||
# ws-icon-3 = 4;
|
|
||||||
# ws-icon-4 = 5;
|
|
||||||
# ws-icon-5 = 6;
|
|
||||||
ws-icon-default =
|
|
||||||
fuzzy-match = true
|
|
||||||
|
|
||||||
format = <label-state> <label-mode>
|
|
||||||
label-padding = 1
|
|
||||||
|
|
||||||
label-focused = %icon%
|
|
||||||
label-focused-background = ${colors.bg-dark}
|
|
||||||
label-focused-foreground = ${colors.fg}
|
|
||||||
# label-focused-underline = ${colors.magenta}
|
|
||||||
; label-focused-foreground = ${xrdb:color2}
|
|
||||||
label-focused-padding = 1
|
|
||||||
|
|
||||||
label-occupied = %icon%
|
|
||||||
label-occupied-foreground = ${colors.accent}
|
|
||||||
label-occupied-padding = 1
|
|
||||||
|
|
||||||
; label-urgent = %icon%
|
|
||||||
label-urgent-foreground = ${colors.alert}
|
|
||||||
; label-urgent-background = ${colors.alert}
|
|
||||||
label-urgent-padding = 1
|
|
||||||
|
|
||||||
label-empty = %icon%
|
|
||||||
label-empty-foreground = ${colors.fg-alt}
|
|
||||||
label-empty-padding = 1
|
|
||||||
|
|
||||||
[module/date]
|
|
||||||
type = internal/date
|
|
||||||
interval = 5
|
|
||||||
|
|
||||||
label = %date% %time%
|
|
||||||
date = %A, %h %d
|
|
||||||
date-alt = %Y-%m-%d
|
|
||||||
time = %I:%M %p
|
|
||||||
time-alt = %H:%M:%S
|
|
||||||
format-prefix = ""
|
|
||||||
format-prefix-padding = 1
|
|
||||||
; format-prefix-background = ${colors.bg-alt}
|
|
||||||
format-prefix-foreground = ${colors.accent}
|
|
||||||
; format-underline = ${xrdb:color4}
|
|
||||||
|
|
||||||
[module/fs]
|
|
||||||
type = internal/fs
|
|
||||||
mount-0 = /
|
|
||||||
# mount-1 = /mnt/projects ; for desktops
|
|
||||||
mount-2 = /home/anish
|
|
||||||
interval = 30
|
|
||||||
|
|
||||||
; Available tags:
|
|
||||||
; <label-mounted> (default)
|
|
||||||
; <bar-free>
|
|
||||||
; <bar-used>
|
|
||||||
; <ramp-capacity>
|
|
||||||
format-mounted = "<bar-used>"
|
|
||||||
format-mounted-foreground = ${colors.accent}
|
|
||||||
; Available tokens:
|
|
||||||
; %mountpoint%
|
|
||||||
; %type%
|
|
||||||
; %fsname%
|
|
||||||
; %percentage_free%
|
|
||||||
; %percentage_used%
|
|
||||||
; %total%
|
|
||||||
; %free%
|
|
||||||
; %used%
|
|
||||||
; Default: %mountpoint% %percentage_free%%
|
|
||||||
|
|
||||||
; Available tags:
|
|
||||||
; <label-unmounted> (default)
|
|
||||||
format-unmounted =
|
|
||||||
label-unmounted =
|
|
||||||
label-unmounted-foreground = ${colors.fg-alt}
|
|
||||||
|
|
||||||
bar-used-indicator =
|
|
||||||
bar-used-width = 8
|
|
||||||
bar-used-foreground-0 = ${colors.fg}
|
|
||||||
bar-used-foreground-1 = ${colors.fg}
|
|
||||||
bar-used-foreground-2 = ${colors.yellow}
|
|
||||||
bar-used-foreground-3 = ${colors.alert}
|
|
||||||
bar-used-foreground-4 = ${colors.alert}
|
|
||||||
bar-used-fill = |
|
|
||||||
bar-used-empty = ¦
|
|
||||||
bar-used-empty-foreground = ${colors.fg-alt}
|
|
||||||
|
|
||||||
[module/xwindow]
|
|
||||||
type = internal/xwindow
|
|
||||||
label = %title:0:80:...%
|
|
||||||
label-padding-left = 2
|
|
||||||
|
|
||||||
; [module/mpd]
|
|
||||||
; type = internal/mpd
|
|
||||||
; host = /home/hlissner/.config/mpd/mpd.sock
|
|
||||||
;
|
|
||||||
; format-online = <label-song> <toggle>
|
|
||||||
; format-padding = 5
|
|
||||||
;
|
|
||||||
; label-song-maxlen = 45
|
|
||||||
; label-song-ellipsis = true
|
|
||||||
;
|
|
||||||
; icon-prev =
|
|
||||||
; icon-seekb =
|
|
||||||
; icon-stop =
|
|
||||||
; icon-play =
|
|
||||||
; icon-pause =
|
|
||||||
; icon-next =
|
|
||||||
; icon-seekf =
|
|
||||||
;
|
|
||||||
; icon-random =
|
|
||||||
; icon-repeat =
|
|
||||||
;
|
|
||||||
; toggle-on-foreground = ${colors.fg}
|
|
||||||
; toggle-off-foreground = #66
|
|
||||||
|
|
||||||
[module/cpu]
|
|
||||||
type = internal/cpu
|
|
||||||
interval = 2
|
|
||||||
format = <bar-load>
|
|
||||||
format-prefix = ""
|
|
||||||
format-foreground = ${colors.accent}
|
|
||||||
; format-underline = #f90000
|
|
||||||
; label = %percentage%%
|
|
||||||
format-padding = 1
|
|
||||||
|
|
||||||
bar-load-indicator =
|
|
||||||
bar-load-width = 8
|
|
||||||
bar-load-foreground-0 = ${colors.fg}
|
|
||||||
bar-load-foreground-1 = ${colors.fg}
|
|
||||||
bar-load-foreground-2 = ${colors.yellow}
|
|
||||||
bar-load-foreground-3 = ${colors.alert}
|
|
||||||
bar-load-foreground-4 = ${colors.alert}
|
|
||||||
bar-load-fill = |
|
|
||||||
bar-load-empty = ¦
|
|
||||||
bar-load-empty-foreground = ${colors.fg-alt}
|
|
||||||
|
|
||||||
[module/memory]
|
|
||||||
type = internal/memory
|
|
||||||
interval = 3
|
|
||||||
format = <bar-used>
|
|
||||||
format-prefix = ""
|
|
||||||
format-prefix-foreground = ${colors.accent}
|
|
||||||
; format-underline = #4bffdc
|
|
||||||
; label = %percentage_used%%
|
|
||||||
format-padding-left = 1
|
|
||||||
|
|
||||||
; Only applies if <bar-used> is used
|
|
||||||
bar-used-indicator =
|
|
||||||
bar-used-width = 8
|
|
||||||
bar-used-foreground-0 = ${colors.fg}
|
|
||||||
bar-used-foreground-1 = ${colors.fg}
|
|
||||||
bar-used-foreground-2 = ${colors.yellow}
|
|
||||||
bar-used-foreground-3 = ${colors.alert}
|
|
||||||
bar-used-foreground-4 = ${colors.alert}
|
|
||||||
bar-used-fill = |
|
|
||||||
bar-used-empty = ¦
|
|
||||||
bar-used-empty-foreground = ${colors.fg-alt}
|
|
||||||
|
|
||||||
[module/wlan]
|
|
||||||
type = internal/network
|
|
||||||
interface = ${env:WLP:wlp3s0}
|
|
||||||
interval = 3.0
|
|
||||||
|
|
||||||
format-connected = <ramp-signal>
|
|
||||||
format-disconnected =
|
|
||||||
format-disconnected-foreground =
|
|
||||||
|
|
||||||
; label-connected =
|
|
||||||
; label-disconnected = !
|
|
||||||
; label-disconnected-foreground = ${colors.red}
|
|
||||||
|
|
||||||
ramp-signal-0 =
|
|
||||||
ramp-signal-0-foreground = ${colors.yellow}
|
|
||||||
ramp-signal-1 =
|
|
||||||
ramp-signal-1-foreground = ${colors.yellow}
|
|
||||||
ramp-signal-2 =
|
|
||||||
ramp-signal-2-foreground = ${colors.yellow}
|
|
||||||
ramp-signal-3 =
|
|
||||||
ramp-signal-3-foreground = ${colors.accent}
|
|
||||||
ramp-signal-4 =
|
|
||||||
ramp-signal-4-foreground = ${colors.fg}
|
|
||||||
|
|
||||||
|
|
||||||
[module/network-up]
|
|
||||||
type = internal/network
|
|
||||||
interface = ${env:LAN:eno1}
|
|
||||||
interval = 4.0
|
|
||||||
label-connected = "%upspeed%"
|
|
||||||
format-connected-prefix = " "
|
|
||||||
format-connected-prefix-foreground = ${colors.accent}
|
|
||||||
format-connected-foreground = ${colors.fg}
|
|
||||||
format-connected-background =
|
|
||||||
format-connected-underline =
|
|
||||||
format-disconnected-prefix = " "
|
|
||||||
format-disconnected-prefix-foreground = ${colors.alert}
|
|
||||||
format-disconnected-foreground = ${colors.alert}
|
|
||||||
|
|
||||||
[module/network-down]
|
|
||||||
type = internal/network
|
|
||||||
interface = ${env:LAN:eno1}
|
|
||||||
interval = 4.0
|
|
||||||
label-connected = "%downspeed%"
|
|
||||||
format-connected-prefix = " "
|
|
||||||
format-connected-prefix-foreground = ${colors.accent}
|
|
||||||
format-connected-foreground = ${colors.fg}
|
|
||||||
format-connected-background =
|
|
||||||
format-connected-underline =
|
|
||||||
format-disconnected-prefix = " "
|
|
||||||
format-disconnected-prefix-foreground = ${colors.alert}
|
|
||||||
format-disconnected-foreground = ${colors.alert}
|
|
||||||
|
|
||||||
[module/pulseaudio]
|
|
||||||
type = internal/pulseaudio
|
|
||||||
|
|
||||||
; format-volume = <label-volume> <bar-volume>
|
|
||||||
format-volume = <ramp-volume> <bar-volume>
|
|
||||||
; label-volume = " "
|
|
||||||
label-volume-foreground = ${colors.accent}
|
|
||||||
|
|
||||||
; format-muted-prefix = " "
|
|
||||||
format-muted-foreground = ${colors.alert}
|
|
||||||
label-muted =
|
|
||||||
|
|
||||||
bar-volume-width = 8
|
|
||||||
# bar-volume-foreground-0 = ${colors.magenta}
|
|
||||||
# bar-volume-foreground-1 = ${colors.magenta}
|
|
||||||
# bar-volume-foreground-2 = ${colors.magenta}
|
|
||||||
# bar-volume-foreground-3 = ${colors.magenta}
|
|
||||||
# bar-volume-foreground-4 = ${colors.magenta}
|
|
||||||
# bar-volume-foreground-5 = ${colors.magenta}
|
|
||||||
# bar-volume-foreground-6 = ${colors.magenta}
|
|
||||||
bar-volume-gradient = false
|
|
||||||
bar-volume-indicator = |
|
|
||||||
bar-volume-indicator-font = 1
|
|
||||||
bar-volume-indicator-foreground = #ff
|
|
||||||
bar-volume-fill = ─
|
|
||||||
bar-volume-fill-font = 1
|
|
||||||
bar-volume-empty = ─
|
|
||||||
bar-volume-empty-font = 1
|
|
||||||
bar-volume-empty-foreground = ${colors.fg-alt}
|
|
||||||
|
|
||||||
; Only applies if <ramp-volume> is used
|
|
||||||
ramp-volume-0 =
|
|
||||||
ramp-volume-1 =
|
|
||||||
ramp-volume-2 =
|
|
||||||
|
|
||||||
[module/battery]
|
|
||||||
type = internal/battery
|
|
||||||
battery = BAT0
|
|
||||||
adapter = ADP1
|
|
||||||
full-at = 98
|
|
||||||
|
|
||||||
format-charging = <animation-charging> <label-charging>
|
|
||||||
format-charging-underline = #ffb52a
|
|
||||||
|
|
||||||
format-discharging = <ramp-capacity> <label-discharging>
|
|
||||||
format-discharging-underline = ${self.format-charging-underline}
|
|
||||||
|
|
||||||
format-full-prefix = " "
|
|
||||||
format-full-prefix-foreground = ${colors.fg-alt}
|
|
||||||
format-full-underline = ${self.format-charging-underline}
|
|
||||||
|
|
||||||
ramp-capacity-0 =
|
|
||||||
ramp-capacity-1 =
|
|
||||||
ramp-capacity-2 =
|
|
||||||
ramp-capacity-0-foreground = ${colors.red}
|
|
||||||
ramp-capacity-1-foreground = #575864
|
|
||||||
ramp-capacity-2-foreground = ${colors.fg-alt}
|
|
||||||
|
|
||||||
animation-charging-0 =
|
|
||||||
animation-charging-1 =
|
|
||||||
animation-charging-2 =
|
|
||||||
animation-charging-framerate = 1000
|
|
||||||
animation-charging-foreground = ${colors.fg}
|
|
||||||
|
|
||||||
|
|
||||||
;=====================================================
|
|
||||||
; Custom scripts
|
|
||||||
;=====================================================
|
|
||||||
|
|
||||||
[module/pad]
|
|
||||||
type = custom/text
|
|
||||||
content = " "
|
|
||||||
content-foreground = ${colors.fg-alt}
|
|
||||||
|
|
||||||
[module/redshift]
|
|
||||||
type = custom/script
|
|
||||||
exec = ~/.config/polybar/modules/redshift
|
|
||||||
exec-if = pgrep -x redshift
|
|
||||||
interval = 60
|
|
||||||
format-padding = 1
|
|
||||||
|
|
||||||
[module/syncthing]
|
|
||||||
type = custom/script
|
|
||||||
exec = echo 1
|
|
||||||
exec-if = systemctl is-active syncthing
|
|
||||||
format = ""
|
|
||||||
format-foreground = ${colors.fg}
|
|
||||||
interval = 30
|
|
||||||
|
|
||||||
; vim:ft=dosini
|
|
|
@ -1,15 +0,0 @@
|
||||||
/* -*- mode: css; -*- */
|
|
||||||
|
|
||||||
@import "config.rasi"
|
|
||||||
|
|
||||||
listview {
|
|
||||||
columns: 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
textbox-icon {
|
|
||||||
str: "🎑";
|
|
||||||
}
|
|
||||||
|
|
||||||
prompt {
|
|
||||||
enabled: false;
|
|
||||||
}
|
|
|
@ -1,43 +0,0 @@
|
||||||
@import "config.rasi"
|
|
||||||
|
|
||||||
* {
|
|
||||||
icon-font : "Iosevka Nerd Font Mono 24";
|
|
||||||
text-color : @fg;
|
|
||||||
background-color : @bg;
|
|
||||||
|
|
||||||
margin : 0px;
|
|
||||||
padding : 0px;
|
|
||||||
spacing : 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
window {
|
|
||||||
location : north;
|
|
||||||
children : [mainbox];
|
|
||||||
}
|
|
||||||
|
|
||||||
mainbox {
|
|
||||||
children : [listview];
|
|
||||||
}
|
|
||||||
|
|
||||||
listview {
|
|
||||||
columns : 8;
|
|
||||||
lines : 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
element {
|
|
||||||
children : [element-text];
|
|
||||||
}
|
|
||||||
|
|
||||||
element-text {
|
|
||||||
font : @icon-font;
|
|
||||||
cursor : pointer;
|
|
||||||
padding : 4px;
|
|
||||||
|
|
||||||
vertical-align : 0.5;
|
|
||||||
horizontal-align : 0.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
element-text selected {
|
|
||||||
text-color : @bg;
|
|
||||||
background-color : @accent;
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue