Compare commits
224 Commits
a268f37854
...
test2
| Author | SHA1 | Date | |
|---|---|---|---|
| f7d448f63b | |||
| 2a9a66fb06 | |||
| a29940a65a | |||
| d283bcddcd | |||
| efb3e54dcb | |||
| 872c9314e9 | |||
| 84c738ce64 | |||
| d814a13602 | |||
| 35b7ff0567 | |||
| ee10eb8779 | |||
| cc69e21613 | |||
| 0c6ffc6dbd | |||
| c21a76907c | |||
| 36dcdad8b7 | |||
| 3215c88ee1 | |||
| d2509eb0aa | |||
| d7305dc070 | |||
| 95a87d5112 | |||
| 9c11f4b357 | |||
| 05b7b53677 | |||
| 9170f6af1d | |||
| 14270d4217 | |||
| 214de1d2a2 | |||
| 8e22012b23 | |||
| bf44b943ac | |||
| fef4fd5ce1 | |||
| 2aa6073b5e | |||
| f722d06a28 | |||
| ec32037212 | |||
| 375935205e | |||
| 6b29f628db | |||
| 5890dd13d6 | |||
| 58dd4470fa | |||
| 680762b999 | |||
| 96ba4fd0b3 | |||
| b0b5833502 | |||
| 18c73ef8f1 | |||
| 9385652e8b | |||
| 5198256bf7 | |||
| 67ac6797df | |||
| 7703621506 | |||
| 0e125af3f7 | |||
| a9850d527c | |||
| cc6f4cb102 | |||
|
|
8d59331de5 | ||
|
|
066308e9ae | ||
|
|
6159d33cd6 | ||
| c70c39f28f | |||
| 468f1ee9c0 | |||
| bad23c0796 | |||
| d1b302a234 | |||
| 6fa75cad60 | |||
| f24e48d5cd | |||
| 579e97a3be | |||
| ba7153ce4a | |||
| 48d4788e55 | |||
| b9b12d07a3 | |||
| 4c998c4a21 | |||
| 7e119171dd | |||
| 2f339474e8 | |||
| 7d100dbbe5 | |||
| d03d13975f | |||
| cd0f9ab719 | |||
| c791055d7f | |||
| 9ac0a9895c | |||
| 7aea9806ad | |||
| a3e3c88204 | |||
| 5cbbf5e777 | |||
| 4b442be5ac | |||
| 87d8a43119 | |||
| 3f9dd1a39a | |||
| 91a3099822 | |||
| 78ec2715bd | |||
| cd937acc60 | |||
| c0b9631ecf | |||
| 06e2e847e9 | |||
| a14e884302 | |||
| d719481f4d | |||
| 3bb8f8bd56 | |||
| a71f9b7bc5 | |||
| 3cf49371e1 | |||
| 69f6ba29fc | |||
| 52525ba8ce | |||
| 19ca3f7980 | |||
| cf12e48c41 | |||
| b2b80a7ba4 | |||
| 903f6975fc | |||
|
|
284387581e | ||
| 1e05fe61f0 | |||
| 9f4cebde56 | |||
| 296f3e9f76 | |||
| bd7c4d270d | |||
| 617f63ed17 | |||
| 5ba2bda934 | |||
| 73c18fa7b7 | |||
| 546c08a28e | |||
| 40f08b3783 | |||
| 90fd75b2ba | |||
| 442e6e0986 | |||
| be07205cbb | |||
| 0c1ddd96c3 | |||
| abd7b450c9 | |||
| 7b92000dde | |||
| 7f5e51651a | |||
| f9cbe9fbea | |||
| ab75df4095 | |||
| 2668f4ffad | |||
| 1e706c8ed9 | |||
| 4f0f775a5d | |||
| c737c3a0f4 | |||
| fd3c106b29 | |||
| 1405b0621d | |||
| 75af2aba0f | |||
| 65455aff68 | |||
| da77ab91c7 | |||
| 03fbae33e4 | |||
| f844c3cc48 | |||
| f88cbf2a32 | |||
| adb32321a3 | |||
| 18b32adfc9 | |||
| 8f850ec2c8 | |||
| 73fe37e50f | |||
| 5e8820da53 | |||
| 7e0a937516 | |||
| ea1b3ecc3d | |||
| b4f502e964 | |||
| f84ed5f28d | |||
| 89799c2ccd | |||
| c51a326278 | |||
| cedecc54b9 | |||
| 0b01fd236e | |||
| 6e518966e0 | |||
| e8f2888ead | |||
| d9bb925581 | |||
| eac0c05a56 | |||
| ea512bb92d | |||
| 06bdbb608c | |||
| d5c8aaa6d8 | |||
| 60667c81a2 | |||
| c194f06137 | |||
| f93ce57d11 | |||
| cc3dcb9979 | |||
| d0c39c4dc6 | |||
| 42b8685182 | |||
| e369cf1917 | |||
| 10dd7a588e | |||
| b733b560b8 | |||
| 55b494a045 | |||
| db7e251b94 | |||
| 76de35c9a0 | |||
| 73a26bb372 | |||
| 7eefa3c800 | |||
| 959dc9dd80 | |||
| 614e3434e8 | |||
| c9d1fa8b0f | |||
| fa756766e5 | |||
| 4f4a9b919f | |||
| d086928ecc | |||
| 6008fb53db | |||
| 3fceca6d87 | |||
| aea05be674 | |||
| b9a9097f95 | |||
| d9dd1e7acf | |||
| 2018e47525 | |||
| d946aa4b4c | |||
| 408595d7e1 | |||
| b924e780c3 | |||
| e3158e02e4 | |||
| a706259322 | |||
| 20f7fe43d2 | |||
| b678d929ff | |||
| 9e5d3c5262 | |||
| cad6720173 | |||
| 0866a310cc | |||
|
|
a35d7d78e1 | ||
| 2128028113 | |||
| cc6a0673b9 | |||
| c859f7f76c | |||
| 1907fb2547 | |||
| 7b20ee2875 | |||
| 513e401099 | |||
| 1b22fe6116 | |||
| c6a056b77c | |||
| 236954d557 | |||
| f1c9e4a6f3 | |||
| c12185af79 | |||
| 57d3c570c0 | |||
| 8d3a4ff778 | |||
| ffb295d858 | |||
| fb3c3d8c19 | |||
| 41abaf2533 | |||
| b83ced88a5 | |||
| 9723753b5b | |||
| d2d2ddace4 | |||
|
|
eb31b393e9 | ||
| d74d7866ff | |||
| 75fdf52586 | |||
|
|
bdb0fd00bd | ||
|
|
2ae40edccc | ||
| 825ff4e770 | |||
| 2b9d974659 | |||
| 2895c33fbc | |||
| 5c3cf1b887 | |||
| a0968ba34a | |||
| 71a0886d46 | |||
|
|
83c9d72afe | ||
|
|
39b45df38e | ||
|
|
55477c5919 | ||
|
|
fd2a274668 | ||
|
|
613f249f64 | ||
|
|
9ac25a152d | ||
|
|
735568adfa | ||
|
|
5a803a578b | ||
|
|
818ac7ef8c | ||
|
|
c22d769ab5 | ||
|
|
96765dbf76 | ||
|
|
6f2e7d20b4 | ||
|
|
b742d63193 | ||
|
|
d78ba65063 | ||
|
|
7231b614fa | ||
|
|
f174a4e558 | ||
|
|
8c18407688 | ||
|
|
a396c0c739 | ||
|
|
d6ecdeb796 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1 +1 @@
|
||||
/*.bundle
|
||||
/venv/
|
||||
|
||||
15
.gitmodules
vendored
15
.gitmodules
vendored
@@ -1,15 +1,6 @@
|
||||
[submodule "contrib/vim-plug"]
|
||||
path = contrib/vim-plug
|
||||
url = https://github.com/junegunn/vim-plug
|
||||
[submodule "ansible_roles/firefox"]
|
||||
path = ansible_roles/firefox
|
||||
url = https://github.com/staticdev/ansible-role-firefox
|
||||
[submodule "pkgbuilds/spotify"]
|
||||
path = pkgbuilds/spotify
|
||||
url = https://aur.archlinux.org/spotify.git
|
||||
[submodule "pkgbuilds/nodejs-intelephense"]
|
||||
path = pkgbuilds/nodejs-intelephense
|
||||
url = https://aur.archlinux.org/nodejs-intelephense.git
|
||||
[submodule "pkgbuilds/portfolio-performance-bin"]
|
||||
path = pkgbuilds/portfolio-performance-bin
|
||||
url = https://aur.archlinux.org/portfolio-performance-bin.git
|
||||
[submodule "pkgbuilds/vim-plug"]
|
||||
path = pkgbuilds/vim-plug
|
||||
url = https://aur.archlinux.org/vim-plug.git
|
||||
|
||||
37
Makefile
37
Makefile
@@ -1,16 +1,17 @@
|
||||
ansible_run = ansible-playbook -e ansible_python_interpreter=/usr/bin/python3 --inventory localhost, --diff ./playbook.yml ${ANSIBLE_EXTRA_ARGS}
|
||||
venv = ./venv
|
||||
requirements = requirements.txt
|
||||
activate = . $(venv)/bin/activate
|
||||
pip = pip
|
||||
ansible = venv/bin/ansible-playbook
|
||||
ansible_run = $(activate) && ansible-playbook -e ansible_python_interpreter=/usr/bin/python3 --inventory localhost, --diff --verbose ./playbook.yml ${ANSIBLE_EXTRA_ARGS}
|
||||
|
||||
.PHONY: all
|
||||
all:
|
||||
all: | venv $(ansible)
|
||||
$(ansible_run)
|
||||
|
||||
.PHONY: config
|
||||
config:
|
||||
$(ansible_run) --skip-tags system-update
|
||||
|
||||
.PHONY: system-update
|
||||
system-update:
|
||||
$(ansible_run) --tags system-update
|
||||
.PHONY: update
|
||||
update: $(ansible)
|
||||
$(ansible_run) --tags update
|
||||
|
||||
.PHONY: reboot
|
||||
reboot:
|
||||
@@ -24,13 +25,27 @@ poweroff:
|
||||
weekend: | update poweroff
|
||||
|
||||
.PHONY: packages
|
||||
packages:
|
||||
packages: $(ansible)
|
||||
$(ansible_run) --tags packages
|
||||
|
||||
.PHONY: dotfiles
|
||||
dotfiles:
|
||||
dotfiles: $(ansible)
|
||||
$(ansible_run) --tags dotfiles
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf venv
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
./test-in-docker.sh
|
||||
|
||||
$(ansible): venv
|
||||
|
||||
venv:
|
||||
python3 -m venv $(venv)
|
||||
$(activate) && $(pip) install -r $(requirements)
|
||||
|
||||
.PHONY: freeze
|
||||
freeze:
|
||||
$(activate) && $(pip) freeze > $(requirements)
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
font_size_1: 12
|
||||
font_size_2: 12
|
||||
font_size: 12
|
||||
|
||||
gpu: amd
|
||||
|
||||
i3bar_icon_padding: " "
|
||||
|
||||
users:
|
||||
- name: hannes
|
||||
vt: 1
|
||||
@@ -18,18 +15,8 @@ users:
|
||||
- i-dont-care-about-cookies
|
||||
- floccus
|
||||
manage_css: true
|
||||
media:
|
||||
extensions:
|
||||
- ublock-origin
|
||||
- passff
|
||||
- privacy-badger17
|
||||
- tree-style-tab
|
||||
- i-dont-care-about-cookies
|
||||
manage_css: true
|
||||
bigger_font: true
|
||||
mail: hannes@hkoerber.de
|
||||
git_gpg_sign: false
|
||||
ssh_agent: false
|
||||
gpg_agent: true
|
||||
gpg_agent_for_ssh: true
|
||||
gpg_key:
|
||||
@@ -39,6 +26,7 @@ users:
|
||||
enable_passwordstore: true
|
||||
environment:
|
||||
MACHINE_HAS_NEXTCLOUD: "true"
|
||||
has_yubikey: true
|
||||
repositories:
|
||||
- personal_projects
|
||||
|
||||
@@ -54,10 +42,12 @@ screen:
|
||||
9: DisplayPort-0
|
||||
0: DisplayPort-0
|
||||
|
||||
screencfgs: []
|
||||
|
||||
workspace:
|
||||
1: ""
|
||||
9: ""
|
||||
10: ""
|
||||
1: www
|
||||
9: comm
|
||||
10: music
|
||||
|
||||
environment:
|
||||
MACHINE_TYPE: "workstation"
|
||||
@@ -65,5 +55,6 @@ environment:
|
||||
MACHINE_HAS_NEXTCLOUD: "true"
|
||||
MACHINE_HAS_STEAM: "true"
|
||||
MACHINE_HAS_RESTIC_BACKUP: "false"
|
||||
MACHINE_HAS_ELEMENT: "true"
|
||||
MACHINE_RESOLUTION_X: "2560"
|
||||
MACHINE_RESOLUTION_Y: "1440"
|
||||
|
||||
90
_machines/mars.yml
Normal file
90
_machines/mars.yml
Normal file
@@ -0,0 +1,90 @@
|
||||
font_size: 12
|
||||
|
||||
users:
|
||||
- name: hannes-work
|
||||
group: hannes-work
|
||||
vt: 1
|
||||
firefox_profiles:
|
||||
default:
|
||||
extensions:
|
||||
- ublock-origin
|
||||
- privacy-badger17
|
||||
- tree-style-tab
|
||||
- i-dont-care-about-cookies
|
||||
manage_css: true
|
||||
meet:
|
||||
extensions:
|
||||
- ublock-origin
|
||||
manage_css: false
|
||||
mail: hannes.koerber@tradebyte.com
|
||||
git_gpg_sign: false
|
||||
gpg_agent: false
|
||||
gpg_agent_for_ssh: false
|
||||
environment:
|
||||
MACHINE_HAS_NEXTCLOUD: "false"
|
||||
MACHINE_HAS_RESTIC_BACKUP: "true"
|
||||
MACHINE_HAS_ELEMENT: "false"
|
||||
MACHINE_HAS_KEEPASSX: "true"
|
||||
has_yubikey: false
|
||||
repositories: []
|
||||
- name: hannes-private
|
||||
group: hannes-private
|
||||
vt: 2
|
||||
firefox_profiles:
|
||||
default:
|
||||
extensions:
|
||||
- ublock-origin
|
||||
- passff
|
||||
- privacy-badger17
|
||||
- tree-style-tab
|
||||
- i-dont-care-about-cookies
|
||||
- floccus
|
||||
manage_css: true
|
||||
mail: hannes@hkoerber.de
|
||||
git_gpg_sign: false
|
||||
gpg_agent: true
|
||||
gpg_agent_for_ssh: true
|
||||
gpg_key:
|
||||
email: hannes@hkoerber.de
|
||||
id: "0xB5C002530C6A2053"
|
||||
fingerprint: "973AE48D71B76735C4712B5BB5C002530C6A2053"
|
||||
enable_passwordstore: true
|
||||
environment:
|
||||
MACHINE_HAS_NEXTCLOUD: "true"
|
||||
MACHINE_HAS_RESTIC_BACKUP: "false"
|
||||
MACHINE_HAS_ELEMENT: "true"
|
||||
MACHINE_HAS_KEEPASSX: "false"
|
||||
has_yubikey: true
|
||||
repositories:
|
||||
- personal_projects
|
||||
|
||||
screen:
|
||||
1: DP-1-1
|
||||
2: DP-1-1
|
||||
3: DP-1-2
|
||||
4: DP-1-2
|
||||
5: DP-1-2
|
||||
6: DP-1-2
|
||||
7: eDP-1
|
||||
8: eDP-1
|
||||
9: eDP-1
|
||||
0: eDP-1
|
||||
|
||||
workspace:
|
||||
1: www
|
||||
2: www
|
||||
3: term-local
|
||||
4: term-remote
|
||||
7: comm
|
||||
8: pass
|
||||
9: music
|
||||
10: pim
|
||||
|
||||
screencfgs:
|
||||
- name: three-screens
|
||||
key: F3
|
||||
|
||||
environment:
|
||||
MACHINE_TYPE: "laptop"
|
||||
MACHINE_RESOLUTION_X: "1920"
|
||||
MACHINE_RESOLUTION_Y: "1080"
|
||||
@@ -1,10 +1,8 @@
|
||||
font_size_1: 12
|
||||
font_size_2: 12
|
||||
|
||||
i3bar_icon_padding: ""
|
||||
font_size: 12
|
||||
|
||||
users:
|
||||
- name: hannes-work
|
||||
group: hannes-work
|
||||
vt: 1
|
||||
firefox_profiles:
|
||||
default:
|
||||
@@ -18,18 +16,19 @@ users:
|
||||
extensions:
|
||||
- ublock-origin
|
||||
manage_css: false
|
||||
mail: h.koerber@clipmyhorse.tv
|
||||
mail: hannes.koerber@tradebyte.com
|
||||
git_gpg_sign: false
|
||||
ssh_agent: true
|
||||
gpg_agent: false
|
||||
gpg_agent_for_ssh: false
|
||||
environment:
|
||||
MACHINE_HAS_NEXTCLOUD: "false"
|
||||
MACHINE_HAS_RESTIC_BACKUP: "false"
|
||||
MACHINE_HAS_KEEPASSX: "false"
|
||||
MACHINE_HAS_RESTIC_BACKUP: "true"
|
||||
MACHINE_HAS_ELEMENT: "false"
|
||||
MACHINE_HAS_KEEPASSX: "true"
|
||||
has_yubikey: false
|
||||
repositories: []
|
||||
|
||||
- name: hannes-private
|
||||
group: hannes-private
|
||||
vt: 2
|
||||
firefox_profiles:
|
||||
default:
|
||||
@@ -43,7 +42,6 @@ users:
|
||||
manage_css: true
|
||||
mail: hannes@hkoerber.de
|
||||
git_gpg_sign: false
|
||||
ssh_agent: false
|
||||
gpg_agent: true
|
||||
gpg_agent_for_ssh: true
|
||||
gpg_key:
|
||||
@@ -54,33 +52,39 @@ users:
|
||||
environment:
|
||||
MACHINE_HAS_NEXTCLOUD: "true"
|
||||
MACHINE_HAS_RESTIC_BACKUP: "false"
|
||||
MACHINE_HAS_ELEMENT: "true"
|
||||
MACHINE_HAS_KEEPASSX: "false"
|
||||
has_yubikey: true
|
||||
repositories:
|
||||
- personal_projects
|
||||
|
||||
screen:
|
||||
1: DP-4-1-6
|
||||
2: DP-4-1-6
|
||||
3: DP-4-1-6
|
||||
4: DP-4-1-6
|
||||
5: DP-4-1-6
|
||||
6: DP-4-1-6
|
||||
1: DP-1-1
|
||||
2: DP-1-1
|
||||
3: DP-1-2
|
||||
4: DP-1-2
|
||||
5: DP-1-2
|
||||
6: DP-1-2
|
||||
7: eDP-1
|
||||
8: eDP-1
|
||||
9: eDP-1
|
||||
0: eDP-1
|
||||
|
||||
workspace:
|
||||
1: ""
|
||||
2: ""
|
||||
3: ""
|
||||
4: ""
|
||||
7: ""
|
||||
8: ""
|
||||
9: ""
|
||||
10: ""
|
||||
1: www
|
||||
2: www
|
||||
3: term-local
|
||||
4: term-remote
|
||||
7: comm
|
||||
8: pass
|
||||
9: music
|
||||
10: pim
|
||||
|
||||
screencfgs:
|
||||
- name: three-screens
|
||||
key: F3
|
||||
|
||||
environment:
|
||||
MACHINE_TYPE: "laptop"
|
||||
MACHINE_RESOLUTION_X: "1920"
|
||||
MACHINE_RESOLUTION_Y: "1200"
|
||||
MACHINE_RESOLUTION_Y: "1080"
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
live_config_reload = false
|
||||
|
||||
[colors.bright]
|
||||
black = "#75715E"
|
||||
blue = "#66D9EF"
|
||||
cyan = "#A1EFE4"
|
||||
green = "#A6E22E"
|
||||
magenta = "#AE81FF"
|
||||
red = "#F92672"
|
||||
white = "#F9F8F5"
|
||||
yellow = "#F4BF75"
|
||||
|
||||
[colors.normal]
|
||||
black = "#000000"
|
||||
blue = "#66D9EF"
|
||||
cyan = "#A1EFE4"
|
||||
green = "#A6E22E"
|
||||
magenta = "#AE81FF"
|
||||
red = "#F92672"
|
||||
white = "#F8F8F2"
|
||||
yellow = "#F4BF75"
|
||||
|
||||
[colors.primary]
|
||||
background = "#272822"
|
||||
foreground = "#F8F8F2"
|
||||
|
||||
[env]
|
||||
TERM = "alacritty"
|
||||
|
||||
[font]
|
||||
size = {{ machine.font_size_2 }}
|
||||
|
||||
[font.bold]
|
||||
family = "Inconsolata"
|
||||
style = "Bold"
|
||||
|
||||
[font.bold_italic]
|
||||
family = "Inconsolata"
|
||||
style = "Bold Italic"
|
||||
|
||||
[font.italic]
|
||||
family = "Inconsolata"
|
||||
style = "Italic"
|
||||
|
||||
[font.normal]
|
||||
family = "Inconsolata"
|
||||
style = "Regular"
|
||||
|
||||
[selection]
|
||||
save_to_clipboard = true
|
||||
|
||||
[window]
|
||||
dynamic_title = true
|
||||
title = "[terminal]"
|
||||
|
||||
[window.padding]
|
||||
x = 3
|
||||
y = 3
|
||||
702
alacritty/alacritty.yml.j2
Normal file
702
alacritty/alacritty.yml.j2
Normal file
@@ -0,0 +1,702 @@
|
||||
# Configuration for Alacritty, the GPU enhanced terminal emulator.
|
||||
|
||||
# Import additional configuration files
|
||||
#
|
||||
# Imports are loaded in order, skipping all missing files, with the importing
|
||||
# file being loaded last. If a field is already present in a previous import, it
|
||||
# will be replaced.
|
||||
#
|
||||
# All imports must either be absolute paths starting with `/`, or paths relative
|
||||
# to the user's home directory starting with `~/`.
|
||||
#import:
|
||||
# - /path/to/alacritty.yml
|
||||
|
||||
# Any items in the `env` entry below will be added as
|
||||
# environment variables. Some entries may override variables
|
||||
# set by alacritty itself.
|
||||
env:
|
||||
# TERM variable
|
||||
#
|
||||
# This value is used to set the `$TERM` environment variable for
|
||||
# each instance of Alacritty. If it is not present, alacritty will
|
||||
# check the local terminfo database and use `alacritty` if it is
|
||||
# available, otherwise `xterm-256color` is used.
|
||||
TERM: xterm-256color
|
||||
|
||||
window:
|
||||
# Window dimensions (changes require restart)
|
||||
#
|
||||
# Number of lines/columns (not pixels) in the terminal. The number of columns
|
||||
# must be at least `2`, while using a value of `0` for columns and lines will
|
||||
# fall back to the window manager's recommended size.
|
||||
#dimensions:
|
||||
# columns: 0
|
||||
# lines: 0
|
||||
|
||||
# Window position (changes require restart)
|
||||
#
|
||||
# Specified in number of pixels.
|
||||
# If the position is not set, the window manager will handle the placement.
|
||||
#position:
|
||||
# x: 0
|
||||
# y: 0
|
||||
|
||||
# Window padding (changes require restart)
|
||||
#
|
||||
# Blank space added around the window in pixels. This padding is scaled
|
||||
# by DPI and the specified value is always added at both opposing sides.
|
||||
padding:
|
||||
x: 3
|
||||
y: 3
|
||||
|
||||
# Spread additional padding evenly around the terminal content.
|
||||
#dynamic_padding: false
|
||||
|
||||
# Window decorations
|
||||
#
|
||||
# Values for `decorations`:
|
||||
# - full: Borders and title bar
|
||||
# - none: Neither borders nor title bar
|
||||
#
|
||||
# Values for `decorations` (macOS only):
|
||||
# - transparent: Title bar, transparent background and title bar buttons
|
||||
# - buttonless: Title bar, transparent background and no title bar buttons
|
||||
#decorations: full
|
||||
|
||||
# Startup Mode (changes require restart)
|
||||
#
|
||||
# Values for `startup_mode`:
|
||||
# - Windowed
|
||||
# - Maximized
|
||||
# - Fullscreen
|
||||
#
|
||||
# Values for `startup_mode` (macOS only):
|
||||
# - SimpleFullscreen
|
||||
#startup_mode: Windowed
|
||||
|
||||
# Window title
|
||||
title: "[terminal]"
|
||||
|
||||
# Allow terminal applications to change Alacritty's window title.
|
||||
dynamic_title: true
|
||||
|
||||
# Window class (Linux/BSD only):
|
||||
#class:
|
||||
# Application instance name
|
||||
#instance: Alacritty
|
||||
# General application class
|
||||
#general: Alacritty
|
||||
|
||||
# GTK theme variant (Linux/BSD only)
|
||||
#
|
||||
# Override the variant of the GTK theme. Commonly supported values are `dark`
|
||||
# and `light`. Set this to `None` to use the default theme variant.
|
||||
#gtk_theme_variant: None
|
||||
|
||||
#scrolling:
|
||||
# Maximum number of lines in the scrollback buffer.
|
||||
# Specifying '0' will disable scrolling.
|
||||
#history: 10000
|
||||
|
||||
# Scrolling distance multiplier.
|
||||
#multiplier: 3
|
||||
|
||||
# Font configuration
|
||||
font:
|
||||
# Normal (roman) font face
|
||||
normal:
|
||||
# Font family
|
||||
#
|
||||
# Default:
|
||||
# - (macOS) Menlo
|
||||
# - (Linux/BSD) monospace
|
||||
# - (Windows) Consolas
|
||||
family: Inconsolata
|
||||
|
||||
# The `style` can be specified to pick a specific face.
|
||||
style: Regular
|
||||
|
||||
# Bold font face
|
||||
bold:
|
||||
# Font family
|
||||
#
|
||||
# If the bold family is not specified, it will fall back to the
|
||||
# value specified for the normal font.
|
||||
family: Inconsolata
|
||||
|
||||
# The `style` can be specified to pick a specific face.
|
||||
style: Bold
|
||||
|
||||
# Italic font face
|
||||
italic:
|
||||
# Font family
|
||||
#
|
||||
# If the italic family is not specified, it will fall back to the
|
||||
# value specified for the normal font.
|
||||
family: Inconsolata
|
||||
|
||||
# The `style` can be specified to pick a specific face.
|
||||
style: Italic
|
||||
|
||||
# Bold italic font face
|
||||
bold_italic:
|
||||
# Font family
|
||||
#
|
||||
# If the bold italic family is not specified, it will fall back to the
|
||||
# value specified for the normal font.
|
||||
family: Inconsolata
|
||||
|
||||
# The `style` can be specified to pick a specific face.
|
||||
style: Bold Italic
|
||||
|
||||
# Point size
|
||||
size: {{ machine.font_size }}
|
||||
|
||||
# Offset is the extra space around each character. `offset.y` can be thought
|
||||
# of as modifying the line spacing, and `offset.x` as modifying the letter
|
||||
# spacing.
|
||||
#offset:
|
||||
# x: 0
|
||||
# y: 0
|
||||
|
||||
# Glyph offset determines the locations of the glyphs within their cells with
|
||||
# the default being at the bottom. Increasing `x` moves the glyph to the
|
||||
# right, increasing `y` moves the glyph upward.
|
||||
#glyph_offset:
|
||||
# x: 0
|
||||
# y: 0
|
||||
|
||||
# Thin stroke font rendering (macOS only)
|
||||
#
|
||||
# Thin strokes are suitable for retina displays, but for non-retina screens
|
||||
# it is recommended to set `use_thin_strokes` to `false`.
|
||||
#use_thin_strokes: true
|
||||
|
||||
# If `true`, bold text is drawn using the bright color variants.
|
||||
#draw_bold_text_with_bright_colors: false
|
||||
|
||||
# Colors (Monokai Dark)
|
||||
colors:
|
||||
# Default colors
|
||||
primary:
|
||||
background: '#272822'
|
||||
foreground: '#F8F8F2'
|
||||
|
||||
# Normal colors
|
||||
normal:
|
||||
black: '#272822'
|
||||
red: '#F92672'
|
||||
green: '#A6E22E'
|
||||
yellow: '#F4BF75'
|
||||
blue: '#66D9EF'
|
||||
magenta: '#AE81FF'
|
||||
cyan: '#A1EFE4'
|
||||
white: '#F8F8F2'
|
||||
|
||||
# Bright colors
|
||||
bright:
|
||||
black: '#75715E'
|
||||
red: '#F92672'
|
||||
green: '#A6E22E'
|
||||
yellow: '#F4BF75'
|
||||
blue: '#66D9EF'
|
||||
magenta: '#AE81FF'
|
||||
cyan: '#A1EFE4'
|
||||
white: '#F9F8F5'
|
||||
|
||||
# Bell
|
||||
#
|
||||
# The bell is rung every time the BEL control character is received.
|
||||
#bell:
|
||||
# Visual Bell Animation
|
||||
#
|
||||
# Animation effect for flashing the screen when the visual bell is rung.
|
||||
#
|
||||
# Values for `animation`:
|
||||
# - Ease
|
||||
# - EaseOut
|
||||
# - EaseOutSine
|
||||
# - EaseOutQuad
|
||||
# - EaseOutCubic
|
||||
# - EaseOutQuart
|
||||
# - EaseOutQuint
|
||||
# - EaseOutExpo
|
||||
# - EaseOutCirc
|
||||
# - Linear
|
||||
#animation: EaseOutExpo
|
||||
|
||||
# Duration of the visual bell flash in milliseconds. A `duration` of `0` will
|
||||
# disable the visual bell animation.
|
||||
#duration: 0
|
||||
|
||||
# Visual bell animation color.
|
||||
#color: '#ffffff'
|
||||
|
||||
# Bell Command
|
||||
#
|
||||
# This program is executed whenever the bell is rung.
|
||||
#
|
||||
# When set to `command: None`, no command will be executed.
|
||||
#
|
||||
# Example:
|
||||
# command:
|
||||
# program: notify-send
|
||||
# args: ["Hello, World!"]
|
||||
#
|
||||
#command: None
|
||||
|
||||
# Background opacity
|
||||
#
|
||||
# Window opacity as a floating point number from `0.0` to `1.0`.
|
||||
# The value `0.0` is completely transparent and `1.0` is opaque.
|
||||
#background_opacity: 1.0
|
||||
|
||||
selection:
|
||||
# This string contains all characters that are used as separators for
|
||||
# "semantic words" in Alacritty.
|
||||
#semantic_escape_chars: ",│`|:\"' ()[]{}<>\t"
|
||||
|
||||
# When set to `true`, selected text will be copied to the primary clipboard.
|
||||
save_to_clipboard: true
|
||||
|
||||
#cursor:
|
||||
# Cursor style
|
||||
#style:
|
||||
# Cursor shape
|
||||
#
|
||||
# Values for `shape`:
|
||||
# - ▇ Block
|
||||
# - _ Underline
|
||||
# - | Beam
|
||||
#shape: Block
|
||||
|
||||
# Cursor blinking state
|
||||
#
|
||||
# Values for `blinking`:
|
||||
# - Never: Prevent the cursor from ever blinking
|
||||
# - Off: Disable blinking by default
|
||||
# - On: Enable blinking by default
|
||||
# - Always: Force the cursor to always blink
|
||||
#blinking: Off
|
||||
|
||||
# Vi mode cursor style
|
||||
#
|
||||
# If the vi mode cursor style is `None` or not specified, it will fall back to
|
||||
# the style of the active value of the normal cursor.
|
||||
#
|
||||
# See `cursor.style` for available options.
|
||||
#vi_mode_style: None
|
||||
|
||||
# Cursor blinking interval in milliseconds.
|
||||
#blink_interval: 750
|
||||
|
||||
# If this is `true`, the cursor will be rendered as a hollow box when the
|
||||
# window is not focused.
|
||||
#unfocused_hollow: true
|
||||
|
||||
# Thickness of the cursor relative to the cell width as floating point number
|
||||
# from `0.0` to `1.0`.
|
||||
#thickness: 0.15
|
||||
|
||||
# Live config reload (changes require restart)
|
||||
live_config_reload: false
|
||||
|
||||
# Shell
|
||||
#
|
||||
# You can set `shell.program` to the path of your favorite shell, e.g.
|
||||
# `/bin/fish`. Entries in `shell.args` are passed unmodified as arguments to the
|
||||
# shell.
|
||||
#
|
||||
# Default:
|
||||
# - (macOS) /bin/bash --login
|
||||
# - (Linux/BSD) user login shell
|
||||
# - (Windows) powershell
|
||||
#shell:
|
||||
# program: /bin/bash
|
||||
# args:
|
||||
# - --login
|
||||
|
||||
# Startup directory
|
||||
#
|
||||
# Directory the shell is started in. If this is unset, or `None`, the working
|
||||
# directory of the parent process will be used.
|
||||
#working_directory: None
|
||||
|
||||
# WinPTY backend (Windows only)
|
||||
#
|
||||
# Alacritty defaults to using the newer ConPTY backend if it is available,
|
||||
# since it resolves a lot of bugs and is quite a bit faster. If it is not
|
||||
# available, the WinPTY backend will be used instead.
|
||||
#
|
||||
# Setting this option to `true` makes Alacritty use the legacy WinPTY backend,
|
||||
# even if the ConPTY backend is available.
|
||||
#winpty_backend: false
|
||||
|
||||
# Send ESC (\x1b) before characters when alt is pressed.
|
||||
#alt_send_esc: true
|
||||
|
||||
#mouse:
|
||||
# Click settings
|
||||
#
|
||||
# The `double_click` and `triple_click` settings control the time
|
||||
# alacritty should wait for accepting multiple clicks as one double
|
||||
# or triple click.
|
||||
#double_click: { threshold: 300 }
|
||||
#triple_click: { threshold: 300 }
|
||||
|
||||
# If this is `true`, the cursor is temporarily hidden when typing.
|
||||
#hide_when_typing: false
|
||||
|
||||
#url:
|
||||
# URL launcher
|
||||
#
|
||||
# This program is executed when clicking on a text which is recognized as a
|
||||
# URL. The URL is always added to the command as the last parameter.
|
||||
#
|
||||
# When set to `launcher: None`, URL launching will be disabled completely.
|
||||
#
|
||||
# Default:
|
||||
# - (macOS) open
|
||||
# - (Linux/BSD) xdg-open
|
||||
# - (Windows) explorer
|
||||
#launcher:
|
||||
# program: xdg-open
|
||||
# args: []
|
||||
|
||||
# URL modifiers
|
||||
#
|
||||
# These are the modifiers that need to be held down for opening URLs when
|
||||
# clicking on them. The available modifiers are documented in the key
|
||||
# binding section.
|
||||
#modifiers: None
|
||||
|
||||
# Mouse bindings
|
||||
#
|
||||
# Mouse bindings are specified as a list of objects, much like the key
|
||||
# bindings further below.
|
||||
#
|
||||
# To trigger mouse bindings when an application running within Alacritty
|
||||
# captures the mouse, the `Shift` modifier is automatically added as a
|
||||
# requirement.
|
||||
#
|
||||
# Each mouse binding will specify a:
|
||||
#
|
||||
# - `mouse`:
|
||||
#
|
||||
# - Middle
|
||||
# - Left
|
||||
# - Right
|
||||
# - Numeric identifier such as `5`
|
||||
#
|
||||
# - `action` (see key bindings)
|
||||
#
|
||||
# And optionally:
|
||||
#
|
||||
# - `mods` (see key bindings)
|
||||
#mouse_bindings:
|
||||
# - { mouse: Middle, action: PasteSelection }
|
||||
|
||||
# Key bindings
|
||||
#
|
||||
# Key bindings are specified as a list of objects. For example, this is the
|
||||
# default paste binding:
|
||||
#
|
||||
# `- { key: V, mods: Control|Shift, action: Paste }`
|
||||
#
|
||||
# Each key binding will specify a:
|
||||
#
|
||||
# - `key`: Identifier of the key pressed
|
||||
#
|
||||
# - A-Z
|
||||
# - F1-F24
|
||||
# - Key0-Key9
|
||||
#
|
||||
# A full list with available key codes can be found here:
|
||||
# https://docs.rs/glutin/*/glutin/event/enum.VirtualKeyCode.html#variants
|
||||
#
|
||||
# Instead of using the name of the keys, the `key` field also supports using
|
||||
# the scancode of the desired key. Scancodes have to be specified as a
|
||||
# decimal number. This command will allow you to display the hex scancodes
|
||||
# for certain keys:
|
||||
#
|
||||
# `showkey --scancodes`.
|
||||
#
|
||||
# Then exactly one of:
|
||||
#
|
||||
# - `chars`: Send a byte sequence to the running application
|
||||
#
|
||||
# The `chars` field writes the specified string to the terminal. This makes
|
||||
# it possible to pass escape sequences. To find escape codes for bindings
|
||||
# like `PageUp` (`"\x1b[5~"`), you can run the command `showkey -a` outside
|
||||
# of tmux. Note that applications use terminfo to map escape sequences back
|
||||
# to keys. It is therefore required to update the terminfo when changing an
|
||||
# escape sequence.
|
||||
#
|
||||
# - `action`: Execute a predefined action
|
||||
#
|
||||
# - ToggleViMode
|
||||
# - SearchForward
|
||||
# Start searching toward the right of the search origin.
|
||||
# - SearchBackward
|
||||
# Start searching toward the left of the search origin.
|
||||
# - Copy
|
||||
# - Paste
|
||||
# - IncreaseFontSize
|
||||
# - DecreaseFontSize
|
||||
# - ResetFontSize
|
||||
# - ScrollPageUp
|
||||
# - ScrollPageDown
|
||||
# - ScrollHalfPageUp
|
||||
# - ScrollHalfPageDown
|
||||
# - ScrollLineUp
|
||||
# - ScrollLineDown
|
||||
# - ScrollToTop
|
||||
# - ScrollToBottom
|
||||
# - ClearHistory
|
||||
# Remove the terminal's scrollback history.
|
||||
# - Hide
|
||||
# Hide the Alacritty window.
|
||||
# - Minimize
|
||||
# Minimize the Alacritty window.
|
||||
# - Quit
|
||||
# Quit Alacritty.
|
||||
# - ToggleFullscreen
|
||||
# - SpawnNewInstance
|
||||
# Spawn a new instance of Alacritty.
|
||||
# - ClearLogNotice
|
||||
# Clear Alacritty's UI warning and error notice.
|
||||
# - ClearSelection
|
||||
# Remove the active selection.
|
||||
# - ReceiveChar
|
||||
# - None
|
||||
#
|
||||
# - Vi mode exclusive actions:
|
||||
#
|
||||
# - Open
|
||||
# Open URLs at the cursor location with the launcher configured in
|
||||
# `url.launcher`.
|
||||
# - ToggleNormalSelection
|
||||
# - ToggleLineSelection
|
||||
# - ToggleBlockSelection
|
||||
# - ToggleSemanticSelection
|
||||
# Toggle semantic selection based on `selection.semantic_escape_chars`.
|
||||
#
|
||||
# - Vi mode exclusive cursor motion actions:
|
||||
#
|
||||
# - Up
|
||||
# One line up.
|
||||
# - Down
|
||||
# One line down.
|
||||
# - Left
|
||||
# One character left.
|
||||
# - Right
|
||||
# One character right.
|
||||
# - First
|
||||
# First column, or beginning of the line when already at the first column.
|
||||
# - Last
|
||||
# Last column, or beginning of the line when already at the last column.
|
||||
# - FirstOccupied
|
||||
# First non-empty cell in this terminal row, or first non-empty cell of
|
||||
# the line when already at the first cell of the row.
|
||||
# - High
|
||||
# Top of the screen.
|
||||
# - Middle
|
||||
# Center of the screen.
|
||||
# - Low
|
||||
# Bottom of the screen.
|
||||
# - SemanticLeft
|
||||
# Start of the previous semantically separated word.
|
||||
# - SemanticRight
|
||||
# Start of the next semantically separated word.
|
||||
# - SemanticLeftEnd
|
||||
# End of the previous semantically separated word.
|
||||
# - SemanticRightEnd
|
||||
# End of the next semantically separated word.
|
||||
# - WordLeft
|
||||
# Start of the previous whitespace separated word.
|
||||
# - WordRight
|
||||
# Start of the next whitespace separated word.
|
||||
# - WordLeftEnd
|
||||
# End of the previous whitespace separated word.
|
||||
# - WordRightEnd
|
||||
# End of the next whitespace separated word.
|
||||
# - Bracket
|
||||
# Character matching the bracket at the cursor's location.
|
||||
# - SearchNext
|
||||
# Beginning of the next match.
|
||||
# - SearchPrevious
|
||||
# Beginning of the previous match.
|
||||
# - SearchStart
|
||||
# Start of the match to the left of the vi mode cursor.
|
||||
# - SearchEnd
|
||||
# End of the match to the right of the vi mode cursor.
|
||||
#
|
||||
# - macOS exclusive actions:
|
||||
# - ToggleSimpleFullscreen
|
||||
# Enter fullscreen without occupying another space.
|
||||
#
|
||||
# - Linux/BSD exclusive actions:
|
||||
#
|
||||
# - CopySelection
|
||||
# Copy from the selection buffer.
|
||||
# - PasteSelection
|
||||
# Paste from the selection buffer.
|
||||
#
|
||||
# - `command`: Fork and execute a specified command plus arguments
|
||||
#
|
||||
# The `command` field must be a map containing a `program` string and an
|
||||
# `args` array of command line parameter strings. For example:
|
||||
# `{ program: "alacritty", args: ["-e", "vttest"] }`
|
||||
#
|
||||
# And optionally:
|
||||
#
|
||||
# - `mods`: Key modifiers to filter binding actions
|
||||
#
|
||||
# - Command
|
||||
# - Control
|
||||
# - Option
|
||||
# - Super
|
||||
# - Shift
|
||||
# - Alt
|
||||
#
|
||||
# Multiple `mods` can be combined using `|` like this:
|
||||
# `mods: Control|Shift`.
|
||||
# Whitespace and capitalization are relevant and must match the example.
|
||||
#
|
||||
# - `mode`: Indicate a binding for only specific terminal reported modes
|
||||
#
|
||||
# This is mainly used to send applications the correct escape sequences
|
||||
# when in different modes.
|
||||
#
|
||||
# - AppCursor
|
||||
# - AppKeypad
|
||||
# - Alt
|
||||
# - Vi
|
||||
#
|
||||
# A `~` operator can be used before a mode to apply the binding whenever
|
||||
# the mode is *not* active, e.g. `~Alt`.
|
||||
#
|
||||
# Bindings are always filled by default, but will be replaced when a new
|
||||
# binding with the same triggers is defined. To unset a default binding, it can
|
||||
# be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for
|
||||
# a no-op if you do not wish to receive input characters for that binding.
|
||||
#
|
||||
# If the same trigger is assigned to multiple actions, all of them are executed
|
||||
# in the order they were defined in.
|
||||
#key_bindings:
|
||||
#- { key: Paste, action: Paste }
|
||||
#- { key: Copy, action: Copy }
|
||||
#- { key: L, mods: Control, action: ClearLogNotice }
|
||||
#- { key: L, mods: Control, mode: ~Vi, chars: "\x0c" }
|
||||
#- { key: PageUp, mods: Shift, mode: ~Alt, action: ScrollPageUp, }
|
||||
#- { key: PageDown, mods: Shift, mode: ~Alt, action: ScrollPageDown }
|
||||
#- { key: Home, mods: Shift, mode: ~Alt, action: ScrollToTop, }
|
||||
#- { key: End, mods: Shift, mode: ~Alt, action: ScrollToBottom }
|
||||
|
||||
# Vi Mode
|
||||
#- { key: Space, mods: Shift|Control, mode: Vi, action: ScrollToBottom }
|
||||
#- { key: Space, mods: Shift|Control, action: ToggleViMode }
|
||||
#- { key: Escape, mode: Vi, action: ClearSelection }
|
||||
#- { key: I, mode: Vi, action: ScrollToBottom }
|
||||
#- { key: I, mode: Vi, action: ToggleViMode }
|
||||
#- { key: C, mods: Control, mode: Vi, action: ToggleViMode }
|
||||
#- { key: Y, mods: Control, mode: Vi, action: ScrollLineUp }
|
||||
#- { key: E, mods: Control, mode: Vi, action: ScrollLineDown }
|
||||
#- { key: G, mode: Vi, action: ScrollToTop }
|
||||
#- { key: G, mods: Shift, mode: Vi, action: ScrollToBottom }
|
||||
#- { key: B, mods: Control, mode: Vi, action: ScrollPageUp }
|
||||
#- { key: F, mods: Control, mode: Vi, action: ScrollPageDown }
|
||||
#- { key: U, mods: Control, mode: Vi, action: ScrollHalfPageUp }
|
||||
#- { key: D, mods: Control, mode: Vi, action: ScrollHalfPageDown }
|
||||
#- { key: Y, mode: Vi, action: Copy }
|
||||
#- { key: Y, mode: Vi, action: ClearSelection }
|
||||
#- { key: Copy, mode: Vi, action: ClearSelection }
|
||||
#- { key: V, mode: Vi, action: ToggleNormalSelection }
|
||||
#- { key: V, mods: Shift, mode: Vi, action: ToggleLineSelection }
|
||||
#- { key: V, mods: Control, mode: Vi, action: ToggleBlockSelection }
|
||||
#- { key: V, mods: Alt, mode: Vi, action: ToggleSemanticSelection }
|
||||
#- { key: Return, mode: Vi, action: Open }
|
||||
#- { key: K, mode: Vi, action: Up }
|
||||
#- { key: J, mode: Vi, action: Down }
|
||||
#- { key: H, mode: Vi, action: Left }
|
||||
#- { key: L, mode: Vi, action: Right }
|
||||
#- { key: Up, mode: Vi, action: Up }
|
||||
#- { key: Down, mode: Vi, action: Down }
|
||||
#- { key: Left, mode: Vi, action: Left }
|
||||
#- { key: Right, mode: Vi, action: Right }
|
||||
#- { key: Key0, mode: Vi, action: First }
|
||||
#- { key: Key4, mods: Shift, mode: Vi, action: Last }
|
||||
#- { key: Key6, mods: Shift, mode: Vi, action: FirstOccupied }
|
||||
#- { key: H, mods: Shift, mode: Vi, action: High }
|
||||
#- { key: M, mods: Shift, mode: Vi, action: Middle }
|
||||
#- { key: L, mods: Shift, mode: Vi, action: Low }
|
||||
#- { key: B, mode: Vi, action: SemanticLeft }
|
||||
#- { key: W, mode: Vi, action: SemanticRight }
|
||||
#- { key: E, mode: Vi, action: SemanticRightEnd }
|
||||
#- { key: B, mods: Shift, mode: Vi, action: WordLeft }
|
||||
#- { key: W, mods: Shift, mode: Vi, action: WordRight }
|
||||
#- { key: E, mods: Shift, mode: Vi, action: WordRightEnd }
|
||||
#- { key: Key5, mods: Shift, mode: Vi, action: Bracket }
|
||||
#- { key: Slash, mode: Vi, action: SearchForward }
|
||||
#- { key: Slash, mods: Shift, mode: Vi, action: SearchBackward }
|
||||
#- { key: N, mode: Vi, action: SearchNext }
|
||||
#- { key: N, mods: Shift, mode: Vi, action: SearchPrevious }
|
||||
|
||||
# (Windows, Linux, and BSD only)
|
||||
#- { key: V, mods: Control|Shift, action: Paste }
|
||||
#- { key: C, mods: Control|Shift, action: Copy }
|
||||
#- { key: F, mods: Control|Shift, action: SearchForward }
|
||||
#- { key: B, mods: Control|Shift, action: SearchBackward }
|
||||
#- { key: C, mods: Control|Shift, mode: Vi, action: ClearSelection }
|
||||
#- { key: Insert, mods: Shift, action: PasteSelection }
|
||||
#- { key: Key0, mods: Control, action: ResetFontSize }
|
||||
#- { key: Equals, mods: Control, action: IncreaseFontSize }
|
||||
#- { key: Plus, mods: Control, action: IncreaseFontSize }
|
||||
#- { key: NumpadAdd, mods: Control, action: IncreaseFontSize }
|
||||
#- { key: Minus, mods: Control, action: DecreaseFontSize }
|
||||
#- { key: NumpadSubtract, mods: Control, action: DecreaseFontSize }
|
||||
|
||||
# (Windows only)
|
||||
#- { key: Return, mods: Alt, action: ToggleFullscreen }
|
||||
|
||||
# (macOS only)
|
||||
#- { key: K, mods: Command, mode: ~Vi, chars: "\x0c" }
|
||||
#- { key: Key0, mods: Command, action: ResetFontSize }
|
||||
#- { key: Equals, mods: Command, action: IncreaseFontSize }
|
||||
#- { key: Plus, mods: Command, action: IncreaseFontSize }
|
||||
#- { key: NumpadAdd, mods: Command, action: IncreaseFontSize }
|
||||
#- { key: Minus, mods: Command, action: DecreaseFontSize }
|
||||
#- { key: NumpadSubtract, mods: Command, action: DecreaseFontSize }
|
||||
#- { key: K, mods: Command, action: ClearHistory }
|
||||
#- { key: V, mods: Command, action: Paste }
|
||||
#- { key: C, mods: Command, action: Copy }
|
||||
#- { key: C, mods: Command, mode: Vi, action: ClearSelection }
|
||||
#- { key: H, mods: Command, action: Hide }
|
||||
#- { key: M, mods: Command, action: Minimize }
|
||||
#- { key: Q, mods: Command, action: Quit }
|
||||
#- { key: W, mods: Command, action: Quit }
|
||||
#- { key: N, mods: Command, action: SpawnNewInstance }
|
||||
#- { key: F, mods: Command|Control, action: ToggleFullscreen }
|
||||
#- { key: F, mods: Command, action: SearchForward }
|
||||
#- { key: B, mods: Command, action: SearchBackward }
|
||||
|
||||
#debug:
|
||||
# Display the time it takes to redraw each frame.
|
||||
#render_timer: false
|
||||
|
||||
# Keep the log file after quitting Alacritty.
|
||||
#persistent_logging: false
|
||||
|
||||
# Log level
|
||||
#
|
||||
# Values for `log_level`:
|
||||
# - None
|
||||
# - Error
|
||||
# - Warn
|
||||
# - Info
|
||||
# - Debug
|
||||
# - Trace
|
||||
#log_level: Warn
|
||||
|
||||
# Print all received window events.
|
||||
#print_events: false
|
||||
Submodule ansible_roles/firefox updated: 2151dce632...fe50549acc
@@ -2,17 +2,12 @@
|
||||
BindsTo=windowmanager.target
|
||||
After=windowmanager.target
|
||||
|
||||
Wants=blueman.service
|
||||
Wants=dpms.service
|
||||
Wants=dunst.service
|
||||
{% for profile, config in (user.firefox_profiles|default({})).items() %}
|
||||
{% if config.bigger_font|default(false) is sameas false %}
|
||||
Wants=element.service
|
||||
{% for profile in (user.firefox_profiles|default({})).keys() %}
|
||||
Wants=firefox@{{ profile }}.service
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% for profile, config in (user.firefox_profiles|default({})).items() %}
|
||||
{% if config.bigger_font|default(false) is sameas true %}
|
||||
Wants=firefox-gtk-override-bigger-font@{{ profile }}.service
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
Wants=gpg-agent.service
|
||||
Wants=gnome-keyring.service
|
||||
@@ -24,10 +19,10 @@ Wants=nm-applet.service
|
||||
Wants=pasystray.service
|
||||
Wants=redshift.service
|
||||
Wants=restic.timer
|
||||
Wants=screencfg.service
|
||||
Wants=spotify.service
|
||||
Wants=steam.service
|
||||
Wants=touchpad.service
|
||||
Wants=xresources.service
|
||||
Wants=yubikey-touch-detector.service
|
||||
Wants=kdeconnect.service
|
||||
|
||||
|
||||
@@ -3,6 +3,6 @@ BindsTo=autostart.target
|
||||
After=windowmanager.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/env kdeconnect-indicator
|
||||
ExecStart=/usr/bin/env blueman-applet
|
||||
PassEnvironment=DISPLAY
|
||||
Restart=always
|
||||
@@ -5,5 +5,6 @@ After=windowmanager.target
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/env xset s off
|
||||
ExecStart=/usr/bin/env xset dpms 0 0 0
|
||||
ExecStart=/usr/bin/env xset dpms 0 0 300
|
||||
PassEnvironment=DISPLAY
|
||||
Restart=always
|
||||
|
||||
11
autostart/services/element.service
Normal file
11
autostart/services/element.service
Normal file
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
BindsTo=autostart.target
|
||||
After=windowmanager.target
|
||||
After=i3.service
|
||||
|
||||
ConditionPathExists=%h/.var/run/features/element
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/env element-desktop
|
||||
PassEnvironment=DISPLAY
|
||||
Restart=always
|
||||
@@ -1,9 +0,0 @@
|
||||
[Unit]
|
||||
BindsTo=autostart.target
|
||||
After=windowmanager.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/env firefox --setDefaultBrowser -P %i
|
||||
PassEnvironment=DISPLAY
|
||||
Environment=XDG_CONFIG_HOME=%h/.config/gtk-3.0-overrides/bigger-font/
|
||||
Restart=always
|
||||
@@ -1,11 +1,10 @@
|
||||
[Unit]
|
||||
BindsTo=autostart.target
|
||||
After=windowmanager.target
|
||||
ConditionPathExists=%t/features/gpg_agent
|
||||
ConditionPathExists=%h/.var/run/features/gpg_agent
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
ExecStart=/usr/bin/env gpg-agent --daemon
|
||||
PassEnvironment=DISPLAY GNUPGHOME
|
||||
|
||||
ExecStart=/usr/bin/env gpg-agent --homedir %h/.gnupg --no-detach --daemon
|
||||
PassEnvironment=DISPLAY
|
||||
Restart=always
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/env i3 --config %h/.config/i3/config
|
||||
ExecStart=/usr/bin/env i3 --config %h/.i3/config
|
||||
PassEnvironment=DISPLAY
|
||||
|
||||
Restart=no
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Unit]
|
||||
BindsTo=autostart.target
|
||||
After=windowmanager.target
|
||||
ConditionPathExists=%t/features/keepassx
|
||||
ConditionPathExists=%h/.var/run/features/keepassx
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/env keepassx --keyfile %h/.secret/main.key %h/.secret/main.kdbx
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
[Unit]
|
||||
BindsTo=autostart.target
|
||||
After=windowmanager.target
|
||||
ConditionPathExists=%t/features/machine_is_laptop
|
||||
ConditionPathExists=%h/.var/run/features/machine_is_laptop
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/env bash -c 'grep "^${ACPI_LID_NAME}.*enabled" /proc/acpi/wakeup && echo " ${ACPI_LID_NAME}" | sudo tee /proc/acpi/wakeup || true'
|
||||
ExecStart=/usr/bin/env bash -c 'grep "^${ACPI_LID_NAME}.*enabled" /proc/acpi/wakeup && echo " ${ACPI_LID_NAME}" | sudo tee /proc/acpi/wakeup'
|
||||
RemainAfterExit=true
|
||||
PassEnvironment=DISPLAY
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=%h/bin/mousespam
|
||||
RemainAfterExit=True
|
||||
PassEnvironment=DISPLAY
|
||||
@@ -3,7 +3,7 @@ BindsTo=autostart.target
|
||||
After=windowmanager.target
|
||||
After=gnome-keyring.service
|
||||
|
||||
ConditionPathExists=%t/features/nextcloud
|
||||
ConditionPathExists=%h/.var/run/features/nextcloud
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/env nextcloud --background
|
||||
|
||||
@@ -3,7 +3,6 @@ BindsTo=autostart.target
|
||||
After=windowmanager.target
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/usr/bin/env redshift-gtk -x
|
||||
ExecStart=/usr/bin/env redshift-gtk -c %h/.config/redshift.conf
|
||||
PassEnvironment=DISPLAY
|
||||
Restart=always
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
[Unit]
|
||||
ConditionPathExists=%t/features/restic_backup
|
||||
ConditionPathExists=%h/.var/run/features/restic_backup
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=%h/restic/restic-backup
|
||||
ExecStart=%h/bin/restic-backup
|
||||
RemainAfterExit=true
|
||||
PassEnvironment=DISPLAY
|
||||
|
||||
13
autostart/services/screencfg.service
Normal file
13
autostart/services/screencfg.service
Normal file
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
BindsTo=autostart.target
|
||||
After=windowmanager.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
# systemd.service(5):
|
||||
|
||||
# > The command to execute may contain spaces, but control characters are not
|
||||
# > allowed.
|
||||
ExecStart=/usr/bin/env screencfg "%h/.screencfg/%H/default.yml"
|
||||
RemainAfterExit=true
|
||||
PassEnvironment=DISPLAY
|
||||
@@ -3,7 +3,7 @@ BindsTo=autostart.target
|
||||
After=windowmanager.target
|
||||
After=i3.service
|
||||
|
||||
ConditionPathExists=%t/features/steam
|
||||
ConditionPathExists=%h/.var/run/features/steam
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/env steam
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Unit]
|
||||
BindsTo=autostart.target
|
||||
After=windowmanager.target
|
||||
ConditionPathExists=%t/features/machine_is_laptop
|
||||
ConditionPathExists=%h/.var/run/features/machine_is_laptop
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
[Unit]
|
||||
BindsTo=autostart.target
|
||||
PartOf=gpg-agent.service
|
||||
After=windowmanager.target
|
||||
After=gpg-agent.service
|
||||
ConditionPathExists=%t/features/gpg_agent
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/env yubikey-touch-detector -libnotify
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
set -o errexit
|
||||
|
||||
cd ~/code/personal/time-tracking/
|
||||
cd ~/projects/personal/time-tracking/
|
||||
source venv/bin/activate
|
||||
source ~/.attendance_env
|
||||
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
|
||||
set -o nounset
|
||||
|
||||
_logfile="$XDG_RUNTIME_DIR/dunstctl.log"
|
||||
_logfile="$LOGDIR/dunstctl.log"
|
||||
|
||||
log() {
|
||||
printf '[%s] %s\n' "$(date -uIseconds)" "$*" >> "$_logfile"
|
||||
}
|
||||
|
||||
case "$1 $2" in
|
||||
"set-paused false")
|
||||
case "$1" in
|
||||
enable)
|
||||
log "Enabling dunst"
|
||||
systemctl --user --no-block kill --signal SIGUSR2 dunst
|
||||
|
||||
;;
|
||||
"set-paused true")
|
||||
disable)
|
||||
log "Disabling dunst"
|
||||
systemctl --user --no-block kill --signal SIGUSR1 dunst
|
||||
;;
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
systemctl --no-pager --user status mousespam && systemctl --no-pager --user stop mousespam || systemctl --no-pager --user start mousespam
|
||||
94
bin/mypass
Executable file
94
bin/mypass
Executable file
@@ -0,0 +1,94 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import subprocess
|
||||
import yaml
|
||||
|
||||
PASS = '/usr/bin/pass'
|
||||
|
||||
def run(args):
|
||||
return(subprocess.run(
|
||||
args,
|
||||
stdin=sys.stdin,
|
||||
stdout=sys.stdout,
|
||||
stderr=sys.stderr).returncode)
|
||||
|
||||
def get_stdout(args):
|
||||
return(subprocess.run(
|
||||
args,
|
||||
stdout=subprocess.PIPE).stdout)
|
||||
|
||||
def extract_from_dict(d, k, last=None):
|
||||
if '.' in k:
|
||||
k1, k2 = k.split('.', 1)
|
||||
try:
|
||||
d1 = d[k1]
|
||||
return extract_from_dict(d1, k2, last=k1)
|
||||
except KeyError:
|
||||
print("\"{}\" was not found in the data".format(k))
|
||||
sys.exit(3)
|
||||
else:
|
||||
if not isinstance(d, dict):
|
||||
print("element \"{}\" is not a dictionary".format(last))
|
||||
sys.exit(3)
|
||||
try:
|
||||
return d[k]
|
||||
except KeyError:
|
||||
print("\"{}\" was not found in the data".format(k))
|
||||
sys.exit(3)
|
||||
|
||||
|
||||
def cmd_get(*args):
|
||||
if len(args) == 1:
|
||||
print(get_stdout(['pass', 'show', args[0]]).split(b'\n')[0].decode())
|
||||
return 0
|
||||
|
||||
if len(args) < 2:
|
||||
print("what do you want to get?")
|
||||
return 1
|
||||
|
||||
# get the pass output
|
||||
out = get_stdout(['pass', 'show', args[0]])
|
||||
try:
|
||||
data = list(yaml.safe_load_all(out))[-1]
|
||||
except yaml.scanner.ScannerError as e:
|
||||
print("invalid YAML data: {}".format(str(e)))
|
||||
return 2
|
||||
except IndexError:
|
||||
print("invalid YAML data: no YAML document found")
|
||||
return 2
|
||||
|
||||
if not isinstance(data, dict):
|
||||
print("invalid YAML data, not a dict")
|
||||
return 2
|
||||
|
||||
for element in args[1:]:
|
||||
keydata = extract_from_dict(data, element)
|
||||
if isinstance(keydata, list) or isinstance(keydata, dict):
|
||||
print(yaml.safe_dump(keydata, default_flow_style=False).strip())
|
||||
else:
|
||||
print(keydata)
|
||||
|
||||
cmds = ['get']
|
||||
git_push_commands = ['insert', 'edit', 'generate', 'rm', 'mv', 'cp']
|
||||
|
||||
def run_pass(argv):
|
||||
return run([PASS] + argv[1:])
|
||||
|
||||
def just_call_pass(argv):
|
||||
sys.exit(run_pass(argv))
|
||||
|
||||
if len(sys.argv) == 1:
|
||||
just_call_pass(sys.argv)
|
||||
elif sys.argv[1] not in cmds:
|
||||
if sys.argv[1] not in git_push_commands:
|
||||
just_call_pass(sys.argv)
|
||||
else:
|
||||
e = run_pass(sys.argv)
|
||||
if e == 0:
|
||||
print("Pushing to remote repository...")
|
||||
run([PASS, 'git', 'push'])
|
||||
print("Done")
|
||||
sys.exit(e)
|
||||
else:
|
||||
sys.exit(globals()['cmd_' + sys.argv[1]](*sys.argv[2:]))
|
||||
40
bin/nato
40
bin/nato
@@ -1,7 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import os.path
|
||||
|
||||
hash = {
|
||||
'A': 'Alpha',
|
||||
@@ -44,45 +43,6 @@ hash = {
|
||||
'.': 'Stop',
|
||||
}
|
||||
|
||||
de = {
|
||||
'A': 'Anton',
|
||||
'Ä': 'Ärger',
|
||||
'B': 'Berta',
|
||||
'C': 'Cäsar',
|
||||
'D': 'Dora',
|
||||
'E': 'Emil',
|
||||
'F': 'Friedrich',
|
||||
'G': 'Gustav',
|
||||
'H': 'Heinrich',
|
||||
'I': 'Ida',
|
||||
'J': 'Julius',
|
||||
'K': 'Kaufmann',
|
||||
'L': 'Ludwig',
|
||||
'M': 'Martha',
|
||||
'N': 'Nordpol',
|
||||
'O': 'Otto',
|
||||
'Ö': 'Ökonom',
|
||||
'P': 'Paula',
|
||||
'Q': 'Quelle',
|
||||
'R': 'Richard',
|
||||
'S': 'Samuel',
|
||||
'ß': 'Eszett',
|
||||
'T': 'Theodor',
|
||||
'U': 'Ulrich',
|
||||
'Ü': 'Übermut',
|
||||
'V': 'Viktor',
|
||||
'W': 'Wilhelm',
|
||||
'X': 'Xanthippe',
|
||||
'Y': 'Ypsilon',
|
||||
'Z': 'Zacharias',
|
||||
'-': 'Strich',
|
||||
'.': 'Punkt',
|
||||
}
|
||||
|
||||
if os.path.basename(sys.argv[0]) == 'natode':
|
||||
hash = de
|
||||
|
||||
|
||||
if len(sys.argv) < 2 or sys.argv[1] == '-':
|
||||
text = [line.strip() for line in sys.stdin.readlines()]
|
||||
else:
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
nato
|
||||
14
bin/pass
14
bin/pass
@@ -1,14 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -o nounset
|
||||
set -o errexit
|
||||
|
||||
if [[ ! -e "${PASSWORD_STORE_DIR}" ]] ; then
|
||||
printf '%s\n' 'This is the first time running pass, initializting repository ...'
|
||||
|
||||
git clone ssh://git@code.hkoerber.de:2222/hannes/passwordstore.git "${PASSWORD_STORE_DIR}"
|
||||
|
||||
printf '%s\n' 'Done'
|
||||
fi
|
||||
|
||||
command -p pass "${@}"
|
||||
14
bin/pf
14
bin/pf
@@ -1,14 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import json
|
||||
import yaml
|
||||
import subprocess
|
||||
|
||||
jqexpression = sys.argv[1]
|
||||
|
||||
jqprocess = subprocess.Popen(["jq", "-r", jqexpression], stdin=subprocess.PIPE, text=True)
|
||||
|
||||
document = [d for d in yaml.safe_load_all(sys.stdin)][-1]
|
||||
|
||||
json.dump(document, jqprocess.stdin)
|
||||
62
bin/screencfg
Executable file
62
bin/screencfg
Executable file
@@ -0,0 +1,62 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import subprocess
|
||||
import time
|
||||
import argparse
|
||||
|
||||
import yaml
|
||||
|
||||
XRANDR = 'xrandr'
|
||||
|
||||
def run(cmd):
|
||||
print('>>> ' + ' '.join(cmd))
|
||||
start = time.time()
|
||||
ret = subprocess.run(
|
||||
cmd,
|
||||
stdout=sys.stdout,
|
||||
stderr=sys.stderr)
|
||||
end = time.time()
|
||||
print("exit code: {}".format(ret.returncode))
|
||||
print("exec time: {}".format(end - start))
|
||||
|
||||
def fail(msg, code=1):
|
||||
print(msg)
|
||||
sys.exit(code)
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('config')
|
||||
|
||||
args = parser.parse_args()
|
||||
config_path = args.config
|
||||
|
||||
try:
|
||||
config = yaml.safe_load(open(config_path))
|
||||
except FileNotFoundError:
|
||||
fail("File {0} not found".format(config_path))
|
||||
|
||||
# reset
|
||||
for output in config['outputs']:
|
||||
if config.get('reset') and output.get('reset'):
|
||||
run([XRANDR, '--output', output['name'], '--off'])
|
||||
run([XRANDR, '--delmode', output['name'], output['opts']['mode']])
|
||||
run([XRANDR, '--addmode', output['name'], output['opts']['mode']])
|
||||
run([XRANDR, '--output', output['name'], '--mode', output['opts']['mode']])
|
||||
|
||||
cmd = [XRANDR]
|
||||
for output in config['outputs']:
|
||||
cmd.extend(['--output', output['name']])
|
||||
if output.get('disable'):
|
||||
cmd.append('--off')
|
||||
else:
|
||||
if output.get('primary', False):
|
||||
cmd.append("--primary")
|
||||
# cmd.append('--auto')
|
||||
for k, v in output['opts'].items():
|
||||
cmd.extend(['--{}'.format(k), str(v)])
|
||||
for k,v in output.get('set', {}).items():
|
||||
cmd.extend(['--set', k, v])
|
||||
|
||||
run(cmd)
|
||||
run(['i3-msg', 'restart'])
|
||||
run(['systemctl', '--user', 'restart', 'keyboard'])
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
git submodule update --remote pkgbuilds/*
|
||||
1
contrib/vim-plug
Submodule
1
contrib/vim-plug
Submodule
Submodule contrib/vim-plug added at c3b6b7c297
66
dotfiles.yml
66
dotfiles.yml
@@ -1,23 +1,14 @@
|
||||
empty_directories:
|
||||
- name: .i3
|
||||
- name: .gnupg
|
||||
mode: '0700'
|
||||
- name: .config/nvim
|
||||
- name: .config/rofi
|
||||
- name: .config/gtk-3.0
|
||||
- name: .config/gtk-3.0-overrides
|
||||
- name: .config/gtk-3.0-overrides/bigger-font/
|
||||
- name: .config/gtk-3.0-overrides/bigger-font/gtk-3.0
|
||||
- name: .config/qt5ct
|
||||
- name: .config/i3status-rust
|
||||
- name: .config/i3status-rust/icons
|
||||
- name: .config/i3status-rust/themes
|
||||
- name: .config/helix
|
||||
- name: .config/git
|
||||
- name: .config/tmux
|
||||
- name: .config/i3
|
||||
dotfiles:
|
||||
- from: git/gitconfig
|
||||
to: .config/git/config
|
||||
to: .gitconfig
|
||||
template: true
|
||||
- from: gnupg/dirmngr.conf
|
||||
to: .gnupg/dirmngr.conf
|
||||
@@ -28,21 +19,19 @@ dotfiles:
|
||||
to: .gnupg/gpg.conf
|
||||
template: true
|
||||
- from: i3/config
|
||||
to: .config/i3/config
|
||||
to: .i3/config
|
||||
template: true
|
||||
- from: i3/i3status-rust/config.toml
|
||||
to: .config/i3status-rust/config.toml
|
||||
- from: i3/i3status.conf
|
||||
to: .i3/i3status.conf
|
||||
template: true
|
||||
- from: i3/i3status-rust/themes/native.toml
|
||||
to: .config/i3status-rust/themes/native.toml
|
||||
- from: i3/i3status-rust/icons/awesome.toml
|
||||
to: .config/i3status-rust/icons/awesome.toml
|
||||
- from: i3/scripts
|
||||
to: .config/i3/scripts
|
||||
to: .i3/scripts
|
||||
- from: tmux/tmux.conf
|
||||
to: .config/tmux/tmux.conf
|
||||
to: .tmux.conf
|
||||
- from: vim/vimrc
|
||||
to: .config/nvim/init.vim
|
||||
- from: vim/vimrc
|
||||
to: .vimrc
|
||||
- from: x/Xresources
|
||||
to: .Xresources
|
||||
template: true
|
||||
@@ -54,46 +43,31 @@ dotfiles:
|
||||
- from: zsh/zshrc
|
||||
to: .zshrc
|
||||
template: true
|
||||
- from: zsh/zshrc.d
|
||||
to: .zshrc.d
|
||||
- from: dunst/dunstrc
|
||||
to: .config/dunstrc
|
||||
template: true
|
||||
- from: redshift/redshift.conf
|
||||
to: .config/redshift.conf
|
||||
- from: vscodium/product.json
|
||||
to: .config/VSCodium/product.json
|
||||
- from: vscodium/settings.json
|
||||
to: .config/VSCodium/User/settings.json
|
||||
- from: vscodium/keybindings.json
|
||||
to: .config/VSCodium/User/keybindings.json
|
||||
- from: alacritty/alacritty.toml
|
||||
to: .config/alacritty.toml
|
||||
- from: vscode/settings.json
|
||||
to: .config/Code/User/settings.json
|
||||
- from: vscode/keybindings.json
|
||||
to: .config/Code/User/keybindings.json
|
||||
- from: alacritty/alacritty.yml
|
||||
to: .config/alacritty.yml
|
||||
template: true
|
||||
- from: rofi/config
|
||||
to: .config/rofi/config
|
||||
- from: gtk/gtk-3.0.ini
|
||||
to: .config/gtk-3.0/settings.ini
|
||||
template: true
|
||||
- from: gtk/gtk-3.0-bigger-font.ini
|
||||
to: .config/gtk-3.0-overrides/bigger-font/gtk-3.0/settings.ini
|
||||
template: true
|
||||
- from: gtk/gtkrc-2.0
|
||||
to: .config/gtkrc-2.0
|
||||
to: .gtkrc-2.0
|
||||
template: true
|
||||
- from: qt/qt5ct.conf
|
||||
to: .config/qt5ct/qt5ct.conf
|
||||
- from: screencfg
|
||||
to: .screencfg
|
||||
- from: scripts
|
||||
to: scripts
|
||||
- from: helix/config.toml
|
||||
to: .config/helix/config.toml
|
||||
dotfiles_remove:
|
||||
- .gitconfig
|
||||
- .vimrc
|
||||
- .tmux.conf
|
||||
- .i3
|
||||
- .gtkrc-2.0
|
||||
- .opt
|
||||
- .optbin
|
||||
- .usr
|
||||
- .var
|
||||
- .screenrc
|
||||
- .zshrc.d
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
frame_width = 2
|
||||
|
||||
# Defines color of the frame around the notification window.
|
||||
frame_color = "#ff964f"
|
||||
frame_color = "#e16b40"
|
||||
|
||||
# Define a color for the separator.
|
||||
# possible values are:
|
||||
@@ -84,7 +84,7 @@
|
||||
|
||||
### Text ###
|
||||
|
||||
font = DejaVu Sans {{ machine.font_size_1 }}
|
||||
font = DejaVu Sans {{ machine.font_size }}
|
||||
|
||||
# The spacing between lines. If the height is smaller than the
|
||||
# font height, it will get raised to the font height.
|
||||
|
||||
@@ -71,9 +71,6 @@
|
||||
fileMode = true
|
||||
whitespace = "blank-at-eol,space-before-tab,blank-at-eof"
|
||||
abbrev = 8
|
||||
pager = delta
|
||||
[interactive]
|
||||
diffFilter = delta --color-only
|
||||
[color]
|
||||
ui = true
|
||||
[column]
|
||||
@@ -81,7 +78,7 @@
|
||||
[push]
|
||||
default = simple
|
||||
[merge]
|
||||
conflictstyle = diff3
|
||||
tool = vimdiff
|
||||
[gc]
|
||||
auto = 0
|
||||
[advice]
|
||||
@@ -108,6 +105,7 @@
|
||||
autoStash = true
|
||||
[diff]
|
||||
submodule = log
|
||||
mnemonicPrefix = true
|
||||
renameLimit = 1199
|
||||
[branch]
|
||||
autoSetupMerge = true
|
||||
@@ -122,13 +120,3 @@
|
||||
|
||||
[init]
|
||||
defaultBranch = master
|
||||
[safe]
|
||||
directory = /var/lib/dotfiles
|
||||
[includeIf "gitdir:/var/lib/dotfiles"]
|
||||
path = /var/lib/dotfiles/gitcfg
|
||||
[delta]
|
||||
navigate = true # use n and N to move between diff sections
|
||||
|
||||
# delta detects terminal colors automatically; set one of these to disable auto-detection
|
||||
# dark = true
|
||||
# light = true
|
||||
|
||||
@@ -34,7 +34,12 @@ fixed-list-mode
|
||||
no-mangle-dos-filenames
|
||||
require-cross-certification
|
||||
|
||||
{% if not (distro == 'ubuntu' and ansible_distribution_version == '18.04') -%}
|
||||
{# looks like the gpg version in that ubuntu release it too old and does not
|
||||
{# contain the setting #}
|
||||
# do not cache keys for symmetric encryption
|
||||
no-symkey-cache
|
||||
|
||||
{% endif -%}
|
||||
|
||||
keyserver-options no-honor-keyserver-url no-auto-key-retrieve include-revoked
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
provider = "github"
|
||||
token_command = "pass show github | pf '.personal_access_token.grm.value'"
|
||||
root = "~/projects/github"
|
||||
force_ssh = true
|
||||
worktree = true
|
||||
|
||||
[filters]
|
||||
# owner = true
|
||||
# groups = ["hi"]
|
||||
@@ -6,7 +6,7 @@ name = "misc/rbackupd"
|
||||
|
||||
[[trees.repos.remotes]]
|
||||
name = "github"
|
||||
url = "ssh://git@github.com/hakoerber/rbackupd.git"
|
||||
url = "git@github.com:hakoerber/rbackupd.git"
|
||||
type = "ssh"
|
||||
|
||||
[[trees.repos]]
|
||||
@@ -59,7 +59,7 @@ name = "misc/wifiqr"
|
||||
|
||||
[[trees.repos.remotes]]
|
||||
name = "github"
|
||||
url = "ssh://git@github.com/hakoerber/wifiqr.git"
|
||||
url = "ssh://git@github.com/hakoerber/wifi-qr.git"
|
||||
type = "ssh"
|
||||
|
||||
[[trees.repos]]
|
||||
@@ -74,7 +74,7 @@ type = "ssh"
|
||||
name = "misc/xftwidth"
|
||||
|
||||
[[trees.repos.remotes]]
|
||||
name = "github"
|
||||
name = "origin"
|
||||
url = "ssh://git@github.com/hakoerber/xftwidth.git"
|
||||
type = "ssh"
|
||||
|
||||
@@ -83,9 +83,12 @@ name = "upstream"
|
||||
url = "https://github.com/vixus0/xftwidth"
|
||||
type = "https"
|
||||
|
||||
[[trees.repos]]
|
||||
name = "x-hidecursor"
|
||||
remotes = []
|
||||
|
||||
[[trees.repos]]
|
||||
name = "git-repo-manager"
|
||||
worktree_setup = true
|
||||
|
||||
[[trees.repos.remotes]]
|
||||
name = "github"
|
||||
@@ -121,6 +124,11 @@ name = "github"
|
||||
url = "ssh://git@github.com/hakoerber/acimaker.git"
|
||||
type = "ssh"
|
||||
|
||||
[[trees.repos.remotes]]
|
||||
name = "private"
|
||||
url = "git@code.sys.haktec.de:container/acimaker.git"
|
||||
type = "ssh"
|
||||
|
||||
[[trees.repos]]
|
||||
name = "container/drone-kaniko"
|
||||
|
||||
@@ -196,11 +204,7 @@ type = "ssh"
|
||||
|
||||
[[trees.repos]]
|
||||
name = "lea-michael-hochzeit"
|
||||
|
||||
[[trees.repos.remotes]]
|
||||
name = "origin"
|
||||
url = "ssh://git@code.hkoerber.de:2222/hannes/lea-michi-hochzeit.git"
|
||||
type = "ssh"
|
||||
remotes = []
|
||||
|
||||
[[trees.repos]]
|
||||
name = "builddoc"
|
||||
@@ -232,11 +236,11 @@ url = "ssh://git@github.com/hakoerber/fizzbuzz.git"
|
||||
type = "ssh"
|
||||
|
||||
[[trees.repos]]
|
||||
name = "ggj/2018-the-lost-son"
|
||||
name = "ggj/2018/the-lost-son"
|
||||
|
||||
[[trees.repos.remotes]]
|
||||
name = "origin"
|
||||
url = "ssh://git@github.com/niklas-heer/the-lost-son.git"
|
||||
url = "ssh://git@github.com:niklas-heer/the-lost-son.git"
|
||||
type = "ssh"
|
||||
|
||||
[[trees.repos]]
|
||||
@@ -244,7 +248,7 @@ name = "ggj/2019-claim-your-world"
|
||||
|
||||
[[trees.repos.remotes]]
|
||||
name = "origin"
|
||||
url = "ssh://git@github.com/theintroverts/claim-your-world.git"
|
||||
url = "ssh://git@github.com:theintroverts/claim-your-world.git"
|
||||
type = "ssh"
|
||||
|
||||
[[trees.repos]]
|
||||
@@ -309,18 +313,5 @@ type = "ssh"
|
||||
|
||||
[[trees.repos.remotes]]
|
||||
name = "origin"
|
||||
url = "ssh://git@code.hkoerber.de:2222/hannes/aws-glacier-backup.git"
|
||||
url = "ssh://git@code.hkoerber.de:2222/hakoerber/aws-glacier-backup.git"
|
||||
type = "ssh"
|
||||
|
||||
[[trees.repos]]
|
||||
name = "unclutter-xfixes"
|
||||
|
||||
[[trees.repos.remotes]]
|
||||
name = "github"
|
||||
url = "git@github.com:hakoerber/unclutter-xfixes.git"
|
||||
type = "ssh"
|
||||
|
||||
[[trees.repos.remotes]]
|
||||
name = "upstream"
|
||||
url = "https://github.com/Airblader/unclutter-xfixes"
|
||||
type = "https"
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
[Settings]
|
||||
gtk-theme-name=Breeze
|
||||
gtk-icon-theme-name=breeze
|
||||
gtk-font-name=DejaVu Sans {{ ((machine.font_size_1|int - 2)|float * 2.0) | round(0, 'floor') | int }}
|
||||
gtk-cursor-theme-name=breeze_cursors
|
||||
gtk-cursor-theme-size=0
|
||||
gtk-toolbar-style=GTK_TOOLBAR_BOTH
|
||||
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
|
||||
gtk-button-images=1
|
||||
gtk-menu-images=1
|
||||
gtk-enable-event-sounds=1
|
||||
gtk-enable-input-feedback-sounds=1
|
||||
gtk-xft-antialias=1
|
||||
gtk-xft-hinting=1
|
||||
gtk-xft-hintstyle=hintfull
|
||||
@@ -1,7 +1,7 @@
|
||||
[Settings]
|
||||
gtk-theme-name=Breeze
|
||||
gtk-icon-theme-name=breeze
|
||||
gtk-font-name=DejaVu Sans {{ machine.font_size_1|int - 2 }}
|
||||
gtk-icon-theme-name=breeze-dark
|
||||
gtk-font-name=DejaVu Sans {{ machine.font_size|int - 2 }}
|
||||
gtk-cursor-theme-name=breeze_cursors
|
||||
gtk-cursor-theme-size=0
|
||||
gtk-toolbar-style=GTK_TOOLBAR_BOTH
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
# Any customization should be done in ~/.gtkrc-2.0.mine instead.
|
||||
|
||||
gtk-theme-name="Breeze"
|
||||
gtk-icon-theme-name="breeze"
|
||||
gtk-font-name="DejaVu Sans {{ machine.font_size_1| int - 2 }}"
|
||||
gtk-icon-theme-name="breeze-dark"
|
||||
gtk-font-name="DejaVu Sans {{ machine.font_size| int - 2 }}"
|
||||
gtk-cursor-theme-name="breeze_cursors"
|
||||
gtk-cursor-theme-size=0
|
||||
gtk-toolbar-style=GTK_TOOLBAR_BOTH
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
theme = "monokai"
|
||||
|
||||
[editor]
|
||||
idle-timeout = 0
|
||||
completion-trigger-len = 2
|
||||
|
||||
[editor.statusline]
|
||||
left = [
|
||||
"mode",
|
||||
"separator",
|
||||
"file-name",
|
||||
"file-modification-indicator",
|
||||
]
|
||||
|
||||
right = [
|
||||
"spinner",
|
||||
"spacer",
|
||||
"diagnostics",
|
||||
"separator",
|
||||
"selections",
|
||||
"separator",
|
||||
"position",
|
||||
"position-percentage",
|
||||
"file-type",
|
||||
]
|
||||
|
||||
mode.normal = "N"
|
||||
mode.insert = "I"
|
||||
mode.select = "S"
|
||||
|
||||
[editor.lsp]
|
||||
display-inlay-hints = true
|
||||
|
||||
[editor.cursor-shape]
|
||||
insert = "bar"
|
||||
|
||||
[editor.file-picker]
|
||||
hidden = false
|
||||
|
||||
[editor.indent-guides]
|
||||
render = true
|
||||
|
||||
[editor.soft-wrap]
|
||||
enable = true
|
||||
101
i3/config.j2
101
i3/config.j2
@@ -17,10 +17,10 @@
|
||||
set $mod Mod4
|
||||
|
||||
# The default terminal
|
||||
set $terminal "alacritty --config-file ~/.config/alacritty.toml"
|
||||
set $calc "alacritty --config-file ~/.config/alacritty.toml -e $SHELL -i -c calc"
|
||||
set $terminal "alacritty --config-file ~/.config/alacritty.yml"
|
||||
set $calc "alacritty --config-file ~/.config/alacritty.yml -e $SHELL -i -c calc"
|
||||
|
||||
set $scriptdir ~/.config/i3/scripts
|
||||
set $scriptdir ~/.i3/scripts
|
||||
|
||||
# Keys for the exit mode
|
||||
set $key_lock l
|
||||
@@ -115,8 +115,8 @@ workspace $workspace10 output {{ machine.screen.0 }}
|
||||
assign [class="^Keepassx$"] $workspace8
|
||||
|
||||
# See https://github.com/i3/i3/issues/2060
|
||||
for_window [class="^Spotify$"] move to workspace $workspace10
|
||||
assign [class="^Spotify$"] $workspace10
|
||||
for_window [class="^Spotify$"] move to workspace $workspace9
|
||||
assign [class="^Spotify$"] $workspace9
|
||||
|
||||
assign [class="^Google-chrome$"] $workspace7
|
||||
assign [class="^Chromium$"] $workspace7
|
||||
@@ -206,23 +206,47 @@ assign [class="^Wine$"] $workspace10
|
||||
|
||||
### START APPLICATIONS #####################################################
|
||||
|
||||
bindsym $mod+d exec --no-startup-id $scriptdir/appmenu
|
||||
bindsym $mod+d exec --no-startup-id ~/.i3/scripts/appmenu
|
||||
bindsym $mod+Return exec $terminal
|
||||
bindsym $mod+Shift+Return exec $calc
|
||||
|
||||
bindsym F1 exec --no-startup-id $scriptdir/shutdown-menu
|
||||
bindsym F2 exec --no-startup-id $scriptdir/screenmenu
|
||||
bindsym F1 exec --no-startup-id ~/.i3/scripts/shutdown-menu
|
||||
bindsym F2 exec --no-startup-id ~/.i3/scripts/screenmenu
|
||||
|
||||
bindsym $mod+F1 exec --no-startup-id $scriptdir/i3exit lock
|
||||
bindsym $mod+F4 exec --no-startup-id $scriptdir/i3exit suspend
|
||||
bindsym $mod+Home exec --no-startup-id $scriptdir/shutdown-menu
|
||||
bindsym $mod+F1 exec --no-startup-id ~/.i3/scripts/i3exit lock
|
||||
bindsym $mod+F2 exec --no-startup-id screencfg ~/.screencfg/{{ ansible_hostname }}/default.yml ; exec systemctl --user restart keyboard.service
|
||||
{% for screencfg in machine.screencfgs -%}
|
||||
bindsym $mod+{{ screencfg.key }} exec --no-startup-id screencfg ~/.screencfg/{{ ansible_hostname }}/{{ screencfg.name }}.yml ; exec systemctl --user restart keyboard.service
|
||||
{% endfor -%}
|
||||
bindsym $mod+F4 exec --no-startup-id ~/.i3/scripts/i3exit suspend
|
||||
bindsym $mod+Home exec --no-startup-id ~/.i3/scripts/shutdown-menu
|
||||
|
||||
bindsym $mod+$screenshot exec --no-startup-id sh -c 'maim | xclip -selection clipboard -t image/png'
|
||||
bindsym $mod+Shift+$screenshot exec --no-startup-id sh -c 'maim --select | xclip -selection clipboard -t image/png'
|
||||
|
||||
bindsym $mod+Shift+v exec --no-startup-id redshift-toggle
|
||||
|
||||
bindsym $mod+$pim_toggle exec --no-startup-id $scriptdir/swap-from-workspace $workspace10
|
||||
# bindsym $mod+$pim_toggle \
|
||||
# mark --add _source; \
|
||||
# focus output eDP-1; \
|
||||
# mark --add _origin; \
|
||||
# workspace $workspace10; \
|
||||
# mark --add _destination; \
|
||||
# [con_mark="^_destination$"] swap container with mark "_source"; \
|
||||
# [con_mark="^_source$"] focus; unmark _source; \
|
||||
# [con_mark="^_origin$"] focus; unmark _origin; \
|
||||
# [con_mark="^_destination$"] focus; unmark _destination; \
|
||||
|
||||
bindsym $mod+$pim_toggle \
|
||||
unmark _destination; \
|
||||
mark _source; \
|
||||
workspace $workspace10; \
|
||||
mark --add _destination; \
|
||||
[con_mark="^_destination$"] swap container with mark "_source"; \
|
||||
[con_mark="^_source$"] focus; \
|
||||
unmark _source; \
|
||||
[con_mark="^_destination$"] focus; \
|
||||
unmark _destination;
|
||||
|
||||
################################################################################
|
||||
### MODES ######################################################################
|
||||
@@ -288,17 +312,17 @@ assign [class="^Wine$"] $workspace10
|
||||
floating_minimum_size 0 x 0
|
||||
floating_maximum_size 0 x 0
|
||||
|
||||
font pango:Inconsolata {{ machine.font_size_1 }}
|
||||
font pango:Inconsolata {{ machine.font_size }}
|
||||
|
||||
################################################################################
|
||||
### COLOR SETTINGS #############################################################
|
||||
################################################################################
|
||||
|
||||
# class border backgr. text indicator
|
||||
client.focused #e5b567 #e5b567 #000000 #FF0000
|
||||
client.focused_inactive #272822 #5f676a #ffffff #484e50
|
||||
client.unfocused #1C1C1C #272822 #cccccc #292d2e
|
||||
client.urgent #272822 #ff7777 #000000 #900000
|
||||
client.focused #E16B40 #E16B40 #000000 #FF0000
|
||||
client.focused_inactive #333333 #5f676a #ffffff #484e50
|
||||
client.unfocused #333333 #202020 #cccccc #292d2e
|
||||
client.urgent #2f343a #900000 #ffffff #900000
|
||||
|
||||
################################################################################
|
||||
### APPLICATION SPECIFIC SETTINGS ##############################################
|
||||
@@ -315,30 +339,32 @@ bindsym $mod+F9 exec --no-startup-id evolution
|
||||
################################################################################
|
||||
|
||||
bindsym XF86Sleep exec --no-startup-id $scriptdir/i3exit suspend
|
||||
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute '@DEFAULT_SINK@' toggle
|
||||
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume '@DEFAULT_SINK@' +5%
|
||||
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume '@DEFAULT_SINK@' -5%
|
||||
bindsym XF86AudioMute exec --no-startup-id $scriptdir/pa-volume mute-toggle
|
||||
bindsym XF86AudioRaiseVolume exec --no-startup-id $scriptdir/pa-volume set-vol +3
|
||||
bindsym XF86AudioLowerVolume exec --no-startup-id $scriptdir/pa-volume set-vol -3
|
||||
|
||||
bindsym XF86AudioPlay exec --no-startup-id playerctl -p spotify play-pause
|
||||
bindsym XF86AudioNext exec --no-startup-id playerctl -p spotify next
|
||||
bindsym XF86AudioPrev exec --no-startup-id playerctl -p spotify previous
|
||||
bindsym XF86AudioPlay exec $scriptdir/spotify-control toggle
|
||||
bindsym XF86AudioNext exec $scriptdir/spotify-control next
|
||||
bindsym XF86AudioPrev exec $scriptdir/spotify-control previous
|
||||
|
||||
# keys seemingly switched
|
||||
bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 8 ; exec --no-startup-id $scriptdir/update-status
|
||||
bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 8 ; exec --no-startup-id $scriptdir/update-status
|
||||
|
||||
bindsym $mod+m exec --no-startup-id pactl set-source-mute '@DEFAULT_SOURCE@' toggle
|
||||
bindsym $mod+space exec --no-startup-id pactl set-source-mute '@DEFAULT_SOURCE@' toggle
|
||||
bindsym KP_Enter exec --no-startup-id pactl set-source-mute '@DEFAULT_SOURCE@' toggle
|
||||
bindsym $mod+m exec --no-startup-id $scriptdir/pa-volume mute-toggle-mic
|
||||
bindsym $mod+space exec --no-startup-id $scriptdir/pa-volume mute-toggle-mic
|
||||
|
||||
##############################################################################
|
||||
### BARS #######################################################################
|
||||
################################################################################
|
||||
|
||||
#
|
||||
bar {
|
||||
mode dock
|
||||
position bottom
|
||||
|
||||
|
||||
#tray_output HDMI3
|
||||
tray_output primary
|
||||
tray_padding 2
|
||||
|
||||
strip_workspace_numbers no
|
||||
@@ -349,23 +375,24 @@ bar {
|
||||
|
||||
id bar-0
|
||||
|
||||
font pango:Inconsolata, FontAwesome {{ machine.font_size_1 }}
|
||||
font pango:Inconsolata, FontAwesome {{ machine.font_size }}
|
||||
|
||||
colors {
|
||||
background #272822
|
||||
statusline #ffffff
|
||||
separator #555555
|
||||
separator #444444
|
||||
# separator #e16b40
|
||||
|
||||
focused_separator #e5b567
|
||||
focused_background #272822
|
||||
# focused_background #303030
|
||||
# focused_separator #272822
|
||||
|
||||
# border bg text
|
||||
focused_workspace #e5b567 #4f676a #ffffff
|
||||
active_workspace #272822 #4f676a #ffffff
|
||||
focused_workspace #e16b40 #272822 #ffffff
|
||||
active_workspace #272822 #5f676a #ffffff
|
||||
inactive_workspace #272822 #272822 #dddddd
|
||||
urgent_workspace #272822 #ff7777 #272822
|
||||
binding_mode #272822 #e5b567 #272822
|
||||
urgent_workspace #D00000 #D00000 #272822
|
||||
binding_mode #272822 #e16b40 #272822
|
||||
}
|
||||
|
||||
status_command i3status-rs ~/.config/i3status-rust/config.toml
|
||||
i3bar_command i3bar
|
||||
status_command py3status --standalone --dbus-notify -c ~/.i3/i3status.conf
|
||||
}
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
icons_format = "{{ machine.i3bar_icon_padding }}{icon}{{ machine.i3bar_icon_padding }}"
|
||||
|
||||
[icons]
|
||||
icons = "awesome"
|
||||
|
||||
[icons.overrides]
|
||||
microphone = ""
|
||||
volume = ""
|
||||
bat = "\uf240"
|
||||
music = "\uf1bc"
|
||||
|
||||
[theme]
|
||||
theme = "native"
|
||||
|
||||
[theme.overrides]
|
||||
warning_fg = "#000000"
|
||||
warning_bg = "#F4Bf75"
|
||||
critical_fg = "#000000"
|
||||
critical_bg = "#F92672"
|
||||
end_separator = ""
|
||||
|
||||
[[block]]
|
||||
block = "music"
|
||||
player = "spotify"
|
||||
separator = " — "
|
||||
format = " $icon {$combo $prev $play $next|-} "
|
||||
|
||||
[[block]]
|
||||
block = "sound"
|
||||
driver = "pulseaudio"
|
||||
max_vol = 100
|
||||
format = " $icon{ $volume.eng(w:2)|} "
|
||||
|
||||
[[block.click]]
|
||||
button = "left"
|
||||
cmd = "pactl set-sink-mute '@DEFAULT_SINK@' toggle"
|
||||
update = true
|
||||
|
||||
[[block]]
|
||||
block = "sound"
|
||||
driver = "pulseaudio"
|
||||
device_kind = "source"
|
||||
format = " $icon "
|
||||
|
||||
[block.theme_overrides]
|
||||
warning_fg = { link = "idle_fg" }
|
||||
warning_bg = { link = "idle_bg" }
|
||||
idle_fg = { link = "warning_fg" }
|
||||
idle_bg = { link = "warning_bg" }
|
||||
|
||||
[[block.click]]
|
||||
button = "left"
|
||||
cmd = "pactl set-source-mute '@DEFAULT_SOURCE@' toggle"
|
||||
update = true
|
||||
|
||||
[[block]]
|
||||
block = "net"
|
||||
format = " $icon{ $signal_strength|}{ $ssid | }"
|
||||
|
||||
[[block]]
|
||||
block = "load"
|
||||
format = " $icon $1m.eng(w:4) "
|
||||
warning = 4
|
||||
critical = 1000
|
||||
interval = 1
|
||||
|
||||
[[block]]
|
||||
block = "battery"
|
||||
interval = 10
|
||||
format = " $icon $percentage $time "
|
||||
charging_format = " $icon $percentage "
|
||||
missing_format = ""
|
||||
|
||||
[[block]]
|
||||
block = "toggle"
|
||||
format = " $icon "
|
||||
command_on = "$HOME/.i3/scripts/presentation-mode toggle ; pkill -SIGRTMIN+0 i3status-rs"
|
||||
command_off = "$HOME/.i3/scripts/presentation-mode toggle ; pkill -SIGRTMIN+0 i3status-rs"
|
||||
command_state = "[[ $($HOME/.i3/scripts/presentation-mode status) == on ]] && echo active"
|
||||
|
||||
[[block]]
|
||||
block = "toggle"
|
||||
format = " $icon "
|
||||
command_on = "systemctl --user start redshift"
|
||||
command_off = "systemctl --user stop redshift"
|
||||
command_state = "[[ $(systemctl --user is-active redshift) == active ]] && echo active"
|
||||
signal = 0
|
||||
|
||||
[[block]]
|
||||
block = "toggle"
|
||||
format = " $icon "
|
||||
command_on = "systemctl --user start spotify"
|
||||
command_off = "systemctl --user stop spotify"
|
||||
command_state = "[[ $(systemctl --user is-active spotify) == active ]] && echo active"
|
||||
signal = 0
|
||||
|
||||
[[block]]
|
||||
block = "custom"
|
||||
json = true
|
||||
command = "ping -n -q -w 2 -c 1 8.8.8.8 >/dev/null 2>/dev/null && printf '{\"text\":\"\",\"state\":\"Info\"}' || printf '{\"text\":\"\",\"state\":\"Critical\"}'"
|
||||
|
||||
[[block]]
|
||||
block = "custom"
|
||||
command = "curl -s 'https://wttr.in/Stockholm?m&T&format=%c%t' | sed 's/ / /g'"
|
||||
interval = 3600
|
||||
|
||||
[[block]]
|
||||
block = "time"
|
||||
interval = 1
|
||||
format = " $timestamp.datetime(f:'[CW %V] %a %d.%m.%Y %H:%M:%S', l:de_DE) "
|
||||
@@ -1,94 +0,0 @@
|
||||
# FontAwesome 4: https://fontawesome.com/v4.7.0/cheatsheet/
|
||||
backlight_empty = "\U0001f315"
|
||||
backlight_full = "\U0001f311"
|
||||
backlight_1 = "\U0001f314"
|
||||
backlight_2 = "\U0001f314"
|
||||
backlight_3 = "\U0001f314"
|
||||
backlight_4 = "\U0001f314"
|
||||
backlight_5 = "\U0001f313"
|
||||
backlight_6 = "\U0001f313"
|
||||
backlight_7 = "\U0001f313"
|
||||
backlight_8 = "\U0001f313"
|
||||
backlight_9 = "\U0001f313"
|
||||
backlight_10 = "\U0001f312"
|
||||
backlight_11 = "\U0001f312"
|
||||
backlight_12 = "\U0001f312"
|
||||
backlight_13 = "\U0001f312"
|
||||
bat_charging = "\uf1e6" # fa-plug
|
||||
bat_discharging = "\uf242" # fa-battery-half
|
||||
bat_10 = "\uf244" # fa-battery-empty
|
||||
bat_20 = "\uf243" # fa-battery-quarter
|
||||
bat_30 = "\uf243" # fa-battery-quarter
|
||||
bat_40 = "\uf243" # fa-battery-quarter
|
||||
bat_50 = "\uf242" # fa-battery-half
|
||||
bat_60 = "\uf242" # fa-battery-half
|
||||
bat_70 = "\uf241" # fa-battery-three-quarters
|
||||
bat_80 = "\uf241" # fa-battery-three-quarters
|
||||
bat_90 = "\uf241" # fa-battery-three-quarters
|
||||
bat_full = "\uf240" # fa-battery-full
|
||||
bat_not_available = "\uf244" # fa-battery-empty
|
||||
bell = "\uf0f3" # fa-bell
|
||||
bell-slash = "\uf1f7" # fa-bell-slash-o
|
||||
bluetooth = "\uf294" # fa-bluetooth-b
|
||||
calendar = "\uf073" # fa-calendar
|
||||
cogs = "\uf085" # fa-cogs
|
||||
cpu = "\uf0e4" # fa-dashboard
|
||||
cpu_boost_off = "\uf204" # fa-toggle-off
|
||||
cpu_boost_on = "\uf205" # fa-toggle-on
|
||||
disk_drive = "\uf0a0" # fa-hdd-o
|
||||
docker = "\uf21a" # fa-ship
|
||||
github = "\uf09b" # fa-github
|
||||
gpu = "\uf26c" # fa-television
|
||||
headphones = "\uf025" # fa-headphones
|
||||
joystick = "\uf11b" # fa-gamepad
|
||||
keyboard = "\uf11c" # fa-keyboard-o
|
||||
mail = "\uf0e0" # fa-envelope
|
||||
memory_mem = "\uf2db" # fa-microchip
|
||||
memory_swap = "\uf0a0" # fa-hdd-o
|
||||
mouse = "\uf245" # fa-mouse-pointer
|
||||
music = "\uf001" # fa-music
|
||||
music_next = "\uf061" # fa-arrow-right
|
||||
music_pause = "\uf04c" # fa-pause
|
||||
music_play = "\uf04b" # fa-play
|
||||
music_prev = "\uf060" # fa-arrow-left
|
||||
net_bridge = "\uf0e8" # fa-sitemap
|
||||
net_down = "\u2b07"
|
||||
net_loopback = "LO"
|
||||
net_modem = "\uf095" # fa-phone
|
||||
net_up = "\u2b06"
|
||||
net_vpn = "\uf023" # fa-lock
|
||||
net_wired = "\uf0ac" # fa-globe
|
||||
net_wireless = "\uf1eb" # fa-wifi
|
||||
notification = "\uf0a2" # fa-bell-o
|
||||
phone = "\uf10b" # fa-mobile
|
||||
phone_disconnected = "\U0001f4f5" # https://unicode-table.com/en/1F4F5/
|
||||
ping = "\u21ba"
|
||||
pomodoro = "\U0001f345"
|
||||
pomodoro_break = "\uf0f4" # fa-coffee
|
||||
pomodoro_paused = "\uf04c" # fa-pause
|
||||
pomodoro_started = "\uf04b" # fa-play
|
||||
pomodoro_stopped = "\uf04d" # fa-stop
|
||||
resolution = "\uf096" # fa-square-o
|
||||
tasks = "\uf0ae" # fa-tasks
|
||||
thermometer = "\uf2c8" # fa-thermometer-3
|
||||
time = "\uf017" # fa-clock-o
|
||||
toggle_off = "\uf204" # fa-toggle-off
|
||||
toggle_on = "\uf205" # fa-toggle-on
|
||||
unknown = "\uf128" # fa-question
|
||||
update = "\uf062" # fa-arrow-up
|
||||
uptime = "\uf017" # fa-clock-o
|
||||
volume_empty = "\uf026" # fa-volume-off
|
||||
volume_full = "\uf028" # fa-volume-up
|
||||
volume_half = "\uf027" # fa-volume-down
|
||||
volume_muted = "\uf026 \uf00d"
|
||||
microphone_empty = "\uf130" # fa-microphone
|
||||
microphone_full = "\uf130" # fa-microphone
|
||||
microphone_half = "\uf130" # fa-microphone
|
||||
microphone_muted = "\uf131" # fa-microphone-slash
|
||||
weather_clouds = "\uf0c2" # fa-cloud
|
||||
weather_default = "\uf0c2" # fa-cloud
|
||||
weather_rain = "\uf043" # fa-tint
|
||||
weather_snow = "\uf2dc" # fa-snowflake-o
|
||||
weather_sun = "\uf185" # fa-sun-o
|
||||
weather_thunder = "\uf0e7" # fa-bolt
|
||||
xrandr = "\uf26c" # fa-television
|
||||
123
i3/i3status.conf.j2
Normal file
123
i3/i3status.conf.j2
Normal file
@@ -0,0 +1,123 @@
|
||||
# i3status configuration file.
|
||||
# see "man i3status" for documentation.
|
||||
|
||||
# It is important that this file is edited as UTF-8.
|
||||
# The following line should contain a sharp s:
|
||||
# ß
|
||||
# If the above line is not correctly displayed, fix your editor first!
|
||||
|
||||
general {
|
||||
interval = 1
|
||||
# color = '#FFFFFF'
|
||||
# color_good = '#00FF00'
|
||||
# color_bad = '#FF0000'
|
||||
# color_degraded = '#FFFF00'
|
||||
color = '#FFFFFF'
|
||||
color_good = '#FFFFFF'
|
||||
color_bad = '#F92672'
|
||||
color_degraded = '#F4Bf75'
|
||||
}
|
||||
|
||||
|
||||
order += spotify
|
||||
{% if user.has_yubikey %}
|
||||
order += "yubikey"
|
||||
{% endif %}
|
||||
order += "volume_status output"
|
||||
order += "volume_status input"
|
||||
order += "wifi"
|
||||
order += "external_script presentation_mode"
|
||||
order += "systemd redshift"
|
||||
order += "systemd spotify"
|
||||
order += online_status
|
||||
order += "battery_level all"
|
||||
order += "clock"
|
||||
|
||||
battery_level all {
|
||||
battery_id = "all"
|
||||
format = " {icon} {percent}% "
|
||||
measurement_mode = "sys"
|
||||
charging_character = ""
|
||||
blocks = ""
|
||||
notification = true
|
||||
hide_when_full = false
|
||||
hide_seconds = true
|
||||
notify_low_level = true
|
||||
threshold_full = 95
|
||||
}
|
||||
|
||||
systemd redshift {
|
||||
unit = "redshift.service"
|
||||
user = true
|
||||
format = " "
|
||||
on_click 1 = "exec $HOME/.i3/scripts/toggle-app redshift"
|
||||
color_bad = '#F4Bf75'
|
||||
color_degraded = '#F4Bf75'
|
||||
}
|
||||
|
||||
systemd spotify {
|
||||
unit = "spotify.service"
|
||||
user = true
|
||||
format = " "
|
||||
color_bad = '#F4Bf75'
|
||||
color_degraded = '#F4Bf75'
|
||||
}
|
||||
|
||||
yubikey {
|
||||
format = '[ YubiKey[\?if=is_gpg ][\?if=is_u2f ] ]'
|
||||
}
|
||||
|
||||
clock {
|
||||
format = ["{DE}", "{NZ}", "{Cuba}", "{MX}", "{CZ}", "{NL}", "{VN}"]
|
||||
format_time = " {name} \[KW %V\] %a %d.%m.%Y %H:%M:%S "
|
||||
}
|
||||
|
||||
wifi {
|
||||
bitrate_bad = 0
|
||||
bitrate_degraded = 0
|
||||
format = " {signal_percent} {ssid} | down "
|
||||
down_color = "good"
|
||||
}
|
||||
|
||||
spotify {
|
||||
format = " {title} - {artist} "
|
||||
format_down = " off "
|
||||
format_stopped = " stopped "
|
||||
cache_timeout = 1
|
||||
color_offline = '#FFFFFF'
|
||||
on_click 1 = "exec $HOME/.i3/scripts/spotify-control toggle"
|
||||
on_click 3 = "exec $HOME/.i3/scripts/spotify-control next"
|
||||
}
|
||||
|
||||
external_script presentation_mode {
|
||||
format = " Present: {output} "
|
||||
script_path = "$HOME/.i3/scripts/presentation-mode status"
|
||||
strip_output = True
|
||||
on_click 1 = "exec $HOME/.i3/scripts/presentation-mode toggle"
|
||||
|
||||
}
|
||||
|
||||
online_status {
|
||||
icon_on = ""
|
||||
icon_off = ""
|
||||
format = " {icon} "
|
||||
}
|
||||
|
||||
volume_status output {
|
||||
cache_timeout = 10
|
||||
format = " {percentage}% "
|
||||
format_muted = " mute "
|
||||
thresholds = []
|
||||
command = "pactl"
|
||||
color_muted = '#FFFFFF'
|
||||
}
|
||||
|
||||
volume_status input {
|
||||
cache_timeout = 10
|
||||
format = " active "
|
||||
format_muted = " mute "
|
||||
thresholds = [(0, 'good'), (1, 'bad')]
|
||||
command = "pactl"
|
||||
color_muted = '#FFFFFF'
|
||||
is_input = True
|
||||
}
|
||||
9
i3/scripts/bar-update
Executable file
9
i3/scripts/bar-update
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ "$1" ]] ; then
|
||||
modules="$1"
|
||||
else
|
||||
modules=all
|
||||
fi
|
||||
|
||||
py3-cmd refresh "$modules"
|
||||
@@ -2,7 +2,10 @@
|
||||
|
||||
### From http://www.archlinux.org/index.php/i3
|
||||
|
||||
_logfile="$XDG_RUNTIME_DIR/i3exit.log"
|
||||
_logfile="$LOGDIR/i3/i3exit.log"
|
||||
LOCKSCREEN="$LIBDIR/lockscreen"
|
||||
|
||||
_fallback_color="000000"
|
||||
|
||||
touch "$_logfile"
|
||||
|
||||
@@ -15,10 +18,27 @@ log()
|
||||
lock()
|
||||
{
|
||||
set -x
|
||||
playerctl -p spotify pause
|
||||
playing=0
|
||||
if [[ "$(playerctl -p spotify status)" == "Playing" ]] ; then
|
||||
playing=1
|
||||
fi
|
||||
if (( $playing )) ; then
|
||||
playerctl -p spotify pause
|
||||
fi
|
||||
|
||||
i3lock --nofork --show-failed-attempts --ignore-empty-password \
|
||||
--color "000000"
|
||||
if [[ -f "$LOCKSCREEN" ]] ; then
|
||||
resized_lockscreen=$(mktemp)
|
||||
convert "${LOCKSCREEN}" -resize "${MACHINE_RESOLUTION_X}x${MACHINE_RESOLUTION_Y}" "${resized_lockscreen}"
|
||||
i3lock --nofork --show-failed-attempts --ignore-empty-password \
|
||||
--image "${resized_lockscreen}"
|
||||
rm "${resized_lockscreen}"
|
||||
else
|
||||
i3lock --nofork --show-failed-attempts --ignore-empty-password \
|
||||
--color "$_fallback_color"
|
||||
fi
|
||||
if (( $playing )) ; then
|
||||
playerctl -p spotify play
|
||||
fi
|
||||
}
|
||||
|
||||
screen_off() {
|
||||
@@ -32,11 +52,10 @@ reset_screen() {
|
||||
lock_and_screen_off() {
|
||||
lock &
|
||||
_pid=$!
|
||||
dunst_paused=$(dunstctl is-paused)
|
||||
[[ "${dunst_paused}" != "true" ]] && dunstctl set-paused true
|
||||
dunstctl disable
|
||||
screen_off
|
||||
wait $_pid
|
||||
[[ "${dunst_paused}" != "true" ]] && dunstctl set-paused false
|
||||
dunstctl enable
|
||||
reset_screen
|
||||
}
|
||||
|
||||
|
||||
137
i3/scripts/pa-volume
Executable file
137
i3/scripts/pa-volume
Executable file
@@ -0,0 +1,137 @@
|
||||
#!/bin/bash
|
||||
|
||||
# name of the sink. execute pactl list sinks to get a list
|
||||
SINKNAME="$(pactl info | grep '^Default Sink:' | cut -d ' ' -f 3-)"
|
||||
|
||||
# name of the sink. execute pactl list sinks to get a list
|
||||
SOURCENAME="$(pactl info | grep '^Default Source:' | cut -d ' ' -f 3-)"
|
||||
|
||||
#SINKNAME="alsa_output.usb-Logitech_Logitech_Wireless_Headset_88C626354D45-00.analog-stereo"
|
||||
# this is the worst
|
||||
SINK=$(( $(pactl list sinks | grep "Name: " | grep -n "${SINKNAME}"$ | grep -o "^[[:digit:]]*") -1))
|
||||
|
||||
SOURCE=$(( $(pactl list sources | grep "Name: " | grep -n "${SOURCENAME}"$ | grep -o "^[[:digit:]]*") -1))
|
||||
|
||||
|
||||
getvol() {
|
||||
echo $(pactl list sinks | grep "^[[:space:]]*Volume" | head -n $(( $SINK + 1 )) | tail -n 1 | grep -o "[[:digit:]]*%" | head -n 1 | cut -d "%" -f 1)
|
||||
}
|
||||
|
||||
setvol() {
|
||||
if [[ $1 =~ [+-][0-9]+ ]] ; then
|
||||
oldvol="$(getvol)"
|
||||
echo "oldvol $oldvol"
|
||||
delta="$(echo "$1" | cut -c 2-)"
|
||||
echo "delta $delta"
|
||||
if [[ "$(echo "$1" | cut -c 1)" == "+" ]] ; then
|
||||
echo "+"
|
||||
newvol=$(( $oldvol + $delta ))
|
||||
else
|
||||
echo "-"
|
||||
newvol=$(( $oldvol - $delta ))
|
||||
echo $newvol
|
||||
fi
|
||||
if [[ $newvol -gt 100 ]]; then
|
||||
echo "capping at 100 percent"
|
||||
newvol=100
|
||||
fi
|
||||
if [[ $newvol -lt 0 ]]; then
|
||||
echo "capping at 0 percent"
|
||||
newvol=0
|
||||
fi
|
||||
echo "newvol $newvol"
|
||||
else
|
||||
newvol="$1"
|
||||
fi
|
||||
pactl set-sink-volume $SINKNAME $(( $newvol * 65536 / 100 ))
|
||||
}
|
||||
|
||||
ismuted() {
|
||||
muted=$(pactl list sinks | grep "^[[:space:]]*Mute" | head -n $(( $SINK + 1 )) | tail -n 1 | cut -d " " -f 2)
|
||||
if [[ $muted == "no" ]]; then
|
||||
echo 0
|
||||
else
|
||||
echo 1
|
||||
fi
|
||||
}
|
||||
|
||||
mute() {
|
||||
pactl set-sink-mute $SINKNAME 1
|
||||
}
|
||||
|
||||
unmute() {
|
||||
pactl set-sink-mute $SINKNAME 0
|
||||
}
|
||||
|
||||
mute-toggle() {
|
||||
pactl set-sink-mute $SINKNAME toggle
|
||||
}
|
||||
|
||||
mute-toggle-mic() {
|
||||
pactl set-source-mute $SOURCENAME toggle
|
||||
}
|
||||
|
||||
status() {
|
||||
if [[ $(ismuted) == "1" ]] ; then
|
||||
echo "mute"
|
||||
return
|
||||
fi
|
||||
echo "$(getvol)%"
|
||||
}
|
||||
|
||||
usage() {
|
||||
echo "Usage:"
|
||||
echo
|
||||
echo "$0 get-vol"
|
||||
echo "$0 set-vol VOL_PERC"
|
||||
}
|
||||
|
||||
update_status_bar_sink() {
|
||||
~/.i3/scripts/bar-update "volume_status output"
|
||||
}
|
||||
|
||||
update_status_bar_source() {
|
||||
~/.i3/scripts/bar-update "volume_status input"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
"sink")
|
||||
echo $SINKNAME
|
||||
echo $SINK
|
||||
;;
|
||||
"get-vol")
|
||||
echo $(getvol)
|
||||
;;
|
||||
"set-vol")
|
||||
if [[ -z "$2" ]] ; then
|
||||
usage
|
||||
else
|
||||
setvol "$2"
|
||||
fi
|
||||
update_status_bar_sink
|
||||
;;
|
||||
"mute")
|
||||
mute
|
||||
update_status_bar_sink
|
||||
;;
|
||||
"unmute")
|
||||
unmute
|
||||
update_status_bar_sink
|
||||
;;
|
||||
"mute-toggle")
|
||||
mute-toggle
|
||||
update_status_bar_sink
|
||||
;;
|
||||
"mute-toggle-mic")
|
||||
mute-toggle-mic
|
||||
update_status_bar_source
|
||||
;;
|
||||
"is-muted")
|
||||
echo $(ismuted)
|
||||
;;
|
||||
"status")
|
||||
echo $(status)
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
esac
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
_status_file="${XDG_RUNTIME_DIR}/presentation-mode-on"
|
||||
_autostart="$HOME/.autostart.sh"
|
||||
|
||||
is_on() {
|
||||
[[ -e "${_status_file}" ]]
|
||||
@@ -8,16 +9,22 @@ is_on() {
|
||||
|
||||
switch_on() {
|
||||
touch "${_status_file}"
|
||||
dunstctl set-paused true &
|
||||
dunstctl disable &
|
||||
systemctl --user --no-block stop redshift.service
|
||||
systemctl --user --no-block stop spotify.service
|
||||
~/.i3/scripts/bar-update "external_script presentation_mode"
|
||||
~/.i3/scripts/bar-update "systemd redshift"
|
||||
~/.i3/scripts/bar-update "systemd spotify"
|
||||
}
|
||||
|
||||
switch_off() {
|
||||
rm -f "${_status_file}"
|
||||
dunstctl set-paused false &
|
||||
dunstctl enable &
|
||||
systemctl --user --no-block start redshift.service
|
||||
systemctl --user --no-block start spotify.service
|
||||
~/.i3/scripts/bar-update "external_script presentation_mode"
|
||||
~/.i3/scripts/bar-update "systemd redshift"
|
||||
~/.i3/scripts/bar-update "systemd spotify"
|
||||
}
|
||||
|
||||
|
||||
@@ -25,8 +32,10 @@ case "$1" in
|
||||
status)
|
||||
if is_on ; then
|
||||
printf "on\n"
|
||||
printf '#F4BF75'
|
||||
else
|
||||
printf "off\n"
|
||||
# printf '#F4BF75'
|
||||
fi
|
||||
;;
|
||||
toggle)
|
||||
|
||||
20
i3/scripts/spotify-control
Executable file
20
i3/scripts/spotify-control
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
case "$1" in
|
||||
toggle)
|
||||
cmd="play-pause"
|
||||
;;
|
||||
next)
|
||||
cmd="next"
|
||||
;;
|
||||
previous)
|
||||
cmd="previous"
|
||||
;;
|
||||
*)
|
||||
echo "wrong argument $1"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
playerctl -p spotify "${cmd}"
|
||||
~/.i3/scripts/bar-update spotify
|
||||
20
i3/scripts/spotify-current
Executable file
20
i3/scripts/spotify-current
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env python3
|
||||
import dbus
|
||||
session_bus = dbus.SessionBus()
|
||||
spotify_bus = session_bus.get_object("org.mpris.MediaPlayer2.spotify",
|
||||
"/org/mpris/MediaPlayer2")
|
||||
spotify_properties = dbus.Interface(spotify_bus,
|
||||
"org.freedesktop.DBus.Properties")
|
||||
metadata = spotify_properties.Get("org.mpris.MediaPlayer2.Player", "Metadata")
|
||||
|
||||
# The property Metadata behaves like a python dict
|
||||
# for key, value in metadata.items():
|
||||
# print(key, value)
|
||||
|
||||
# To just print the title
|
||||
print("{}: {} - [{}]".format(
|
||||
metadata['xesam:artist'][0],
|
||||
metadata['xesam:title'],
|
||||
metadata['xesam:album']
|
||||
))
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -o nounset
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
set -o xtrace
|
||||
|
||||
cmds=()
|
||||
|
||||
workspacescratch="${1}"
|
||||
|
||||
i3msgworkspaces="$(i3-msg -t get_workspaces)"
|
||||
|
||||
output_of_pim=$(printf '%s' "${i3msgworkspaces}" | jq -r 'map(select(.name == "'"${workspacescratch}"'")) | .[0].output')
|
||||
|
||||
active_workspace_on_target_output=$(printf '%s' "${i3msgworkspaces}" | jq -r 'map(select(.output == "'"${output_of_pim}"'" and .visible)) | .[0].name')
|
||||
|
||||
focused_workspace_name=$(printf '%s' "${i3msgworkspaces}" | jq -r 'map(select(.focused)) | .[0].name')
|
||||
focused_workspace_output=$(printf '%s' "${i3msgworkspaces}" | jq -r 'map(select(.focused)) | .[0].output')
|
||||
|
||||
if [[ "${focused_workspace_name}" == "${workspacescratch}" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
cmds+=('unmark _destination')
|
||||
cmds+=('mark _source')
|
||||
|
||||
if [[ "${active_workspace_on_target_output}" != "${workspacescratch}" ]] && [[ "${output_of_pim}" != "${focused_workspace_output}" ]]; then
|
||||
need_output_reset=1
|
||||
else
|
||||
need_output_reset=0
|
||||
fi
|
||||
|
||||
if ((need_output_reset)); then
|
||||
cmds+=('workspace "'"${active_workspace_on_target_output}"'"')
|
||||
cmds+=("mark --add _origin")
|
||||
fi
|
||||
|
||||
cmds+=('workspace "'"${workspacescratch}"'"')
|
||||
cmds+=('mark --add _destination')
|
||||
|
||||
cmds+=('[con_mark="^_destination$"] swap container with mark "_source"')
|
||||
|
||||
cmds+=('[con_mark="^_source$"] focus')
|
||||
cmds+=('unmark _source')
|
||||
|
||||
if ((need_output_reset)); then
|
||||
cmds+=('[con_mark="^_origin$"] focus')
|
||||
cmds+=('unmark _origin')
|
||||
fi
|
||||
|
||||
cmds+=('[con_mark="^_destination$"] focus')
|
||||
cmds+=('unmark _destination')
|
||||
|
||||
i3msgcmd=""
|
||||
for cmd in "${cmds[@]}"; do
|
||||
i3msgcmd="${i3msgcmd}${cmd};"
|
||||
done
|
||||
i3-msg "${i3msgcmd}"
|
||||
17
i3/scripts/toggle-app
Executable file
17
i3/scripts/toggle-app
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
app="${1:?app missing}"
|
||||
|
||||
unitname="${app}.service"
|
||||
|
||||
running() {
|
||||
systemctl --user --quiet status "${unitname}" >/dev/null
|
||||
}
|
||||
|
||||
if running ; then
|
||||
systemctl --user stop "${unitname}"
|
||||
else
|
||||
systemctl --user start "${unitname}"
|
||||
fi
|
||||
|
||||
py3-cmd refresh "systemd $app"
|
||||
74
install.sh
74
install.sh
@@ -9,6 +9,27 @@ set -o errexit
|
||||
set -o nounset
|
||||
|
||||
DOTDIR="/var/lib/dotfiles"
|
||||
_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
[[ -e './.git' ]] && git submodule update --init
|
||||
|
||||
if [[ "$(readlink "${_SCRIPT_DIR}")" != "${DOTDIR}" ]] && [[ "${_SCRIPT_DIR}" != "${DOTDIR}" ]] ; then
|
||||
if [[ -e "${DOTDIR}" ]] ; then
|
||||
2>&1 printf "${DOTDIR} already exists. This seems unsafe.\n"
|
||||
exit 1
|
||||
fi
|
||||
printf "Moving directory to $DOTDIR ...\n"
|
||||
sudo=""
|
||||
if (( $(id -u ) != 0 )) ; then
|
||||
sudo=sudo
|
||||
fi
|
||||
$sudo mv --no-target-directory "${_SCRIPT_DIR}" "${DOTDIR}"
|
||||
printf "Done\n"
|
||||
else
|
||||
printf "Already working in ${DOTDIR}, nothing to do\n"
|
||||
fi
|
||||
|
||||
cd "${DOTDIR}"
|
||||
|
||||
os_release_file=/etc/os-release
|
||||
if [[ ! -e "${os_release_file}" ]] ; then
|
||||
@@ -16,10 +37,10 @@ if [[ ! -e "${os_release_file}" ]] ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source "${os_release_file}"
|
||||
source /etc/os-release
|
||||
|
||||
sudowrap() {
|
||||
if (( $(id -u) != 0 )) ; then
|
||||
if (( $(id -u ) != 0 )) ; then
|
||||
sudo "${@}"
|
||||
else
|
||||
"${@}"
|
||||
@@ -27,22 +48,51 @@ sudowrap() {
|
||||
}
|
||||
|
||||
cache_updated=0
|
||||
install() {
|
||||
local package="$1" ; shift
|
||||
|
||||
if [[ $NAME == "Arch Linux" ]] ; then
|
||||
if (( ! cache_updated )) ; then
|
||||
sudowrap pacman -Sy
|
||||
_install() {
|
||||
_package="$1" ; shift
|
||||
if [[ $NAME == "Ubuntu" ]] ; then
|
||||
if ! (( cache_updated )) ; then
|
||||
apt-get update
|
||||
cache_updated=1
|
||||
fi
|
||||
sudowrap pacman -S --needed --noconfirm "${package}"
|
||||
sudowrap apt-get install --assume-yes "${_package}"
|
||||
elif [[ $NAME == "Arch Linux" ]] ; then
|
||||
sudowrap pacman -S --noconfirm "${_package}"
|
||||
else
|
||||
2>&1 printf "Unsupported distro $NAME, exiting"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
command -v make >/dev/null || install "make"
|
||||
command -v ansible >/dev/null || install "ansible"
|
||||
|
||||
cd "${DOTDIR}" && make
|
||||
if ! command -v python3 >/dev/null ; then
|
||||
printf 'Python3 not installed, installing ...\n'
|
||||
_install "python3"
|
||||
_install "python3-venv"
|
||||
printf 'Done\n'
|
||||
fi
|
||||
|
||||
if ! command -v make >/dev/null ; then
|
||||
printf 'Make not installed, installing ...\n'
|
||||
_install "make"
|
||||
printf 'Done\n'
|
||||
fi
|
||||
|
||||
# Required for compiling modules in venv.
|
||||
if ! command -v gcc >/dev/null ; then
|
||||
printf 'gcc not installed, installing ...\n'
|
||||
_install "gcc"
|
||||
printf 'Done\n'
|
||||
fi
|
||||
|
||||
if ! python3 -c 'import venv' 2>/dev/null ; then
|
||||
printf 'Python3 venv module not installed, installing ...\n'
|
||||
_install python3-venv
|
||||
printf 'Done\n'
|
||||
fi
|
||||
|
||||
cd "$DOTDIR" && make
|
||||
|
||||
# fix permissions of the directory
|
||||
sudowrap chgrp -R dotfiles "${DOTDIR}"
|
||||
sudowrap chmod g+wX "${DOTDIR}"
|
||||
|
||||
@@ -3,17 +3,22 @@
|
||||
set -o nounset
|
||||
set -o errexit
|
||||
|
||||
host="${1}" ; shift
|
||||
|
||||
pacman -Sy --noconfirm git # yes its a partial upgrade, but thats just the live cd
|
||||
|
||||
cd /root
|
||||
git clone --recursive https://code.hkoerber.de/hannes/dotfiles.git
|
||||
|
||||
./dotfiles/install_scripts/${host}.sh
|
||||
./dotfiles/install_scripts/ares.sh /dev/sda
|
||||
|
||||
mv /root/dotfiles /mnt/var/lib/dotfiles
|
||||
mv /root/dotfiles /mnt/root/dotfiles
|
||||
cat << EOF > /mnt/root/.bash_profile
|
||||
if /root/dotfiles/install.sh ; then
|
||||
rm -f /root/.bash_profile
|
||||
reboot
|
||||
fi
|
||||
EOF
|
||||
|
||||
umount -R /mnt
|
||||
|
||||
read -p "> Ready for reboot. Press enter for shutdown, then remove the installation media and boot again "
|
||||
|
||||
poweroff
|
||||
@@ -1,10 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Parameters:
|
||||
#
|
||||
# $1: Device
|
||||
|
||||
set -o xtrace
|
||||
set -o nounset
|
||||
set -o errexit
|
||||
|
||||
DEVICE="/dev/sda"
|
||||
DEVICE="${1:?}"
|
||||
|
||||
if [[ ! -b "${DEVICE}" ]] ; then
|
||||
printf '%s does not look like a device' "${DEVICE}"
|
||||
@@ -102,28 +106,6 @@ grub-mkconfig -o /boot/grub/grub.cfg
|
||||
systemctl enable NetworkManager
|
||||
|
||||
passwd
|
||||
|
||||
# enable root autologin on first boot
|
||||
|
||||
mkdir /etc/systemd/system/getty@tty1.service.d/
|
||||
cat << EOF > /etc/systemd/system/getty@tty1.service.d/autologin.conf
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=-/sbin/agetty -o '-p -f -- \\u' --noclear --autologin root %I $TERM
|
||||
EOF
|
||||
# ExecStartPost=/bin/rm /etc/systemd/system/getty@tty1.service.d/autologin.conf
|
||||
# ExecStartPost=/bin/rmdir /etc/systemd/system/getty@tty1.service.d/
|
||||
|
||||
# Run
|
||||
cat << 'EOF' > /root/.bash_profile
|
||||
if [[ "\$(tty)" == "/dev/tty1" ]] ; then
|
||||
rm -rf /etc/systemd/system/getty@tty1.service.d/
|
||||
if /var/lib/dotfiles/install.sh ; then
|
||||
rm -f /root/.bash_profile
|
||||
reboot
|
||||
fi
|
||||
fi
|
||||
EOF
|
||||
CHROOTSCRIPT
|
||||
|
||||
chmod +x /mnt/chroot-script.sh
|
||||
|
||||
@@ -1,131 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -o xtrace
|
||||
set -o nounset
|
||||
set -o errexit
|
||||
|
||||
DEVICE="/dev/nvme0n1"
|
||||
|
||||
if [[ ! -b "${DEVICE}" ]] ; then
|
||||
printf '%s does not look like a device' "${DEVICE}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -d /sys/firmware/efi/efivars ]] ; then
|
||||
printf 'efivars does not exist, looks like the system is not booted in EFI mode'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
loadkeys de-latin1
|
||||
|
||||
timedatectl set-ntp true
|
||||
|
||||
sed -e 's/\s*\([^#]*\).*/\1/' << EOF | sfdisk ${DEVICE}
|
||||
label: gpt
|
||||
device: ${DEVICE}
|
||||
|
||||
${DEVICE}p1 : name=uefi , size=512M , type=uefi
|
||||
${DEVICE}p2 : name=boot , size=512M , type=linux
|
||||
${DEVICE}p3 : name=cryptpart , type=linux
|
||||
EOF
|
||||
|
||||
# might take a bit for the new partion table to be updated in-kernel
|
||||
sleep 1
|
||||
|
||||
cryptsetup --batch-mode luksFormat --iter-time 1000 ${DEVICE}p3
|
||||
cryptsetup --batch-mode open ${DEVICE}p3 cryptpart
|
||||
|
||||
pvcreate /dev/mapper/cryptpart
|
||||
vgcreate vgbase /dev/mapper/cryptpart
|
||||
|
||||
lvcreate -L 32G vgbase -n swap
|
||||
lvcreate -l 100%FREE vgbase -n root
|
||||
|
||||
yes | mkfs.fat -F32 ${DEVICE}p1
|
||||
yes | mkfs.ext4 ${DEVICE}p2
|
||||
yes | mkfs.ext4 /dev/vgbase/swap
|
||||
yes | mkfs.ext4 /dev/vgbase/root
|
||||
|
||||
mount /dev/vgbase/root /mnt
|
||||
|
||||
mkdir /mnt/efi
|
||||
mount ${DEVICE}p1 /mnt/efi
|
||||
|
||||
mkdir /mnt/boot
|
||||
mount ${DEVICE}p2 /mnt/boot
|
||||
|
||||
mkswap /dev/vgbase/swap
|
||||
swapon /dev/vgbase/swap
|
||||
|
||||
pacstrap /mnt base linux-zen linux-firmware networkmanager intel-ucode lvm2 grub efibootmgr
|
||||
|
||||
genfstab -U /mnt >> /mnt/etc/fstab
|
||||
|
||||
cat << CHROOTSCRIPT > /mnt/chroot-script.sh
|
||||
|
||||
set -o xtrace
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
|
||||
ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
|
||||
hwclock --systohc
|
||||
|
||||
sed -i 's/^#de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen
|
||||
sed -i 's/^#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
|
||||
|
||||
locale-gen
|
||||
|
||||
printf 'LANG=en_US.UTF-8\n' > /etc/locale.conf
|
||||
|
||||
printf 'KEYMAP=de-latin1\nFONT=lat2-16\n' > /etc/vconsole.conf
|
||||
|
||||
printf 'neptune\n' > /etc/hostname
|
||||
|
||||
cat <<EOF > /etc/hosts
|
||||
127.0.0.1 localhost
|
||||
::1 localhost
|
||||
127.0.1.1 neptune
|
||||
EOF
|
||||
|
||||
sed -i 's/^HOOKS=.*$/HOOKS=(base udev autodetect keyboard keymap consolefont modconf block encrypt lvm2 filesystems resume fsck)/' /etc/mkinitcpio.conf
|
||||
|
||||
mkinitcpio -P
|
||||
|
||||
grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=GRUB
|
||||
|
||||
sed -i "s/^GRUB_CMDLINE_LINUX=.*$/GRUB_CMDLINE_LINUX=\"cryptdevice=UUID=\$(blkid -s UUID -o value ${DEVICE}p3):cryptpart root=UUID=\$(blkid -s UUID -o value /dev/vgbase/root)\"/" /etc/default/grub
|
||||
sed -i "s/^GRUB_CMDLINE_LINUX_DEFAULT=.*$/GRUB_CMDLINE_LINUX_DEFAULT=\"resume=UUID=\$(blkid -s UUID -o value /dev/vgbase/swap)\"/" /etc/default/grub
|
||||
sed -i 's/^GRUB_DISABLE_RECOVERY=.*$/GRUB_DISABLE_RECOVERY=/' /etc/default/grub
|
||||
|
||||
grub-mkconfig -o /boot/grub/grub.cfg
|
||||
|
||||
systemctl enable NetworkManager
|
||||
|
||||
passwd
|
||||
|
||||
# enable root autologin on first boot
|
||||
|
||||
mkdir /etc/systemd/system/getty@tty1.service.d/
|
||||
cat << EOF > /etc/systemd/system/getty@tty1.service.d/autologin.conf
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=-/sbin/agetty -o '-p -f -- \\u' --noclear --autologin root %I $TERM
|
||||
EOF
|
||||
# ExecStartPost=/bin/rm /etc/systemd/system/getty@tty1.service.d/autologin.conf
|
||||
# ExecStartPost=/bin/rmdir /etc/systemd/system/getty@tty1.service.d/
|
||||
|
||||
# Run
|
||||
cat << 'EOF' > /root/.bash_profile
|
||||
if [[ "\$(tty)" == "/dev/tty1" ]] ; then
|
||||
rm -rf /etc/systemd/system/getty@tty1.service.d/
|
||||
if /var/lib/dotfiles/install.sh ; then
|
||||
rm -f /root/.bash_profile
|
||||
reboot
|
||||
fi
|
||||
fi
|
||||
EOF
|
||||
CHROOTSCRIPT
|
||||
|
||||
chmod +x /mnt/chroot-script.sh
|
||||
arch-chroot /mnt /chroot-script.sh
|
||||
rm -f /mnt/chroot-script.sh
|
||||
384
packages.yml
384
packages.yml
@@ -1,32 +1,33 @@
|
||||
packages:
|
||||
list:
|
||||
kernel:
|
||||
archlinux:
|
||||
- linux-zen-headers
|
||||
- linux-zen-docs
|
||||
build-essentials:
|
||||
ubuntu:
|
||||
- build-essential
|
||||
- exuberant-ctags
|
||||
- cmake
|
||||
archlinux:
|
||||
- gcc
|
||||
- ctags
|
||||
- cmake
|
||||
- maven
|
||||
- base-devel
|
||||
posix:
|
||||
archlinux:
|
||||
- posix
|
||||
make:
|
||||
ubuntu: ["make"]
|
||||
archlinux: ["make"]
|
||||
gdb:
|
||||
ubuntu: ["gdb"]
|
||||
archlinux: ["gdb"]
|
||||
strace:
|
||||
ubuntu: ["strace"]
|
||||
archlinux: ["strace"]
|
||||
sudo:
|
||||
ubuntu: ["sudo"]
|
||||
archlinux: ["sudo"]
|
||||
doas:
|
||||
archlinux: ["opendoas"]
|
||||
apt:
|
||||
ubuntu: ["apt-file"]
|
||||
archlinux: [""]
|
||||
xorg:
|
||||
ubuntu: []
|
||||
archlinux:
|
||||
- xorg-server
|
||||
- xorg-xrandr
|
||||
@@ -37,404 +38,369 @@ packages:
|
||||
- xorg-xset
|
||||
- xorg-xinit
|
||||
dmenu:
|
||||
ubuntu: ["dmenu"]
|
||||
archlinux: ["dmenu"]
|
||||
ansible:
|
||||
archlinux:
|
||||
- ansible
|
||||
- ansible-language-server
|
||||
ubuntu: ["ansible"]
|
||||
archlinux: ["ansible"]
|
||||
xdotool:
|
||||
ubuntu: ["xdotool"]
|
||||
archlinux: ["xdotool"]
|
||||
arandr:
|
||||
ubuntu: ["arandr"]
|
||||
archlinux: ["arandr"]
|
||||
borgbackup:
|
||||
ubuntu: ["borgbackup"]
|
||||
archlinux: ["borgbackup"]
|
||||
docker:
|
||||
ubuntu: ["docker.io", "containerd", "docker-compose"]
|
||||
archlinux: ["docker", "docker-compose"]
|
||||
font-awesome:
|
||||
ubuntu: ["fonts-font-awesome"]
|
||||
archlinux: ["ttf-font-awesome"]
|
||||
font-inconsolata:
|
||||
ubuntu: ["fonts-inconsolata"]
|
||||
archlinux: ["ttf-inconsolata"]
|
||||
font-dejavu:
|
||||
ubuntu: ["fonts-dejavu"]
|
||||
archlinux: ["ttf-dejavu"]
|
||||
font-libertine:
|
||||
ubuntu: ["fonts-linuxlibertine"]
|
||||
archlinux: ["ttf-linux-libertine"]
|
||||
font-emoji:
|
||||
ubuntu: []
|
||||
archlinux: ["noto-fonts-emoji"]
|
||||
git:
|
||||
ubuntu: ["git", "git-extras", "gitk", "git-email"]
|
||||
# tk required for gitk
|
||||
archlinux: ["git", "tk", "git-delta"]
|
||||
archlinux: ["git", "tk"]
|
||||
htop:
|
||||
ubuntu: ["htop"]
|
||||
archlinux: ["htop"]
|
||||
feh:
|
||||
ubuntu: ["feh"]
|
||||
archlinux: ["feh"]
|
||||
i3:
|
||||
archlinux:
|
||||
- i3-wm
|
||||
- i3status-rust
|
||||
ubuntu: ["i3"]
|
||||
archlinux: ["i3-wm"]
|
||||
i3lock:
|
||||
ubuntu: ["i3lock"]
|
||||
archlinux: ["i3lock"]
|
||||
pluma:
|
||||
ubuntu: ["pluma"]
|
||||
archlinux: ["pluma"]
|
||||
neovim:
|
||||
ubuntu: ["neovim"]
|
||||
archlinux: ["neovim", "python-pynvim"]
|
||||
network-manager-applet:
|
||||
ubuntu: []
|
||||
archlinux: ["network-manager-applet"]
|
||||
pasystray:
|
||||
ubuntu: ["pasystray"]
|
||||
archlinux: ["pasystray"]
|
||||
redshift:
|
||||
ubuntu: ["redshift-gtk"]
|
||||
archlinux: ["redshift"]
|
||||
pavucontrol:
|
||||
ubuntu: ["pavucontrol"]
|
||||
archlinux: ["pavucontrol-qt"]
|
||||
pinentry-qt:
|
||||
ubuntu: ["pinentry-curses", "pinentry-qt"]
|
||||
archlinux: ["pinentry"]
|
||||
pinta:
|
||||
ubuntu: ["pinta"]
|
||||
archlinux: ["pinta"]
|
||||
py3status:
|
||||
ubuntu: ["py3status", "python3-arrow", "python3-tzlocal", "python3-pydbus"]
|
||||
archlinux: ["py3status", "python-pytz", "python-tzlocal", "python-dbus", "python-pydbus"]
|
||||
pass:
|
||||
archlinux: ["pass", "passff-host", "xclip"]
|
||||
ubuntu: ["pass"]
|
||||
archlinux: ["pass", "passff-host"]
|
||||
keepassx:
|
||||
ubuntu: ["keepassx"]
|
||||
archlinux: []
|
||||
urxvt:
|
||||
ubuntu: ["rxvt-unicode-256color"]
|
||||
archlinux: ["rxvt-unicode"]
|
||||
alacritty:
|
||||
ubuntu: []
|
||||
archlinux: ["alacritty"]
|
||||
tmux:
|
||||
ubuntu: ["tmux"]
|
||||
archlinux: ["tmux"]
|
||||
screen:
|
||||
ubuntu: ["screen"]
|
||||
archlinux: ["screen"]
|
||||
zsh:
|
||||
ubuntu: ["zsh", "zsh-syntax-highlighting"]
|
||||
archlinux: ["zsh", "zsh-syntax-highlighting", "zsh-autosuggestions", "zsh-completions"]
|
||||
zathura:
|
||||
ubuntu: ["zathura", "zathura-pdf-poppler"]
|
||||
archlinux: ["zathura", "zathura-pdf-poppler"]
|
||||
pdf:
|
||||
ubuntu: ["ghostscript", "enscript"]
|
||||
archlinux: ["ghostscript", "enscript"]
|
||||
pandoc:
|
||||
ubuntu:
|
||||
- pandoc
|
||||
- texlive
|
||||
- python3-sphinxcontrib.svg2pdfconverter # for html to pdf conversions
|
||||
- texlive-latex-extra
|
||||
archlinux: ["pandoc", "texlive-core", "texlive-fontsextra", "texlive-latexextra"]
|
||||
libvirt:
|
||||
archlinux: ["virt-manager", "libvirt", "dnsmasq", "ebtables", "dmidecode", "virt-install", "virt-viewer", "libguestfs", "edk2-ovmf"]
|
||||
ubuntu: ["virt-manager", "libvirt-daemon"]
|
||||
archlinux: ["virt-manager", "libvirt", "dnsmasq", "ebtables", "dmidecode"]
|
||||
firefox:
|
||||
ubuntu: ["firefox"]
|
||||
archlinux: ["firefox"]
|
||||
ranger:
|
||||
ubuntu: ["ranger"]
|
||||
archlinux: ["ranger"]
|
||||
thunar:
|
||||
ubuntu: ["thunar"]
|
||||
archlinux: ["thunar"]
|
||||
unclutter:
|
||||
ubuntu: ["unclutter"]
|
||||
archlinux: ["unclutter"]
|
||||
libreoffice:
|
||||
ubuntu: ["libreoffice"]
|
||||
archlinux: ["libreoffice-fresh", "libreoffice-fresh-de"]
|
||||
qt-theming:
|
||||
ubuntu: ["breeze-cursor-theme", "breeze-icon-theme", "breeze", "qt5ct"]
|
||||
archlinux: ["breeze", "breeze-icons", "breeze-grub", "qt5ct"]
|
||||
gtk-theming:
|
||||
ubuntu: ["gtk3-engines-breeze", "lxappearance"]
|
||||
archlinux: ["breeze-gtk", "lxappearance"]
|
||||
xcompmgr:
|
||||
ubuntu: ["xcompmgr"]
|
||||
archlinux: ["xcompmgr"]
|
||||
python:
|
||||
archlinux:
|
||||
- python3
|
||||
- python-lsp-server
|
||||
ubuntu: ["python3", "python3-pip", "python3-venv", "virtualenv", "pylint3"]
|
||||
archlinux: ["python3"]
|
||||
python-modules:
|
||||
ubuntu: []
|
||||
archlinux:
|
||||
- python-ruamel-yaml
|
||||
- python-gitpython
|
||||
- python-semver
|
||||
black:
|
||||
archlinux: ["python-black"]
|
||||
xbacklight:
|
||||
ubuntu: ["xbacklight"]
|
||||
archlinux: ["xorg-xbacklight"]
|
||||
wireshark:
|
||||
ubuntu: ["wireshark", "wireshark-qt"]
|
||||
archlinux: ["wireshark-cli", "wireshark-qt"]
|
||||
dia:
|
||||
ubuntu: ["dia"]
|
||||
archlinux: ["dia"]
|
||||
nmap:
|
||||
ubuntu: ["nmap"]
|
||||
archlinux: ["nmap"]
|
||||
openvpn:
|
||||
ubuntu: ["openvpn"]
|
||||
archlinux: ["openvpn"]
|
||||
curl:
|
||||
ubuntu: ["curl"]
|
||||
archlinux: ["curl"]
|
||||
wget:
|
||||
ubuntu: ["wget"]
|
||||
archlinux: ["wget"]
|
||||
tree:
|
||||
ubuntu: ["tree"]
|
||||
archlinux: ["tree"]
|
||||
which:
|
||||
ubuntu: []
|
||||
archlinux: ["which"]
|
||||
zip:
|
||||
ubuntu: ["zip", "unzip"]
|
||||
archlinux: ["zip", "unzip"]
|
||||
traceroute:
|
||||
ubuntu: ["traceroute"]
|
||||
archlinux: ["traceroute"]
|
||||
tcpdump:
|
||||
ubuntu: ["tcpdump"]
|
||||
archlinux: ["tcpdump"]
|
||||
tar:
|
||||
ubuntu: ["tar"]
|
||||
archlinux: ["tar"]
|
||||
rsync:
|
||||
ubuntu: ["rsync"]
|
||||
archlinux: ["rsync"]
|
||||
net-tools:
|
||||
ubuntu: ["net-tools"]
|
||||
archlinux: ["net-tools"]
|
||||
ntfs:
|
||||
ubuntu: ["ntfs-3g"]
|
||||
archlinux: ["ntfs-3g"]
|
||||
lsof:
|
||||
ubuntu: ["lsof"]
|
||||
archlinux: ["lsof"]
|
||||
iptables:
|
||||
ubuntu: ["iptables"]
|
||||
archlinux: ["iptables-nft"]
|
||||
pwgen:
|
||||
ubuntu: ["pwgen"]
|
||||
archlinux: ["pwgen"]
|
||||
gpg:
|
||||
ubuntu: ["gnupg2", "pcscd", "scdaemon"]
|
||||
archlinux: ["gnupg", "paperkey", "yubikey-manager", "yubikey-touch-detector"]
|
||||
networkmanager:
|
||||
ubuntu: ["network-manager", "network-manager-openvpn", "network-manager-openconnect", "network-manager-openconnect-gnome"]
|
||||
archlinux: ["networkmanager"]
|
||||
pulseaudio:
|
||||
archlinux:
|
||||
- pulseaudio
|
||||
- pulseaudio-alsa
|
||||
- lib32-libpulse
|
||||
- alsa-utils
|
||||
- alsa-firmware
|
||||
- sof-firmware
|
||||
- alsa-ucm-conf
|
||||
ubuntu: ["pulseaudio", "pulseaudio-utils"]
|
||||
archlinux: ["pulseaudio", "pulseaudio-alsa", "lib32-libpulse"]
|
||||
iw:
|
||||
ubuntu: ["iw"]
|
||||
archlinux: ["iw"]
|
||||
cowsay:
|
||||
ubuntu: ["cowsay"]
|
||||
archlinux: ["cowsay"]
|
||||
ruby:
|
||||
ubuntu: ["ruby", "ruby-dev", "ruby-bundler"]
|
||||
archlinux: ["ruby"]
|
||||
lxc:
|
||||
ubuntu: ["lxc"]
|
||||
archlinux: ["lxc"]
|
||||
acpi:
|
||||
ubuntu: ["acpid"]
|
||||
archlinux: ["acpi", "acpid"]
|
||||
nodejs:
|
||||
archlinux: ["nodejs", "npm"]
|
||||
npm:
|
||||
ubuntu: ["npm"]
|
||||
archlinux: ["npm"]
|
||||
xdg:
|
||||
ubuntu: ["xdg-utils"]
|
||||
archlinux: ["xdg-utils"]
|
||||
compton:
|
||||
ubuntu: ["compton"]
|
||||
archlinux: []
|
||||
dunst:
|
||||
ubuntu: ["dunst"]
|
||||
archlinux: ["dunst"]
|
||||
cloc:
|
||||
ubuntu: ["cloc"]
|
||||
archlinux: ["cloc"]
|
||||
bluetooth:
|
||||
ubuntu: ["blueman"]
|
||||
archlinux: ["bluez", "bluez-tools", "blueman"]
|
||||
autorandr:
|
||||
ubuntu: ["autorandr"]
|
||||
archlinux: ["autorandr"]
|
||||
bwm-ng:
|
||||
ubuntu: ["bwm-ng"]
|
||||
archlinux: ["bwm-ng"]
|
||||
virtualbox:
|
||||
ubuntu: ["virtualbox"]
|
||||
archlinux: ["virtualbox"]
|
||||
ssh:
|
||||
ubuntu: ["ssh"]
|
||||
archlinux: ["openssh"]
|
||||
sshfs:
|
||||
ubuntu: ["sshfs"]
|
||||
archlinux: ["sshfs"]
|
||||
expect:
|
||||
ubuntu: ["expect"]
|
||||
archlinux: ["expect"]
|
||||
inotify:
|
||||
ubuntu: ["inotify-tools"]
|
||||
archlinux: ["inotify-tools"]
|
||||
rclone:
|
||||
ubuntu: ["rclone"]
|
||||
archlinux: ["rclone"]
|
||||
dnf:
|
||||
archlinux: ["dnf"]
|
||||
rust:
|
||||
archlinux:
|
||||
- rustup
|
||||
- cargo-edit
|
||||
- cargo-msrv
|
||||
- cargo-watch
|
||||
- cargo-release
|
||||
- cargo-sort
|
||||
ubuntu: []
|
||||
archlinux: []
|
||||
rustup:
|
||||
ubuntu: []
|
||||
archlinux: ["rustup"]
|
||||
musescore:
|
||||
ubuntu: ["musescore3"]
|
||||
archlinux: ["musescore"]
|
||||
sipcalc:
|
||||
ubuntu: ["sipcalc"]
|
||||
archlinux: ["sipcalc"]
|
||||
rofi:
|
||||
ubuntu: ["rofi"]
|
||||
archlinux: ["rofi"]
|
||||
imv:
|
||||
ubuntu: ["imv"]
|
||||
archlinux: ["imv"]
|
||||
pacman:
|
||||
ubuntu: []
|
||||
archlinux: ["pacman", "pacman-contrib"]
|
||||
steam:
|
||||
ubuntu: []
|
||||
archlinux: ["steam"]
|
||||
man:
|
||||
ubuntu: ["man-db", "manpages"]
|
||||
archlinux: ["man-db", "man-pages"]
|
||||
nextcloud:
|
||||
ubuntu: ["nextcloud-desktop"]
|
||||
archlinux: ["nextcloud-client"]
|
||||
kwallet:
|
||||
ubuntu: []
|
||||
archlinux: ["kwallet", "kwalletmanager"]
|
||||
pv:
|
||||
ubuntu: ["pv"]
|
||||
archlinux: ["pv"]
|
||||
stress:
|
||||
ubuntu: ["stress"]
|
||||
archlinux: ["stress"]
|
||||
mpris:
|
||||
ubuntu: ["playerctl"]
|
||||
archlinux: ["playerctl"]
|
||||
imagemagick:
|
||||
ubuntu: ["imagemagick"]
|
||||
archlinux: ["imagemagick"]
|
||||
mpv:
|
||||
ubuntu: ["mpv"]
|
||||
archlinux: ["mpv"]
|
||||
gnome-keyring:
|
||||
archlinux: ["gnome-keyring", "seahorse"]
|
||||
ubuntu: ["gnome-keyring"]
|
||||
archlinux: ["gnome-keyring"]
|
||||
element:
|
||||
ubuntu: []
|
||||
archlinux: ["element-desktop"]
|
||||
maim:
|
||||
ubuntu: ["maim"]
|
||||
archlinux: ["maim"]
|
||||
mkinitcpio:
|
||||
ubuntu: []
|
||||
archlinux: ["mkinitcpio"]
|
||||
terraform:
|
||||
ubuntu: []
|
||||
archlinux: ["terraform"]
|
||||
synclient:
|
||||
ubuntu: ["xserver-xorg-input-synaptics"]
|
||||
archlinux: ["xf86-input-synaptics"]
|
||||
ncdu:
|
||||
ubuntu: ["ncdu"]
|
||||
archlinux: ["ncdu"]
|
||||
dust:
|
||||
archlinux: ["dust"]
|
||||
font-utils:
|
||||
archlinux: ["woff2"]
|
||||
jq:
|
||||
archlinux: ["jq"]
|
||||
musl:
|
||||
archlinux: ["musl"]
|
||||
kdeconnect:
|
||||
archlinux: ["kdeconnect"]
|
||||
restic:
|
||||
archlinux: ["restic"]
|
||||
discord:
|
||||
archlinux: ["discord"]
|
||||
kubectl:
|
||||
archlinux: ["kubectl"]
|
||||
bind:
|
||||
archlinux: ["bind"]
|
||||
fzf:
|
||||
archlinux: ["fzf"]
|
||||
chromium:
|
||||
archlinux: ["chromium"]
|
||||
signal:
|
||||
archlinux: ["signal-desktop"]
|
||||
go:
|
||||
archlinux: ["go", "gopls"]
|
||||
helix:
|
||||
archlinux: ["helix"]
|
||||
keepassxc:
|
||||
archlinux: ["keepassxc"]
|
||||
awscli:
|
||||
archlinux: ["aws-cli"]
|
||||
mariadb-client:
|
||||
archlinux: ["mariadb-clients"]
|
||||
php:
|
||||
archlinux: ["php"]
|
||||
exa:
|
||||
archlinux: ["exa"]
|
||||
just:
|
||||
archlinux: ["just"]
|
||||
ripgrep:
|
||||
archlinux: ["ripgrep"]
|
||||
fd:
|
||||
archlinux: ["fd"]
|
||||
bat:
|
||||
archlinux: ["bat"]
|
||||
mdbook:
|
||||
archlinux: ["mdbook"]
|
||||
bash:
|
||||
archlinux:
|
||||
- bash
|
||||
- bash-language-server
|
||||
- shellcheck
|
||||
- shfmt
|
||||
packer:
|
||||
archlinux: ["packer"]
|
||||
c:
|
||||
archlinux:
|
||||
- gcc
|
||||
- clang
|
||||
sed:
|
||||
archlinux:
|
||||
- sed
|
||||
findutils:
|
||||
archlinux:
|
||||
- findutils
|
||||
html:
|
||||
archlinux:
|
||||
- vscode-html-languageserver
|
||||
typescript:
|
||||
archlinux:
|
||||
- typescript
|
||||
- typescript-language-server
|
||||
json:
|
||||
archlinux:
|
||||
- vscode-json-languageserver
|
||||
- gron
|
||||
markdown:
|
||||
archlinux:
|
||||
- marksman
|
||||
lldb:
|
||||
archlinux:
|
||||
- lldb
|
||||
yaml:
|
||||
archlinux:
|
||||
- yaml-language-server
|
||||
qemu:
|
||||
archlinux:
|
||||
- qemu-full
|
||||
- tigervnc
|
||||
cloud-init:
|
||||
archlinux:
|
||||
- cloud-init
|
||||
- cloud-utils
|
||||
netcat:
|
||||
archlinux:
|
||||
- openbsd-netcat
|
||||
telnet:
|
||||
archlinux:
|
||||
- inetutils
|
||||
cloudformation-tools:
|
||||
archlinux:
|
||||
- python-cfn-lint
|
||||
johntheripper:
|
||||
archlinux:
|
||||
- john
|
||||
age:
|
||||
archlinux:
|
||||
- age
|
||||
httpie:
|
||||
archlinux:
|
||||
- httpie
|
||||
yt-dlp:
|
||||
archlinux:
|
||||
- yt-dlp
|
||||
ytfzf:
|
||||
archlinux:
|
||||
- ytfzf
|
||||
- ueberzug
|
||||
ffmpeg:
|
||||
archlinux:
|
||||
- ffmpeg
|
||||
zeal:
|
||||
archlinux:
|
||||
- zeal
|
||||
kcharselect:
|
||||
archlinux:
|
||||
- kcharselect
|
||||
bottom:
|
||||
archlinux:
|
||||
- bottom
|
||||
# for iotop
|
||||
sysstat:
|
||||
archlinux:
|
||||
- sysstat
|
||||
qrencode:
|
||||
archlinux:
|
||||
- qrencode
|
||||
iotop:
|
||||
archlinux:
|
||||
- iotop
|
||||
w3m:
|
||||
archlinux:
|
||||
- w3m
|
||||
ruff:
|
||||
archlinux:
|
||||
- ruff
|
||||
mold:
|
||||
archlinux:
|
||||
- mold
|
||||
arch-packaging:
|
||||
archlinux:
|
||||
- namcap
|
||||
- devtools
|
||||
dron:
|
||||
archlinux:
|
||||
- drone-cli
|
||||
ubuntu: ["woff-tools", "woff2"]
|
||||
archinux: ["woff2"]
|
||||
|
||||
remove:
|
||||
mousepad:
|
||||
ubuntu: ["mousepad"]
|
||||
archlinux: ["mousepad"]
|
||||
chrome:
|
||||
ubuntu: ["google-chrome-stable"]
|
||||
archlinux: []
|
||||
snap:
|
||||
ubuntu: ["snapd"]
|
||||
archlinux: []
|
||||
golang:
|
||||
ubuntu: ["golang-go"]
|
||||
archlinux: ["go"]
|
||||
signal:
|
||||
ubuntu: []
|
||||
archlinux: ["signal-desktop"]
|
||||
vim:
|
||||
ubuntu: ["vim"]
|
||||
archlinux: ["gvim"]
|
||||
discord:
|
||||
ubuntu: []
|
||||
archlinux: ["discord"]
|
||||
rust:
|
||||
ubuntu: ["rustc", "cargo"]
|
||||
archlinux: ["rust"]
|
||||
screen:
|
||||
archlinux: ["screen"]
|
||||
lxc:
|
||||
archlinux: ["lxc"]
|
||||
autorandr:
|
||||
archlinux: ["autorandr"]
|
||||
openvpn:
|
||||
archlinux: ["openvpn"]
|
||||
bluetooth:
|
||||
archlinux: ["bluez", "bluez-tools", "blueman"]
|
||||
|
||||
Submodule pkgbuilds/nodejs-intelephense deleted from 3a5ed60794
Submodule pkgbuilds/portfolio-performance-bin deleted from 035cfcc72e
Submodule pkgbuilds/spotify deleted from 6534d04e7a
Submodule pkgbuilds/vim-plug deleted from 8989fa106c
1071
playbook.yml
1071
playbook.yml
File diff suppressed because it is too large
Load Diff
@@ -55,8 +55,8 @@ adjustment-method=randr
|
||||
; Keep in mind that longitudes west of Greenwich (e.g. the Americas)
|
||||
; are negative numbers.
|
||||
[manual]
|
||||
lat=59.3
|
||||
lon=18.1
|
||||
lat=49.5
|
||||
lon=11
|
||||
|
||||
; Configuration of the adjustment-method
|
||||
; type 'redshift -m METHOD:help' to see the settings.
|
||||
|
||||
12
requirements.txt
Normal file
12
requirements.txt
Normal file
@@ -0,0 +1,12 @@
|
||||
ansible==4.6.0
|
||||
ansible-core==2.11.5
|
||||
cffi==1.14.6
|
||||
cryptography==35.0.0
|
||||
Jinja2==3.0.1
|
||||
jmespath==0.10.0
|
||||
MarkupSafe==2.0.1
|
||||
packaging==21.0
|
||||
pycparser==2.20
|
||||
pyparsing==2.4.7
|
||||
PyYAML==5.4.1
|
||||
resolvelib==0.5.4
|
||||
8
screencfg/ares/default.yml
Normal file
8
screencfg/ares/default.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
reset: true
|
||||
outputs:
|
||||
- name: DisplayPort-0
|
||||
opts:
|
||||
mode: 2560x1440
|
||||
rate: "144.00"
|
||||
set:
|
||||
TearFree: "on"
|
||||
14
screencfg/mars/default.yml
Normal file
14
screencfg/mars/default.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
reset: false
|
||||
outputs:
|
||||
- name: eDP-1
|
||||
primary: True
|
||||
opts:
|
||||
mode: 1920x1080
|
||||
scale: 1x1
|
||||
pos: "0x0" # beware of hex
|
||||
- name: DP-1-1
|
||||
disable: true
|
||||
- name: DP-1-2
|
||||
disable: true
|
||||
- name: DP-1-3
|
||||
disable: true
|
||||
18
screencfg/mars/three-screens.yml
Normal file
18
screencfg/mars/three-screens.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
reset: true
|
||||
outputs:
|
||||
- name: eDP-1
|
||||
opts:
|
||||
mode: 1920x1080
|
||||
scale: 0.7x0.7
|
||||
pos: "0x0" # beware of hex
|
||||
- name: DP-3
|
||||
primary: True
|
||||
opts:
|
||||
mode: 1920x1080
|
||||
right-of: eDP-1
|
||||
reset: true
|
||||
- name: DP-4
|
||||
opts:
|
||||
mode: 1920x1080
|
||||
right-of: DP-3
|
||||
reset: true
|
||||
14
screencfg/neptune/default.yml
Normal file
14
screencfg/neptune/default.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
reset: false
|
||||
outputs:
|
||||
- name: eDP-1
|
||||
primary: True
|
||||
opts:
|
||||
mode: 1920x1080
|
||||
scale: 1x1
|
||||
pos: "0x0" # beware of hex
|
||||
- name: DP-1-1
|
||||
disable: true
|
||||
- name: DP-1-2
|
||||
disable: true
|
||||
- name: DP-1-3
|
||||
disable: true
|
||||
18
screencfg/neptune/three-screens.yml
Normal file
18
screencfg/neptune/three-screens.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
reset: true
|
||||
outputs:
|
||||
- name: eDP-1
|
||||
opts:
|
||||
mode: 1920x1080
|
||||
scale: 0.7x0.7
|
||||
pos: "0x0" # beware of hex
|
||||
- name: DP-3
|
||||
primary: True
|
||||
opts:
|
||||
mode: 1920x1080
|
||||
right-of: eDP-1
|
||||
reset: true
|
||||
- name: DP-4
|
||||
opts:
|
||||
mode: 1920x1080
|
||||
right-of: DP-3
|
||||
reset: true
|
||||
@@ -1,22 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Steam setting: Proton 4.11-13
|
||||
#
|
||||
# * It *must not* have any symlinks for the directmusic dlls like:
|
||||
# pfx/dosdevices/c:/windows/syswow64/dmusic.dll
|
||||
|
||||
set -o nounset
|
||||
set -o xtrace
|
||||
set -o errexit
|
||||
|
||||
|
||||
STEAMAPPS=/var/games/steamapps/
|
||||
|
||||
BASEDIR="${STEAMAPPS}/common/Gothic II"
|
||||
BASEDIR=/var/games/gothic2
|
||||
|
||||
export GAMEDATA=${BASEDIR}/data/
|
||||
export ARCHIVE=${BASEDIR}/gothic2.data.tar.zstd
|
||||
export WINEPREFIX="${STEAMAPPS}/compatdata/39510/pfx/"
|
||||
export WINEPREFIX=${BASEDIR}/wineprefix
|
||||
export WINEARCH=win64
|
||||
|
||||
export WINEVERSION=6.3
|
||||
@@ -25,17 +17,17 @@ DOWNLOADDIR=~/download/gothic2
|
||||
|
||||
mkdir -p "${WINEPREFIX}"
|
||||
|
||||
# if [[ "$(wine --version)" != "wine-${WINEVERSION}" ]] ; then
|
||||
# printf '%s\n' "Wine version ${WINEVERSION} required" >&2
|
||||
# exit 1
|
||||
# fi
|
||||
if [[ "$(wine --version)" != "wine-${WINEVERSION}" ]] ; then
|
||||
printf '%s\n' "Wine version ${WINEVERSION} required" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
archive() {
|
||||
origin="$1"
|
||||
if [[ -e "${ARCHIVE}" ]] ; then
|
||||
return
|
||||
fi
|
||||
tar -cv --zstd -p -f "${ARCHIVE}" -C "${GAMEDATA}" .
|
||||
tar -cv --zstd -p -f "${ARCHIVE}" -C "$1" .
|
||||
}
|
||||
|
||||
extract() {
|
||||
@@ -126,12 +118,16 @@ case $1 in
|
||||
|
||||
curl -C - -L -O "https://github.com/Kirides/GD3D11/releases/download/v17.7-dev20/Gothic2-GD3D11-v17.7-dev20.zip"
|
||||
|
||||
curl -C - -L -o Normalmaps_LHiver.zip "https://www.worldofgothic.de/download.php?id=1530"
|
||||
curl -C - -L -o Normalmaps_LHiver.zip "http://www.gothic-dx11.de/download/Normalmaps_LHiver.zip"
|
||||
|
||||
curl -C - -L -O https://github.com/Kirides/ninja-quickloot/releases/download/v1.9.5/Quickloot.vdf
|
||||
|
||||
curl -C - -L -O https://github.com/szapp/Ninja/releases/download/v2.7.12/Ninja-2.7.12.exe
|
||||
|
||||
laatmp=$(mktemp -d)
|
||||
|
||||
unzip -o LaaHack.zip -d "${laatmp}"
|
||||
|
||||
# winetricks -q dxvk
|
||||
winetricks -q directmusic
|
||||
if command -v setup_dxvk >/dev/null ; then
|
||||
@@ -141,7 +137,7 @@ case $1 in
|
||||
winetricks dxvk
|
||||
fi
|
||||
|
||||
read -p 'During installation, use "${GAMEDATA//\//\\}" as the install directory! <Enter> to continue, <CTRL+C> to abort '
|
||||
read -p 'During installation, use "Z:\var\games\gothic2\data" as the install directory! <Enter> to continue, <CTRL+C> to abort '
|
||||
|
||||
wine "${DOWNLOADDIR}"/g2addon-2_6.exe
|
||||
wine "${DOWNLOADDIR}"/gothic2_fix-2.6.0.0-rev2.exe
|
||||
@@ -154,26 +150,13 @@ case $1 in
|
||||
|
||||
unzip -o "${DOWNLOADDIR}"/Gothic2-GD3D11-v17.7-dev20.zip -d ./system/
|
||||
|
||||
ln Data/ModVDF/LHE204_DE.mod Data/LHE204_DE.mod
|
||||
|
||||
cp "${DOWNLOADDIR}"/Quickloot.vdf ./Data
|
||||
|
||||
t="./system/GD3D11/Textures/replacements/Normalmaps_xxx"
|
||||
mkdir -p "${t}"
|
||||
set +o errexit
|
||||
unzip -o "${DOWNLOADDIR}"/Normalmaps_LHiver.zip -d "${t}"
|
||||
zip_exit="$?"
|
||||
set -o errexit
|
||||
if (( $zip_exit != 0 )) && (( $zip_exit != 2 )) ; then
|
||||
echo zip failed
|
||||
exit 1
|
||||
fi
|
||||
unset t
|
||||
|
||||
laatmp=$(mktemp -d)
|
||||
|
||||
unzip -o "${DOWNLOADDIR}"/LaaHack.zip -d "${laatmp}"
|
||||
|
||||
read -p "For the LAA Hack, select only ${GAMEDATA}/system/Gothic2.exe [<Enter> to continue] "
|
||||
wine "${laatmp}"/LaaHack.exe
|
||||
rm -rf "${laatmp}"
|
||||
@@ -182,6 +165,7 @@ case $1 in
|
||||
read -p "Now run the game once and exit! [<Enter> to continue] "
|
||||
|
||||
ini
|
||||
ln Data/ModVDF/LHE204_DE.mod Data/LHE204_DE.mod
|
||||
;;
|
||||
ini)
|
||||
ini
|
||||
|
||||
@@ -21,8 +21,6 @@ gzip -k -f -v "${tmpdir}/dotfiles.tar"
|
||||
test_ares() {
|
||||
if [[ -d "/var/cache/pacman/pkg/" ]] ; then
|
||||
dockeropts=(-v "/var/cache/pacman/pkg/:/var/cache/pacman/pkg_host/")
|
||||
else
|
||||
echo "Warning: /var/cache/pacman/pkg/ does not exist. Create it to speed up multiple runs" >&2
|
||||
fi
|
||||
docker pull docker.io/library/archlinux:base
|
||||
docker run \
|
||||
@@ -40,10 +38,10 @@ test_ares() {
|
||||
# At worst, the cache directory will be ignored if it does not exist
|
||||
# Pacman will always prefer the first cache directory, so newly downloaded
|
||||
# packages will stay in the container
|
||||
sed -i '"'"'s/^#\?\(CacheDir.*\)/CacheDir = \/var\/cache\/pacman\/pkg_host\/\n\1/'"'"' /etc/pacman.conf
|
||||
sed -i '"'"'s/^#\?\(CacheDir.*\)/\1\nCacheDir = \/var\/cache\/pacman\/pkg_host\//'"'"' /etc/pacman.conf
|
||||
|
||||
mkdir -p /var/cache/pacman/pkg_host/
|
||||
pacman -Syu --noconfirm linux
|
||||
pacman -Syu --noconfirm linux python3
|
||||
mkdir /var/cache/pacman/pkg_host/
|
||||
cd $(mktemp -d)
|
||||
tar xf /tmp/dotfiles.tar.gz -C .
|
||||
ANSIBLE_EXTRA_ARGS="-e manage_services=false" ./install.sh
|
||||
@@ -51,29 +49,25 @@ test_ares() {
|
||||
}
|
||||
|
||||
test_neptune() {
|
||||
docker run \
|
||||
-ti \
|
||||
--rm \
|
||||
-v ${tmpdir}/dotfiles.tar.gz:/tmp/dotfiles.tar.gz:ro \
|
||||
--mount type=tmpfs,destination=/var/cache/pacman/pkg/ \
|
||||
"${dockeropts[@]}" \
|
||||
--hostname neptune \
|
||||
docker.io/library/archlinux:base \
|
||||
sh -c '
|
||||
set -o errexit
|
||||
docker pull docker.io/library/ubuntu:20.04
|
||||
docker run -ti --rm -v ${tmpdir}/dotfiles.tar.gz:/tmp/dotfiles.tar.gz:ro --hostname neptune docker.io/library/ubuntu:20.04 sh -c '
|
||||
set -o errexit
|
||||
|
||||
# Uncomment CacheDir and append the host pacman cache as cachedir
|
||||
# At worst, the cache directory will be ignored if it does not exist
|
||||
# Pacman will always prefer the first cache directory, so newly downloaded
|
||||
# packages will stay in the container
|
||||
sed -i '"'"'s/^#\?\(CacheDir.*\)/CacheDir = \/var\/cache\/pacman\/pkg_host\/\n\1/'"'"' /etc/pacman.conf
|
||||
cd $(mktemp -d)
|
||||
tar xf /tmp/dotfiles.tar.gz -C .
|
||||
ANSIBLE_EXTRA_ARGS="-e manage_services=false" ./install.sh
|
||||
'
|
||||
}
|
||||
|
||||
mkdir -p /var/cache/pacman/pkg_host/
|
||||
pacman -Syu --noconfirm linux
|
||||
cd $(mktemp -d)
|
||||
tar xf /tmp/dotfiles.tar.gz -C .
|
||||
ANSIBLE_EXTRA_ARGS="-e manage_services=false" ./install.sh
|
||||
'
|
||||
test_mars() {
|
||||
docker pull docker.io/library/ubuntu:20.04
|
||||
docker run -ti --rm -v ${tmpdir}/dotfiles.tar.gz:/tmp/dotfiles.tar.gz:ro --hostname mars docker.io/library/ubuntu:20.04 sh -c '
|
||||
set -o errexit
|
||||
|
||||
cd $(mktemp -d)
|
||||
tar xf /tmp/dotfiles.tar.gz -C .
|
||||
ANSIBLE_EXTRA_ARGS="-e manage_services=false" ./install.sh
|
||||
'
|
||||
}
|
||||
|
||||
case "${1:-all}" in
|
||||
@@ -83,8 +77,12 @@ case "${1:-all}" in
|
||||
neptune)
|
||||
test_neptune
|
||||
;;
|
||||
mars)
|
||||
test_mars
|
||||
;;
|
||||
all)
|
||||
test_ares
|
||||
test_neptune
|
||||
test_mars
|
||||
;;
|
||||
esac
|
||||
|
||||
266
test.sh
266
test.sh
@@ -1,266 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -o nounset
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
|
||||
tmpdir="$(mktemp -d --tmpdir=/var/tmp)"
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
ISO_MIRROR="https://ftp.fau.de/archlinux/iso/latest/"
|
||||
ISO_MIRROR="https://ftp.acc.umu.se/mirror/archlinux/iso/latest/"
|
||||
|
||||
iso_dir="${XDG_DATA_HOME}/arch-iso/"
|
||||
iso_path="${iso_dir}/archlinux-x86_64.iso"
|
||||
|
||||
cleanup() {
|
||||
rm -rf "${tmpdir}"
|
||||
pids=()
|
||||
jobs -p | while IFS="" read -r line; do pids+=("$line"); done
|
||||
kill "${pids[@]}"
|
||||
}
|
||||
|
||||
download_iso() {
|
||||
mkdir -p "${iso_dir}"
|
||||
(
|
||||
cd "${iso_dir}"
|
||||
wget \
|
||||
--timestamping \
|
||||
--no-hsts \
|
||||
"${ISO_MIRROR}sha256sums.txt"
|
||||
|
||||
if [[ ! -e "${iso_path}" ]] || ! sha256sum --ignore-missing --check ./sha256sums.txt; then
|
||||
wget \
|
||||
--no-hsts \
|
||||
--output-document "${iso_path}" \
|
||||
"${ISO_MIRROR}archlinux-x86_64.iso"
|
||||
fi
|
||||
)
|
||||
}
|
||||
|
||||
disk="${tmpdir}/disk.qcow2"
|
||||
|
||||
mon_sock="${tmpdir}/mon.sock"
|
||||
|
||||
sshopts=(
|
||||
-o StrictHostKeyChecking=no
|
||||
-o UserKnownHostsFile=/dev/null
|
||||
-o PreferredAuthentications=publickey
|
||||
-o ConnectTimeout=1s
|
||||
-i "${tmpdir}/ssh.key"
|
||||
-l root
|
||||
-p 60022
|
||||
127.0.0.1
|
||||
)
|
||||
|
||||
wait_for_ssh() {
|
||||
echo "waiting for ssh"
|
||||
set +o errexit
|
||||
maxtries=60
|
||||
tries=0
|
||||
while ! ssh -q "${sshopts[@]}" true; do
|
||||
((tries++))
|
||||
if ((tries > maxtries)); then
|
||||
echo "ssh did not become available"
|
||||
exit 3
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
echo "ssh available"
|
||||
set -o errexit
|
||||
}
|
||||
|
||||
qemuopts=(
|
||||
"-m" "size=8G"
|
||||
"-drive" "file=${disk},format=qcow2,if=none,id=root"
|
||||
|
||||
"-accel" "kvm"
|
||||
|
||||
"-drive" "if=pflash,format=raw,readonly=true,file=/usr/share/ovmf/x64/OVMF_CODE.fd"
|
||||
"-drive" "if=pflash,format=raw,file=${tmpdir}/efivars.fd"
|
||||
"-machine" "q35,smm=on,acpi=on"
|
||||
"-smp" "cpus=8,sockets=1,cores=8,threads=1"
|
||||
"-cpu" "host"
|
||||
|
||||
"-netdev" "user,id=net0,hostfwd=tcp::60022-:22"
|
||||
"-device" "virtio-net-pci,netdev=net0"
|
||||
|
||||
"-nodefaults"
|
||||
|
||||
"-vga" "virtio"
|
||||
"-display" "spice-app"
|
||||
)
|
||||
|
||||
send_mon() {
|
||||
local socket="${1}"
|
||||
patterns=(
|
||||
-e 's/ /spc/'
|
||||
-e 's/\./dot/'
|
||||
-e 's/,/comma/' -e 's/-/slash/'
|
||||
-e 's/\//shift-7/'
|
||||
-e 's/\([A-Z]\)/shift-\L\1/'
|
||||
-e 's/=/shift-0/'
|
||||
-e 's/"/shift-2/'
|
||||
-e "s/'/shift-0x2b/"
|
||||
# ^ is a dead key, we would have to send a space to be precise. but it's
|
||||
# going to work out as long as the following char does not combine
|
||||
-e 's/\^/0x29/'
|
||||
-e 's/#/0x2b/'
|
||||
-e 's/\?/shift-0x0c/'
|
||||
-e 's/\\/alt_r-0x0c/' # altgr is alt_r
|
||||
-e 's/\*/shift-0x1b/'
|
||||
-e 's/(/shift-0x09/'
|
||||
-e 's/)/shift-0x0a/'
|
||||
-e 's/^/sendkey /'
|
||||
)
|
||||
|
||||
cat \
|
||||
<(fold -w 1 |
|
||||
sed "${patterns[@]}") \
|
||||
<(echo "sendkey ret") |
|
||||
nc -N -U "${socket}"
|
||||
|
||||
echo "sendkey ret" | nc -N -U "${socket}"
|
||||
}
|
||||
|
||||
install_from_iso() {
|
||||
local hostname="${1}"
|
||||
shift
|
||||
local hostqemuopts=("$@")
|
||||
rm -rf "${tmpdir:?}"/*
|
||||
|
||||
ssh-keygen -f "${tmpdir}"/ssh.key -N '' -t ed25519 -C 'archiso-tmp'
|
||||
|
||||
cloud-localds "${tmpdir}/userdata.img" <(
|
||||
cat <<EOF
|
||||
#cloud-config
|
||||
users:
|
||||
- name: root
|
||||
ssh_authorized_keys:
|
||||
- $(cat "${tmpdir}"/ssh.key.pub)
|
||||
|
||||
EOF
|
||||
)
|
||||
|
||||
cp /usr/share/ovmf/x64/OVMF_VARS.fd "${tmpdir}/efivars.fd"
|
||||
mkisofs \
|
||||
-uid 0 \
|
||||
-gid 0 \
|
||||
-J \
|
||||
-R \
|
||||
-T \
|
||||
-V REPO \
|
||||
-o "${tmpdir}/repo.iso" \
|
||||
.
|
||||
|
||||
qemu-img create \
|
||||
-f qcow2 \
|
||||
"${disk}" \
|
||||
1000G
|
||||
|
||||
opts=(
|
||||
"-cdrom" "${iso_path}"
|
||||
"-boot" "order=d"
|
||||
|
||||
"-drive" "file=${tmpdir}/repo.iso,format=raw,if=virtio,media=cdrom"
|
||||
"-drive" "file=${tmpdir}/userdata.img,format=raw,if=virtio,media=cdrom"
|
||||
|
||||
"-fsdev" "local,id=pacman-cache,path=share,path=/var/cache/pacman/pkg/,readonly=on,security_model=none"
|
||||
"-device" "virtio-9p-pci,fsdev=pacman-cache,mount_tag=pacman-cache"
|
||||
)
|
||||
|
||||
qemu-system-x86_64 -name "${hostname}" "${qemuopts[@]}" "${hostqemuopts[@]}" "${opts[@]}" &
|
||||
wait_for_ssh
|
||||
|
||||
# shellcheck disable=SC2087
|
||||
ssh -tt "${sshopts[@]}" <<EOF || true
|
||||
mkdir /var/cache/pacman-cache-host
|
||||
mount -t 9p -o trans=virtio,version=9p2000.L,ro pacman-cache /var/cache/pacman-cache-host
|
||||
|
||||
# Uncomment CacheDir and prepend the host pacman cache as cachedir
|
||||
# At worst, the cache directory will be ignored if it does not exist
|
||||
# Pacman will always use the first directory with write access for downloads
|
||||
sed -i 's/^#\?\(CacheDir.*\)/\1\nCacheDir = \/var\/cache\/pacman-cache-host\//' /etc/pacman.conf
|
||||
|
||||
mkdir /repo/
|
||||
mount /dev/disk/by-label/REPO /repo/
|
||||
|
||||
printf 'lukspw\nlukspw\nrootpw\nrootpw\n' | \
|
||||
/repo/install_scripts/"${hostname}".sh
|
||||
|
||||
mount /dev/mapper/vgbase-root /mnt
|
||||
|
||||
cat << SPECIALS > /tmp/specials.sh
|
||||
if [[ "\\\$(tty)" == "/dev/tty1" ]] ; then
|
||||
mkdir /var/cache/pacman-cache-host
|
||||
mount -t 9p -o trans=virtio,version=9p2000.L,ro pacman-cache /var/cache/pacman-cache-host
|
||||
|
||||
# Uncomment CacheDir and prepend the host pacman cache as cachedir
|
||||
# At worst, the cache directory will be ignored if it does not exist
|
||||
# Pacman will always use the first directory with write access for downloads
|
||||
sed -i 's/^#\?\(CacheDir.*\)/\1\nCacheDir = \/var\/cache\/pacman-cache-host\//' /etc/pacman.conf
|
||||
fi
|
||||
SPECIALS
|
||||
|
||||
mv /mnt/root/.bash_profile /tmp/rest.sh
|
||||
|
||||
cat /tmp/specials.sh /tmp/rest.sh > /mnt/root/.bash_profile
|
||||
|
||||
rsync -rl /repo/ /mnt/var/lib/dotfiles/
|
||||
|
||||
umount /mnt
|
||||
|
||||
poweroff
|
||||
EOF
|
||||
|
||||
wait
|
||||
}
|
||||
|
||||
configure_new_system() {
|
||||
local hostname="${1}"
|
||||
shift
|
||||
local hostqemuopts=("${@}")
|
||||
|
||||
opts=(
|
||||
"-fsdev" "local,id=pacman-cache,path=share,path=/var/cache/pacman/pkg/,readonly=on,security_model=none"
|
||||
"-device" "virtio-9p-pci,fsdev=pacman-cache,mount_tag=pacman-cache"
|
||||
|
||||
"-monitor" "unix:${mon_sock},server=on,wait=off"
|
||||
)
|
||||
|
||||
qemu-system-x86_64 -name "${hostname}" "${qemuopts[@]}" "${hostqemuopts[@]}" "${opts[@]}" &
|
||||
|
||||
# 5s for grub timeout, 5s for kernel boot
|
||||
echo waiting for luks password prompt ...
|
||||
sleep 10s
|
||||
echo 'lukspw' | send_mon "${mon_sock}"
|
||||
|
||||
echo waiting for boot ...
|
||||
sleep 10s
|
||||
wait
|
||||
}
|
||||
|
||||
machines=(ares neptune)
|
||||
if (($# > 0)); then
|
||||
machines=("${@}")
|
||||
fi
|
||||
|
||||
download_iso
|
||||
|
||||
for hostname in "${machines[@]}"; do
|
||||
case "${hostname}" in
|
||||
ares)
|
||||
hostqemuopts=("-device" "ide-hd,drive=root")
|
||||
;;
|
||||
neptune)
|
||||
hostqemuopts=("-device" "nvme,serial=rootnvme,drive=root")
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
[[ ! "${hostqemuopts[*]}" ]] && exit 1
|
||||
install_from_iso "${hostname}" "${hostqemuopts[@]}"
|
||||
configure_new_system "${hostname}" "${hostqemuopts[@]}"
|
||||
done
|
||||
100
tmux/tmux.conf
100
tmux/tmux.conf
@@ -1,76 +1,68 @@
|
||||
set-option -g default-command "${SHELL}"
|
||||
# This *has* to be set to something with `screen-`, do not set this bindly
|
||||
# to $TERM, e.g. "alacritty"!
|
||||
set-option -g default-terminal "screen-256color"
|
||||
set -g default-command "${SHELL}"
|
||||
set -g default-terminal "xterm-256color"
|
||||
|
||||
set-option -g set-titles on
|
||||
set-option -g set-titles-string '#S'
|
||||
set-option -g automatic-rename
|
||||
set -g set-titles on
|
||||
set -g set-titles-string '#S'
|
||||
setw -g automatic-rename
|
||||
|
||||
set-option -g escape-time 0
|
||||
set-option -g aggressive-resize on
|
||||
set -g prefix C-a
|
||||
unbind C-b
|
||||
bind C-a send-prefix
|
||||
|
||||
set-option -g mouse on
|
||||
unbind C-j
|
||||
|
||||
set-option -g mode-keys vi
|
||||
set -s escape-time 0
|
||||
set-window-option -g aggressive-resize on
|
||||
|
||||
set -g mouse on
|
||||
|
||||
set -g mode-keys vi
|
||||
|
||||
set-option -g renumber-windows on
|
||||
|
||||
set-option -g history-limit 50000
|
||||
bind-key k confirm kill-window
|
||||
bind-key K confirm kill-server
|
||||
|
||||
set-option -g base-index 1
|
||||
set-option -g pane-base-index 1
|
||||
bind h select-pane -L
|
||||
bind j select-pane -D
|
||||
bind k select-pane -U
|
||||
bind l select-pane -R
|
||||
|
||||
set-option -g status-position bottom
|
||||
set-option -g status-justify left
|
||||
set -g bell-action any
|
||||
|
||||
# https://wiki.archlinux.org/title/tmux#256_colors
|
||||
set-option -g -a terminal-overrides ",alacritty:Tc"
|
||||
set -g history-limit 50000
|
||||
|
||||
set-option -g pane-border-status off
|
||||
set-option -g pane-border-format ''
|
||||
set-option -g -q pane-border-lines double;
|
||||
set-option -g -q pane-border-indicators colour;
|
||||
set -g base-index 1
|
||||
set-window-option -g pane-base-index 1
|
||||
|
||||
set-option -g pane-border-style "fg=#555555"
|
||||
set-option -g pane-active-border-style "fg=#e5b567"
|
||||
set -g status-position bottom
|
||||
set -g status-justify left
|
||||
|
||||
set-option -g status-style bg=default
|
||||
|
||||
set-option -g window-status-format ' #I: #W #F '
|
||||
set-option -g window-status-current-format ' #I: #W #F '
|
||||
set-option -g window-status-current-style "bg=#e5b567,fg=black"
|
||||
set-option -g status-bg '#272822'
|
||||
set-option -g status-fg white
|
||||
|
||||
set-option -g monitor-activity on
|
||||
set-option -g visual-activity off
|
||||
set-option -g window-status-activity-style "bg=#ff7777,fg=black"
|
||||
set-option -g monitor-bell on
|
||||
set-option -g bell-action any
|
||||
set-window-option -g window-status-format ' #I: #W #F '
|
||||
set-window-option -g window-status-current-format ' #I: #W #F '
|
||||
|
||||
set-option -g automatic-rename on
|
||||
set-option -g automatic-rename-format '#{pane_current_command}'
|
||||
set-window-option -g monitor-activity on
|
||||
set -g visual-activity on
|
||||
|
||||
set-option -g window-status-separator ' '
|
||||
set-window-option -g automatic-rename on
|
||||
set-window-option -g automatic-rename-format '#{pane_current_command}'
|
||||
|
||||
set-option -g status-left " #[bg=#6c99bb,fg=#2e2e2e] #{session_name} #[bg=default] "
|
||||
set-option -g status-right "#[bg=#CCCCCC,fg=#555555] #{host} #[bg=default] "
|
||||
set-option -g status-left-length 100
|
||||
set-window-option -g window-status-separator ' '
|
||||
|
||||
set-option -g message-style "bg=#CCCCCC,fg=#555555"
|
||||
set -g status-left " #[bg=#A6E22E,fg=#000000] #{session_name} #[bg=#272822] "
|
||||
set -g status-right "#[bg=#CCCCCC,fg=#555555] #{host} #[bg=#272822] "
|
||||
set -g status-left-length 100
|
||||
|
||||
# Use C-a as the prefix
|
||||
set-option -g prefix C-a
|
||||
unbind-key C-b
|
||||
bind-key C-a send-prefix
|
||||
|
||||
bind-key h select-pane -L
|
||||
bind-key j select-pane -D
|
||||
bind-key k select-pane -U
|
||||
bind-key l select-pane -R
|
||||
set -g status-style "bg=#272822,fg=#FFFFFF"
|
||||
set -g message-style "bg=#CCCCCC,fg=#555555"
|
||||
|
||||
# vertical = | in this case
|
||||
unbind-key %
|
||||
unbind-key '"'
|
||||
unbind %
|
||||
unbind '"'
|
||||
bind-key s split-window -v -c "#{pane_current_path}"
|
||||
bind-key v split-window -h -c "#{pane_current_path}"
|
||||
|
||||
@@ -83,4 +75,10 @@ bind-key -n S-down new-window
|
||||
bind-key -n S-left prev
|
||||
bind-key -n S-right next
|
||||
|
||||
bind-key -n C-F1 command-prompt "split-window -h 'exec man %%'"
|
||||
bind-key -n C-F2 split-window -h "exec htop"
|
||||
bind-key -n C-F3 set-option status
|
||||
|
||||
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf sourced"
|
||||
|
||||
bind P paste-buffer
|
||||
|
||||
@@ -1 +1,28 @@
|
||||
portfolio_performace_version: "0.57.2"
|
||||
terraform_version: 1.0.2
|
||||
kubectl_version: v1.22.3
|
||||
go_version: "1.17.1"
|
||||
portfolio_performace_version: "0.55.0"
|
||||
cargo_crate_list:
|
||||
- crate: just
|
||||
binary: just
|
||||
version: 0.10.2
|
||||
- crate: ripgrep
|
||||
binary: rg
|
||||
version: 13.0.0
|
||||
- crate: fd-find
|
||||
binary: fd
|
||||
version: 8.2.1
|
||||
- crate: bat
|
||||
binary: bat
|
||||
version: 0.18.3
|
||||
- crate: exa
|
||||
binary: exa
|
||||
version: 0.10.1
|
||||
- crate: watchexec-cli
|
||||
binary: watchexec
|
||||
version: 1.17.1
|
||||
- url: https://github.com/hakoerber/git-repo-manager
|
||||
binary: grm
|
||||
branch: master
|
||||
source: git
|
||||
toolchain: nightly
|
||||
|
||||
317
vim/vimrc
317
vim/vimrc
@@ -4,42 +4,74 @@ call plug#begin('~/.local/share/nvim/plugged')
|
||||
|
||||
" === plugins ===
|
||||
|
||||
function! Cond(Cond, ...)
|
||||
let opts = get(a:000, 0, {})
|
||||
return a:Cond ? opts : extend(opts, { 'on': [], 'for': [] })
|
||||
endfunction
|
||||
"Plug 'vim-airline/vim-airline'
|
||||
"Plug 'vim-airline/vim-airline-themes'
|
||||
Plug 'itchyny/lightline.vim'
|
||||
Plug 'godlygeek/tabular'
|
||||
Plug 'lepture/vim-jinja'
|
||||
Plug 'majutsushi/tagbar'
|
||||
" Plug 'nblock/vim-dokuwiki'
|
||||
Plug 'reedes/vim-pencil'
|
||||
Plug 'saltstack/salt-vim'
|
||||
"Plug 'sickill/vim-monokai'
|
||||
Plug 'patstockwell/vim-monokai-tasty'
|
||||
" Plug 'sjl/gundo.vim'
|
||||
Plug 'tpope/vim-commentary'
|
||||
Plug 'tpope/vim-fugitive'
|
||||
" Plug 'tpope/vim-speeddating'
|
||||
" Plug 'tpope/vim-surround'
|
||||
Plug 'airblade/vim-gitgutter'
|
||||
Plug 'junegunn/goyo.vim'
|
||||
Plug 'junegunn/limelight.vim'
|
||||
" Plug 'sheerun/vim-polyglot'
|
||||
" Plug 'freitass/todo.txt-vim'
|
||||
Plug 'Valloric/YouCompleteMe'
|
||||
Plug 'nathanaelkane/vim-indent-guides'
|
||||
|
||||
" editing plugins
|
||||
Plug 'godlygeek/tabular', Cond(!exists('g:vscode'))
|
||||
Plug 'nathanaelkane/vim-indent-guides', Cond(!exists('g:vscode'))
|
||||
Plug 'tpope/vim-commentary', Cond(!exists('g:vscode'))
|
||||
Plug 'airblade/vim-gitgutter', Cond(!exists('g:vscode'))
|
||||
"Plugin 'Lokaltog/vim-easymotion'
|
||||
"Plugin 'PeterRincker/vim-argumentative'
|
||||
"Plugin 'flazz/vim-colorschemes'
|
||||
"Plugin 'jmcantrell/vim-virtualenv'
|
||||
"Plugin 'kien/ctrlp.vim'
|
||||
"Plugin 'klen/python-mode'
|
||||
"Plugin 'mbbill/undotree'
|
||||
Plug 'scrooloose/nerdtree'
|
||||
"Plugin 'sjl/gundo.vim'
|
||||
"Plugin 'terryma/vim-expand-region'
|
||||
"Plugin 'terryma/vim-multiple-cursors'
|
||||
"Plugin 'wellle/targets.vim'
|
||||
"Plugin 'wincent/Command-T'
|
||||
Plug 'vimwiki/vimwiki'
|
||||
"Plug 'blindFS/vim-taskwarrior'
|
||||
" Plug 'tbabej/taskwiki'
|
||||
Plug 'rodjek/vim-puppet'
|
||||
Plug 'suan/vim-instant-markdown'
|
||||
"Plug 'marshallward/vim-restructuredtext'
|
||||
"Plug 'vim-syntastic/syntastic'
|
||||
"Plug 'ElmCast/elm-vim'
|
||||
"Plug 'avh4/elm-format'
|
||||
|
||||
" ui
|
||||
Plug 'sickill/vim-monokai', Cond(!exists('g:vscode'))
|
||||
Plug 'itchyny/lightline.vim', Cond(!exists('g:vscode'))
|
||||
Plug 'fatih/vim-go'
|
||||
Plug 'hashivim/vim-terraform'
|
||||
|
||||
" lang integrations
|
||||
Plug 'lepture/vim-jinja', Cond(!exists('g:vscode'))
|
||||
Plug 'fatih/vim-go', Cond(!exists('g:vscode'))
|
||||
Plug 'hashivim/vim-terraform', Cond(!exists('g:vscode'))
|
||||
Plug 'editorconfig/editorconfig-vim', Cond(!exists('g:vscode'))
|
||||
Plug 'rust-lang/rust.vim', Cond(!exists('g:vscode'))
|
||||
Plug 'rodjek/vim-puppet', Cond(!exists('g:vscode'))
|
||||
Plug 'editorconfig/editorconfig-vim'
|
||||
|
||||
" helpers
|
||||
"" distraction free writing
|
||||
Plug 'junegunn/limelight.vim', Cond(!exists('g:vscode'))
|
||||
Plug 'junegunn/goyo.vim', Cond(!exists('g:vscode'))
|
||||
Plug 'reedes/vim-pencil', Cond(!exists('g:vscode'))
|
||||
Plug 'leafgarland/typescript-vim'
|
||||
|
||||
"" markdown
|
||||
Plug 'suan/vim-instant-markdown', Cond(!exists('g:vscode'))
|
||||
Plug 'prettier/vim-prettier', { 'do': 'npm install' }
|
||||
|
||||
Plug 'dense-analysis/ale', Cond(!exists('g:vscode'))
|
||||
Plug 'yuezk/vim-js'
|
||||
Plug 'maxmellon/vim-jsx-pretty'
|
||||
|
||||
Plug 'neoclide/coc.nvim', Cond(!exists('g:vscode'), {'branch': 'release'})
|
||||
Plug 'evanleck/vim-svelte', {'branch': 'main'}
|
||||
|
||||
"Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
||||
|
||||
" Plug 'Chiel92/vim-autoformat'
|
||||
|
||||
Plug 'evanleck/vim-svelte', {'branch': 'main'}
|
||||
|
||||
Plug 'cespare/vim-toml', { 'branch': 'main' }
|
||||
|
||||
call plug#end()
|
||||
filetype plugin indent on
|
||||
@@ -73,7 +105,7 @@ set noerrorbells
|
||||
set noshowmode
|
||||
set numberwidth=2
|
||||
set relativenumber
|
||||
set shortmess=rtiF
|
||||
set shortmess=rti
|
||||
set ruler
|
||||
set scrolloff=7
|
||||
set title
|
||||
@@ -102,7 +134,7 @@ set nowritebackup
|
||||
" == swap ==
|
||||
set swapfile
|
||||
set updatecount=200
|
||||
set updatetime=300
|
||||
set updatetime=10000
|
||||
|
||||
" == undo ==
|
||||
set undolevels=1000
|
||||
@@ -142,14 +174,10 @@ set linebreak
|
||||
set wrap
|
||||
set wrapscan
|
||||
|
||||
" == to use guicolors in terminal ==
|
||||
set termguicolors
|
||||
|
||||
" === keybinds ===
|
||||
set pastetoggle=<F11>
|
||||
|
||||
set signcolumn=yes
|
||||
|
||||
let maplocalleader = "ö"
|
||||
let mapleader = "\<Space>"
|
||||
" map <leader>w: w!<cr>
|
||||
@@ -170,57 +198,83 @@ map Y y$
|
||||
map j gj
|
||||
map k gk
|
||||
|
||||
nnoremap <C-h> <C-w>h
|
||||
nnoremap <C-j> <C-w>j
|
||||
nnoremap <C-k> <C-w>k
|
||||
nnoremap <C-l> <C-w>l
|
||||
|
||||
nmap <C-n> :bnext<CR>
|
||||
nmap <C-p> :bprev<CR>
|
||||
|
||||
map N Nzz
|
||||
map n nzz
|
||||
|
||||
inoremap jj <ESC>
|
||||
|
||||
nnoremap <leader>v <C-w>v<C-w>l
|
||||
|
||||
nnoremap <leader>m :InstantMarkdownPreview<CR>
|
||||
|
||||
nnoremap <leader>u :GundoToggle<CR>
|
||||
nnoremap <leader>d :diffupdate<CR>
|
||||
|
||||
nmap <F9> :Goyo<CR>:TogglePencil<CR>:Limelight!!<CR>
|
||||
nmap <leader>w :Goyo<CR>:TogglePencil<CR>:Limelight!!<CR>
|
||||
|
||||
nmap <leader>c :%w !xclip -selection clipboard<CR>
|
||||
nmap <leader>x :r !xclip -out -selection -clipboard<CR><CR>
|
||||
|
||||
nmap <leader>f :Autoformat<CR>
|
||||
|
||||
" no more ex mode
|
||||
nnoremap Q <nop>
|
||||
|
||||
" Use // in visual mode to search for selection
|
||||
" https://vim.fandom.com/wiki/Search_for_visually_selected_text
|
||||
vnoremap // y/\V<C-R>=escape(@",'/\')<CR><CR>
|
||||
" === autocommands ===
|
||||
|
||||
if exists('g:vscode')
|
||||
xmap gc <Plug>VSCodeCommentary
|
||||
nmap gc <Plug>VSCodeCommentary
|
||||
omap gc <Plug>VSCodeCommentary
|
||||
nmap gcc <Plug>VSCodeCommentaryLine
|
||||
else
|
||||
nnoremap <C-h> <C-w>h
|
||||
nnoremap <C-j> <C-w>j
|
||||
nnoremap <C-k> <C-w>k
|
||||
nnoremap <C-l> <C-w>l
|
||||
"" autosave views when closing and restoring when opening again.
|
||||
"autocmd BufWinLeave *.* mkview
|
||||
"autocmd BufWinEnter *.* silent loadview
|
||||
|
||||
nmap <C-n> :bnext<CR>
|
||||
nmap <C-p> :bprev<CR>
|
||||
" === plugin setup ===
|
||||
|
||||
nnoremap <leader>m :InstantMarkdownPreview<CR>
|
||||
" == colorscheme ==
|
||||
" set background=light
|
||||
" let g:solarized_termcolors=16
|
||||
" let g:solarized_termtrans=1
|
||||
" let g:solarized_contrast="normal"
|
||||
" let g:solarized_visibility="normal"
|
||||
syntax enable
|
||||
silent! colorscheme vim-monokai-tasty
|
||||
|
||||
nnoremap <leader>u :GundoToggle<CR>
|
||||
nnoremap <leader>d :diffupdate<CR>
|
||||
" == tagbar ==
|
||||
nnoremap <F10> :TagbarToggle<CR>
|
||||
let g:tagbar_map_jump = "i"
|
||||
let g:tagbar_left = 0
|
||||
let g:tagbar_vertical = 0
|
||||
let g:tagbar_width = 50
|
||||
let g:tagbar_autoclose = 1
|
||||
let g:tagbar_autofocus = 1
|
||||
let g:tagbar_sort = 0 " 1: sort by name, 0: sort by position
|
||||
let g:tagbar_compact = 1
|
||||
let g:tagbar_indent = 2
|
||||
let g:tagbar_show_linenumbers = 0
|
||||
let g:tagbar_foldlevel = 99 " unfold all
|
||||
|
||||
nmap <F9> :Goyo<CR>:TogglePencil<CR>
|
||||
nmap <leader>w :Goyo<CR>:TogglePencil<CR>:set colorcolumn=<CR>
|
||||
" == airline ==
|
||||
"let g:airline_right_sep = ''
|
||||
"let g:airline_left_sep = ''
|
||||
"let g:airline#extensions#disable_rtp_load = 1
|
||||
"let g:airline_extensions = ['whitespace']
|
||||
"let g:airline_theme='powerlineish'
|
||||
"let g:airline_powerline_fonts = 1
|
||||
"let g:airline_section_x = airline#section#create(['%{tagbar#currenttag("%s", "", "f")}','' , ' %{PencilMode()}', ' [', 'filetype', ']'])
|
||||
"let g:pencil#mode_indicators = {'hard': 'H', 'auto': 'A', 'soft': 'S', 'off': '',}
|
||||
"let g:airline#extensions#whitespace#enabled = 1
|
||||
"let g:airline#extensions#whitespace#symbol = ''
|
||||
"let g:airline#extensions#whitespace#checks = ['trailing']
|
||||
|
||||
nmap <leader>c :%w !xclip -selection clipboard<CR>
|
||||
nmap <leader>x :r !xclip -out -selection -clipboard<CR><CR>
|
||||
|
||||
nmap <leader>f :Autoformat<CR>
|
||||
|
||||
nnoremap <leader>v <C-w>v<C-w>l
|
||||
|
||||
syntax enable
|
||||
silent! colorscheme monokai
|
||||
|
||||
highlight Comment guifg=#64d86b
|
||||
highlight SpecialComment guifg=#64d86b
|
||||
highlight Todo guibg=#a9ebad
|
||||
|
||||
let g:lightline = {
|
||||
\ 'colorscheme': 'wombat',
|
||||
let g:lightline = {
|
||||
\ 'colorscheme': 'powerline',
|
||||
\ 'active': {
|
||||
\ 'left': [ [ 'mode', 'paste' ],
|
||||
\ [ 'readonly', 'filename', 'modified', 'helloworld' ] ],
|
||||
@@ -238,83 +292,66 @@ else
|
||||
\ },
|
||||
\ }
|
||||
|
||||
function! LightLineFilename()
|
||||
return fnamemodify(expand('%F'), ":~:h")
|
||||
endfunction
|
||||
|
||||
function! LightLineFilename()
|
||||
return fnamemodify(expand('%F'), ":~:h")
|
||||
endfunction
|
||||
" == pencil ==
|
||||
let g:pencil#textwidth = 80
|
||||
let g:pencil#autoformat = 1
|
||||
let g:pencil#cursorwrap = 1
|
||||
let g:pencil#wrapModeDefault = 'soft'
|
||||
let g:pencil#cursorwrap = 0
|
||||
|
||||
" == pencil ==
|
||||
let g:pencil#textwidth = 80
|
||||
let g:pencil#autoformat = 1
|
||||
let g:pencil#wrapModeDefault = 'hard'
|
||||
let g:pencil#map#suspend_af = 'K'
|
||||
" == goyo ==
|
||||
let g:goyo_width = 100
|
||||
let g:goyo_height = "90%"
|
||||
let g:goyo_linenr = 0
|
||||
|
||||
" == goyo ==
|
||||
let g:goyo_width = 100
|
||||
let g:goyo_height = "90%"
|
||||
let g:goyo_linenr = 0
|
||||
" == limelight ==
|
||||
let g:limelight_default_coefficient = 0.5
|
||||
|
||||
autocmd! User GoyoEnter Limelight
|
||||
autocmd! User GoyoLeave Limelight!
|
||||
" === functions ===
|
||||
function! DeleteTrailingWS()
|
||||
exe "normal mz"
|
||||
%s/\s\+$//e
|
||||
exe "normal `z"
|
||||
endfunction
|
||||
autocmd BufWritePre * :call DeleteTrailingWS()
|
||||
|
||||
" == limelight ==
|
||||
let g:limelight_default_coefficient = 0.5
|
||||
autocmd FileType yaml set shiftwidth=2
|
||||
autocmd FileType toml set shiftwidth=2
|
||||
set completeopt-=preview
|
||||
let g:ycm_add_preview_to_completeopt = 0
|
||||
|
||||
let g:ale_linters = {'rust': ['rust-analyzer']}
|
||||
set completeopt-=preview
|
||||
let g:ycm_add_preview_to_completeopt = 0
|
||||
|
||||
" === functions ===
|
||||
function! DeleteTrailingWS()
|
||||
exe "normal mz"
|
||||
%s/\s\+$//e
|
||||
exe "normal `z"
|
||||
endfunction
|
||||
autocmd BufWritePre * :call DeleteTrailingWS()
|
||||
let g:instant_markdown_autostart = 0
|
||||
|
||||
autocmd FileType yaml set shiftwidth=2
|
||||
autocmd FileType toml set shiftwidth=2
|
||||
autocmd FileType html setl shiftwidth=2
|
||||
let g:terraform_align = 1
|
||||
let g:terraform_fmt_on_save=1
|
||||
|
||||
let g:instant_markdown_autostart = 0
|
||||
|
||||
let g:terraform_align = 1
|
||||
let g:terraform_fmt_on_save=1
|
||||
|
||||
let g:rustfmt_autosave = 1
|
||||
|
||||
inoremap <silent><expr> <TAB>
|
||||
\ coc#pum#visible() ? coc#pum#next(1) :
|
||||
\ CheckBackspace() ? "\<Tab>" :
|
||||
\ coc#refresh()
|
||||
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
|
||||
|
||||
" Make <CR> to accept selected completion item or notify coc.nvim to format
|
||||
" <C-g>u breaks current undo, please make your own choice.
|
||||
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
|
||||
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
|
||||
|
||||
function! CheckBackspace() abort
|
||||
let col = col('.') - 1
|
||||
return !col || getline('.')[col - 1] =~# '\s'
|
||||
endfunction
|
||||
|
||||
" Use <c-space> to trigger completion.
|
||||
if has('nvim')
|
||||
inoremap <silent><expr> <c-space> coc#refresh()
|
||||
else
|
||||
inoremap <silent><expr> <c-@> coc#refresh()
|
||||
endif
|
||||
|
||||
if has('nvim')
|
||||
inoremap <silent><expr> <c-space> coc#refresh()
|
||||
else
|
||||
inoremap <silent><expr> <c-@> coc#refresh()
|
||||
endif
|
||||
|
||||
" https://stackoverflow.com/a/8585343
|
||||
map <leader>q :bp<bar>sp<bar>bn<bar>bd<CR>
|
||||
|
||||
nmap <silent> gd <Plug>(coc-definition)
|
||||
nmap <silent> gy <Plug>(coc-type-definition)
|
||||
nmap <silent> gi <Plug>(coc-implementation)
|
||||
nmap <silent> gr <Plug>(coc-references)
|
||||
if has("autocmd")
|
||||
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
|
||||
endif
|
||||
|
||||
let g:ycm_server_python_interpreter = "python3"
|
||||
|
||||
au FileType html setl shiftwidth=2
|
||||
|
||||
" Use // in visual mode to search for selection
|
||||
" https://vim.fandom.com/wiki/Search_for_visually_selected_text
|
||||
vnoremap // y/\V<C-R>=escape(@",'/\')<CR><CR>
|
||||
|
||||
if v:version >= 700
|
||||
au BufLeave * let b:winview = winsaveview()
|
||||
au BufEnter * if(exists('b:winview')) | call winrestview(b:winview) | endif
|
||||
endif
|
||||
|
||||
" https://github.com/golang/tools/blob/master/gopls/doc/vim.md
|
||||
let g:go_def_mode='gopls'
|
||||
let g:go_info_mode='gopls'
|
||||
|
||||
" https://stackoverflow.com/a/8585343
|
||||
map <leader>q :bp<bar>sp<bar>bn<bar>bd<CR>
|
||||
|
||||
7
vscode/keybindings.json
Normal file
7
vscode/keybindings.json
Normal file
@@ -0,0 +1,7 @@
|
||||
// Place your key bindings in this file to override the defaultsauto[]
|
||||
[
|
||||
{
|
||||
"key": "ctrl+3",
|
||||
"command": "workbench.action.terminal.focus"
|
||||
}
|
||||
]
|
||||
@@ -1,73 +1,60 @@
|
||||
{
|
||||
"ansible.dockerImage": "",
|
||||
"editor.accessibilitySupport": "off",
|
||||
"editor.cursorSurroundingLines": 7,
|
||||
"editor.fontFamily": "'Droid Sans Mono'",
|
||||
"editor.formatOnSave": true,
|
||||
"editor.lineNumbers": "off",
|
||||
"editor.minimap.showSlider": "always",
|
||||
"editor.renderWhitespace": "none",
|
||||
"workbench.colorTheme": "Visual Studio Light",
|
||||
"vim.neovimPath": "/usr/bin/nvim",
|
||||
"explorer.confirmDelete": false,
|
||||
"explorer.confirmDragAndDrop": false,
|
||||
"explorer.incrementalNaming": "smart",
|
||||
"extensions.ignoreRecommendations": true,
|
||||
"window.zoomLevel": 0,
|
||||
"terraform.telemetry.enabled": false,
|
||||
"editor.formatOnSave": true,
|
||||
"vim.gdefault": true,
|
||||
"vim.visualstar": true,
|
||||
"vim.enableNeovim": true,
|
||||
"git.detectSubmodulesLimit": 50,
|
||||
"files.autoSave": "onFocusChange",
|
||||
"editor.fontFamily": "'Inconsolata','Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",
|
||||
"editor.accessibilitySupport": "off",
|
||||
"editor.lineNumbers": "relative",
|
||||
"editor.mouseWheelZoom": true,
|
||||
"editor.renderWhitespace": "none",
|
||||
"editor.cursorSurroundingLines": 7,
|
||||
"editor.minimap.renderCharacters": false,
|
||||
"editor.minimap.showSlider": "always",
|
||||
"editor.minimap.size": "fill",
|
||||
"files.eol": "\n",
|
||||
"files.hotExit": "off",
|
||||
"files.trimFinalNewlines": true,
|
||||
"files.trimTrailingWhitespace": true,
|
||||
"git.detectSubmodulesLimit": 50,
|
||||
"problems.decorations.enabled": false,
|
||||
"problems.showCurrentInStatus": true,
|
||||
"rust-client.autoStartRls": false,
|
||||
"rust-client.disableRustup": true,
|
||||
"workbench.enableExperiments": false,
|
||||
"workbench.startupEditor": "newUntitledFile",
|
||||
"workbench.activityBar.visible": false,
|
||||
"workbench.iconTheme": "material-icon-theme",
|
||||
"workbench.tree.indent": 12,
|
||||
"window.menuBarVisibility": "toggle",
|
||||
"window.title": "${rootName}${separator}${dirty}${activeEditorShort}${separator}VSCode",
|
||||
"explorer.confirmDragAndDrop": false,
|
||||
"explorer.incrementalNaming": "smart",
|
||||
"search.smartCase": true,
|
||||
"extensions.ignoreRecommendations": true,
|
||||
"terminal.external.linuxExec": "alacritty",
|
||||
"problems.showCurrentInStatus": true,
|
||||
"problems.decorations.enabled": false,
|
||||
"update.mode": "none",
|
||||
"telemetry.enableCrashReporter": false,
|
||||
"telemetry.enableTelemetry": false,
|
||||
"terminal.external.linuxExec": "",
|
||||
"terminal.integrated.mouseWheelScrollSensitivity": 3,
|
||||
"terraform.telemetry.enabled": false,
|
||||
"update.mode": "none",
|
||||
"vim.cursorStylePerMode.insert": "line",
|
||||
"ansible.dockerImage": "",
|
||||
"vim.cursorStylePerMode.normal": "block",
|
||||
"vim.cursorStylePerMode.insert": "line",
|
||||
"vim.cursorStylePerMode.replace": "underline",
|
||||
"vim.easymotion": true,
|
||||
"vim.enableNeovim": true,
|
||||
"vim.gdefault": true,
|
||||
"vim.hlsearch": true,
|
||||
"vim.leader": "<space>",
|
||||
"vim.neovimPath": "/usr/bin/nvim",
|
||||
"vim.vimrc.enable": true,
|
||||
"vim.visualstar": true,
|
||||
"editor.wordWrap": "off",
|
||||
"vscode-neovim.neovimExecutablePaths.linux": "/usr/bin/nvim",
|
||||
"window.menuBarVisibility": "toggle",
|
||||
"window.title": "[code] ${rootName}${separator}${dirty}${activeEditorShort}${separator}VSCode",
|
||||
"workbench.colorCustomizations": {
|
||||
"statusBar.background": "#005f5f",
|
||||
"statusBar.noFolderBackground": "#005f5f",
|
||||
"statusBar.debuggingBackground": "#005f5f"
|
||||
},
|
||||
"workbench.enableExperiments": false,
|
||||
"workbench.iconTheme": "Monokai Classic Icons",
|
||||
"workbench.startupEditor": "newUntitledFile",
|
||||
"workbench.tree.indent": 14,
|
||||
"security.workspace.trust.enabled": false,
|
||||
"scm.inputFontSize": 12,
|
||||
"debug.console.fontSize": 12,
|
||||
"terminal.integrated.fontSize": 12,
|
||||
"files.autoSave": "onFocusChange",
|
||||
"editor.fontWeight": "normal",
|
||||
"editor.cursorStyle": "block",
|
||||
"editor.minimap.renderCharacters": false,
|
||||
"editor.minimap.size": "fit",
|
||||
"workbench.colorTheme": "Monokai Classic",
|
||||
"workbench.tree.renderIndentGuides": "always",
|
||||
"breadcrumbs.icons": false,
|
||||
"window.titleSeparator": " — ",
|
||||
"explorer.excludeGitIgnore": true,
|
||||
"puppet.editorService.formatOnType.enable": true,
|
||||
"puppet.installType": "agent",
|
||||
"puppet.installDirectory": "/usr/bin/puppet",
|
||||
"window.zoomLevel": 0.1,
|
||||
"workbench.activityBar.visible": false
|
||||
}
|
||||
"vim.vimrc.enable": true,
|
||||
"editor.fontSize": 15,
|
||||
"rust-client.disableRustup": true,
|
||||
"rust-client.autoStartRls": false,
|
||||
"terminal.integrated.mouseWheelScrollSensitivity": 3
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
set -o errexit
|
||||
|
||||
codium --install-extension ms-vscode.cpptools
|
||||
codium --install-extension ms-python.python
|
||||
codium --install-extension rust-lang.rust-analyzer
|
||||
codium --install-extension asvetliakov.vscode-neovim
|
||||
codium --install-extension monokai.theme-monokai-pro-vscode
|
||||
codium --install-extension yzhang.markdown-all-in-one
|
||||
codium --install-extension puppet.puppet-vscode
|
||||
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
[
|
||||
// {
|
||||
// "key": "ctrl+3",
|
||||
// "command": "workbench.action.terminal.focus"
|
||||
// },
|
||||
{
|
||||
"key": "ctrl+alt+b",
|
||||
"command": "workbench.action.toggleActivityBarVisibility"
|
||||
},
|
||||
{
|
||||
"key": "ctrl+b",
|
||||
"command": "workbench.action.toggleSidebarVisibility"
|
||||
},
|
||||
{
|
||||
"command": "vscode-neovim.compositeEscape1",
|
||||
"key": "j",
|
||||
"when": "neovim.mode == insert && editorTextFocus",
|
||||
"args": "j"
|
||||
},
|
||||
{
|
||||
"command": "vscode-neovim.compositeEscape2",
|
||||
"key": "k",
|
||||
"when": "neovim.mode == insert && editorTextFocus",
|
||||
"args": "k"
|
||||
}
|
||||
]
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"extensionsGallery": {
|
||||
"serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
|
||||
"cacheUrl": "https://vscode.blob.core.windows.net/gallery/index",
|
||||
"itemUrl": "https://marketplace.visualstudio.com/items",
|
||||
"controlUrl": "",
|
||||
"recommendationsUrl": ""
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
export LOGFILE="$XDG_RUNTIME_DIR/xinitrc.log"
|
||||
export LOGFILE="$LOGDIR/xinitrc.log"
|
||||
|
||||
mkdir -p "${LOGDIR}/i3"
|
||||
|
||||
log() {
|
||||
echo "[$(date +%FT%T)] $*" >> "$LOGFILE"
|
||||
@@ -23,6 +25,7 @@ start_wm() {
|
||||
sleep 1
|
||||
systemctl --user start autostart.target
|
||||
sleep inf
|
||||
# exec systemd-run --user --unit i3_user --pty --setenv=DISPLAY=${DISPLAY} i3 -c "$HOME/.i3/config" >> "$LOGDIR/i3/i3.log"
|
||||
}
|
||||
|
||||
autostart() {
|
||||
|
||||
@@ -1,30 +1,38 @@
|
||||
source /etc/profile
|
||||
|
||||
if [[ "$(passwd --status $USER | awk '{print $2}')" =~ ^(NP|L)$ ]] ; then
|
||||
while ! sudo passwd $USER ; do ; done
|
||||
fi
|
||||
|
||||
_path=(
|
||||
"$HOME/bin"
|
||||
"$HOME/.optbin"
|
||||
"$HOME/.cargo/bin"
|
||||
)
|
||||
|
||||
for part in ${_path[@]} ; do
|
||||
PATH="${part}:$PATH"
|
||||
PATH="$PATH:${part}"
|
||||
done
|
||||
export PATH
|
||||
|
||||
export EDITOR="helix"
|
||||
export VISUAL="helix"
|
||||
export EDITOR="nvim"
|
||||
export VISUAL="nvim"
|
||||
export BROWSER="firefox"
|
||||
|
||||
export PAGER="less"
|
||||
export LESS="FRX"
|
||||
|
||||
export VIMRC="$HOME/.vimrc"
|
||||
|
||||
export WINEPATH="$HOME/games/wine"
|
||||
|
||||
export LOGDIR="$HOME/.var/log"
|
||||
export RUNDIR="$HOME/.var/run"
|
||||
export LIBDIR="$HOME/.var/lib"
|
||||
export BINDIR="$HOME/bin"
|
||||
|
||||
export LANG=en_US.UTF-8
|
||||
export LC_TIME=de_DE.UTF-8
|
||||
export LC_COLLATE=C
|
||||
|
||||
export DOTFILES=~/dotfiles
|
||||
|
||||
export GOPATH=~/.go
|
||||
export PATH=$PATH:$(go env GOPATH)/bin
|
||||
|
||||
@@ -32,17 +40,6 @@ export ACPI_LID_NAME=LID
|
||||
|
||||
export QT_QPA_PLATFORMTHEME=qt5ct
|
||||
|
||||
export XDG_CONFIG_HOME="$HOME/.config"
|
||||
export XDG_CACHE_HOME="$HOME/.cache"
|
||||
export XDG_DATA_HOME="$HOME/.local/share"
|
||||
export XDG_STATE_HOME="$HOME/.local/state"
|
||||
|
||||
export GNUPGHOME="$HOME/.gnupg"
|
||||
|
||||
export PASSWORD_STORE_DIR="$HOME/.password-store"
|
||||
|
||||
export GTK2_RC_FILES=${XDG_CONFIG_HOME}/gtkrc-2.0
|
||||
|
||||
umask 0022
|
||||
|
||||
{% set env = machine.environment | combine(user.environment) %}
|
||||
@@ -50,29 +47,24 @@ umask 0022
|
||||
export {{ k }}="{{ v }}"
|
||||
{% endfor %}
|
||||
|
||||
feature_dir="${XDG_RUNTIME_DIR}/features/"
|
||||
rm -rf "${feature_dir}"/
|
||||
mkdir -p "${feature_dir}"
|
||||
export FEATURE_DIR="${RUNDIR}/features/"
|
||||
rm -rf "${FEATURE_DIR}"/
|
||||
mkdir -p "${FEATURE_DIR}"
|
||||
|
||||
[[ $MACHINE_HAS_NEXTCLOUD == "true" ]] && touch "${feature_dir}"/nextcloud
|
||||
[[ $MACHINE_HAS_KEEPASSX == "true" ]] && touch "${feature_dir}"/keepassx
|
||||
[[ $MACHINE_HAS_STEAM == "true" ]] && touch "${feature_dir}"/steam
|
||||
[[ $MACHINE_HAS_RESTIC_BACKUP == "true" ]] && touch "${feature_dir}"/restic_backup
|
||||
[[ $MACHINE_HAS_NEXTCLOUD == "true" ]] && touch "${FEATURE_DIR}"/nextcloud
|
||||
[[ $MACHINE_HAS_KEEPASSX == "true" ]] && touch "${FEATURE_DIR}"/keepassx
|
||||
[[ $MACHINE_HAS_STEAM == "true" ]] && touch "${FEATURE_DIR}"/steam
|
||||
[[ $MACHINE_HAS_RESTIC_BACKUP == "true" ]] && touch "${FEATURE_DIR}"/restic_backup
|
||||
[[ $MACHINE_HAS_ELEMENT == "true" ]] && touch "${FEATURE_DIR}"/element
|
||||
|
||||
[[ $MACHINE_TYPE == "laptop" ]] && touch "${feature_dir}"/machine_is_laptop
|
||||
[[ $MACHINE_TYPE == "laptop" ]] && touch "${FEATURE_DIR}"/machine_is_laptop
|
||||
|
||||
{% if user.gpg_agent %}
|
||||
touch "${feature_dir}"/gpg_agent
|
||||
touch "${FEATURE_DIR}"/gpg_agent
|
||||
{% endif %}
|
||||
|
||||
# Make important environment variables also usable in the systemd user instance
|
||||
systemd_envs=(
|
||||
DISPLAY
|
||||
GNUPGHOME
|
||||
PATH
|
||||
ACPI_LID_NAME
|
||||
)
|
||||
systemctl --user import-environment "${systemd_envs[@]}"
|
||||
# Make all environment variables also usable in the systemd user instancee
|
||||
systemctl --user import-environment
|
||||
|
||||
# exec startx breaks some logind fuckery, without exec it works
|
||||
if [[ -z $DISPLAY ]] ; then
|
||||
|
||||
45
zsh/zshrc.d/10_shellopts.sh
Normal file
45
zsh/zshrc.d/10_shellopts.sh
Normal file
@@ -0,0 +1,45 @@
|
||||
setopt EXTENDED_HISTORY
|
||||
setopt HIST_EXPIRE_DUPS_FIRST
|
||||
setopt HIST_VERIFY
|
||||
setopt INC_APPEND_HISTORY
|
||||
setopt SHARE_HISTORY
|
||||
setopt AUTO_CD
|
||||
setopt APPEND_HISTORY
|
||||
setopt HIST_IGNORE_DUPS
|
||||
setopt NOHIST_IGNORE_ALL_DUPS
|
||||
setopt HIST_IGNORE_SPACE
|
||||
setopt CORRECT
|
||||
setopt RM_STAR_SILENT
|
||||
setopt BG_NICE
|
||||
setopt CHECK_JOBS
|
||||
setopt HUP
|
||||
setopt LONG_LIST_JOBS
|
||||
|
||||
setopt share_history
|
||||
|
||||
bindkey -e
|
||||
|
||||
autoload -U promptinit
|
||||
promptinit
|
||||
|
||||
autoload -U colors
|
||||
colors
|
||||
|
||||
autoload -U compinit
|
||||
compinit
|
||||
zstyle ':completion:*' menu select
|
||||
setopt completealiases
|
||||
|
||||
autoload -U edit-command-line
|
||||
zle -N edit-command-line
|
||||
bindkey '^xe' edit-command-line
|
||||
bindkey '^x^e' edit-command-line
|
||||
|
||||
HISTSIZE=10000
|
||||
SAVEHIST=10000
|
||||
HISTFILE="$HOME/.zsh_history"
|
||||
|
||||
autoload -Uz vcs_info
|
||||
zstyle ':vcs_info:*' enable git hg
|
||||
zstyle ':vcs_info:*' check-for-changes true
|
||||
zstyle ':vcs_info:git*' formats "%{${fg[cyan]}%}[%{${fg[green]}%}%s%{${fg[cyan]}%}][%{${fg[blue]}%}%r/%S%%{${fg[cyan]}%}][%{${fg[blue]}%}%b%{${fg[yellow]}%}%m%u%c%{${fg[cyan]}%}]%{$reset_color%}"
|
||||
307
zsh/zshrc.d/20_aliases.sh
Normal file
307
zsh/zshrc.d/20_aliases.sh
Normal file
@@ -0,0 +1,307 @@
|
||||
alias vim="nvim"
|
||||
|
||||
### BETTER COMMANDS
|
||||
alias ls="exa --oneline --icons --group-directories-first"
|
||||
alias ll='ls --all --long --classify --group --modified --time-style=long-iso --git'
|
||||
alias la='ls --all'
|
||||
|
||||
alias spm="sudo pacman"
|
||||
|
||||
alias tml="tmux list-sessions"
|
||||
alias tma="tmux ls 2>/dev/null && tmux attach-session || tmux"
|
||||
alias tmn="tmux new-session -A -s"
|
||||
|
||||
alias clipc="xclip -selection primary"
|
||||
alias clipo="xclip -out -selection clipboard"
|
||||
|
||||
alias rgrep="grep -r"
|
||||
|
||||
alias vimrc="vim -c ':e \$MYVIMRC'"
|
||||
alias zshrc="vim -c ':e ~/.zshrc' ; source ~/.zshrc"
|
||||
|
||||
alias calc='python3 -ic "from math import *; import cmath"'
|
||||
|
||||
alias le_haxxor_1='clear && dmesg | pv -qL 20'
|
||||
alias le_haxxor_2='clear && hexdump -C /dev/urandom | pv -qlL 2'
|
||||
|
||||
alias root='sudo -sE'
|
||||
|
||||
### USEFUL DEFAULT OPTIONS
|
||||
alias tmux="tmux -2"
|
||||
|
||||
alias chmod="chmod -c"
|
||||
alias chown="chown -c"
|
||||
|
||||
alias diff="diff --color=auto"
|
||||
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
|
||||
alias rm='rm -v'
|
||||
alias cp='cp -vi'
|
||||
alias mv='mv -vi'
|
||||
alias ln='ln -v'
|
||||
|
||||
alias du='du -h'
|
||||
alias df='df -h'
|
||||
|
||||
### SHORTENING COMMAND NAMES
|
||||
alias cs="cryptsetup"
|
||||
alias v="vim"
|
||||
alias g="git"
|
||||
alias c="cd"
|
||||
alias l="ls"
|
||||
alias s="sudo"
|
||||
alias cl="clear"
|
||||
|
||||
alias nocolor="sed -r \"s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g\""
|
||||
|
||||
alias ip="ip -color"
|
||||
|
||||
alias vimtask="vim -c :TW"
|
||||
|
||||
alias tw="task"
|
||||
alias twl="task list"
|
||||
alias twa="task add"
|
||||
alias twd="task done"
|
||||
alias inbox="task add +inbox"
|
||||
|
||||
alias yaml2json="python3 -c 'import sys, yaml, json; json.dump(yaml.safe_load(sys.stdin), sys.stdout, indent=4)'"
|
||||
alias json2yaml="python3 -c 'import sys, yaml, json; yaml.safe_dump(json.loads(sys.stdin.read()), stream=sys.stdout)'"
|
||||
|
||||
alias currentbranch='git rev-parse --abbrev-ref HEAD'
|
||||
|
||||
alias issh="ssh -o StrictHostKeyChecking=false -o UserKnownHostsFile=/dev/null"
|
||||
alias gfix='git commit --amend --no-edit'
|
||||
alias gfixa='git commit --amend --no-edit --all '
|
||||
alias gfixp='git commit --amend --no-edit --patch'
|
||||
|
||||
alias issh="ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
|
||||
|
||||
alias newpw="pwgen --secure 25 1"
|
||||
|
||||
alias sys="systemctl"
|
||||
alias sysu="systemctl --user"
|
||||
|
||||
alias gpg=gpg2
|
||||
|
||||
alias alacritty="alacritty --config-file $HOME/.config/alacritty.yml"
|
||||
|
||||
alias d=docker
|
||||
alias dc=docker-compose
|
||||
|
||||
gitmaster() {
|
||||
git stash push -m gitmaster-$(date -uIseconds) -u || return 1
|
||||
_branch=$(git rev-parse --abbrev-ref HEAD)
|
||||
git fe || return 1
|
||||
git checkout master || return 1
|
||||
git merge origin/master || return 1
|
||||
git checkout $_branch
|
||||
git stash pop
|
||||
}
|
||||
|
||||
_remote() {
|
||||
[[ -n "$SSH_CONNECTION" ]]
|
||||
}
|
||||
|
||||
cd() {
|
||||
builtin cd "$@" && ls
|
||||
}
|
||||
|
||||
mount() {
|
||||
if [[ $# == 0 ]] ; then
|
||||
command mount | column -t
|
||||
else
|
||||
command mount "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
extr()
|
||||
{
|
||||
if [[ -f "$1" ]] ; then
|
||||
case "$1" in
|
||||
*.tar.bz2 ) tar xvjf "$1" ;;
|
||||
*.tar.gz ) tar xvzf "$1" ;;
|
||||
*.tar.xz ) tar xvJf "$1" ;;
|
||||
*.bz2 ) bunzip2 "$1" ;;
|
||||
*.rar ) unrar x "$1" ;;
|
||||
*.gz ) gunzip "$1" ;;
|
||||
*.tar ) tar xvf "$1" ;;
|
||||
*.tbz2 ) tar xvjf "$1" ;;
|
||||
*.tgz ) tar xvzf "$1" ;;
|
||||
*.zip ) unzip "$1" ;;
|
||||
*.Z ) uncompress "$1" ;;
|
||||
*.7z ) 7z x "$1" ;;
|
||||
*)
|
||||
echo "$1 cannot be extracted via $0"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo "$1 is not a valid file"
|
||||
fi
|
||||
}
|
||||
|
||||
ruler() {
|
||||
for s in '....^....|' '1234567890'; do
|
||||
w=${#s}
|
||||
str=$(for (( i=1; $i<=$(( ($COLUMNS + $w) / $w )) ; i=$i+1 )); do echo -n $s; done )
|
||||
str=$(echo $str | cut -c -$COLUMNS)
|
||||
echo $str
|
||||
done
|
||||
}
|
||||
|
||||
addext() {
|
||||
[[ -z "$1" ]] || [[ -z "$2" ]] && { echo "Usage: $0 <file> <extension>" ; return }
|
||||
mv "$1" "$1$2"
|
||||
}
|
||||
|
||||
rmext() {
|
||||
[[ -e "$1" ]] && mv -i "$1" "${1%.*}"
|
||||
}
|
||||
|
||||
|
||||
ckwww() {
|
||||
ping -c 3 www.google.com
|
||||
}
|
||||
|
||||
httpcode() {
|
||||
curl http://httpcode.info/$1
|
||||
}
|
||||
|
||||
bak() {
|
||||
if ! [[ "$1" ]] ; then
|
||||
printf '%s\n' "usage: $0 FILE"
|
||||
return 1
|
||||
fi
|
||||
if ! [[ -e "$1" ]] ; then
|
||||
printf '%s\n' "\"$1\" not found"
|
||||
return 1
|
||||
fi
|
||||
name="$1.$(date +%Y%m%d%H%M%S.bak)"
|
||||
if [[ -e "${name}" ]] ; then
|
||||
printf '%s\n' "Backup file \"$name\" already exists"
|
||||
return 1
|
||||
fi
|
||||
cp --archive --verbose --no-clobber "$1" "${name}"
|
||||
}
|
||||
|
||||
fstab() {
|
||||
# yeah
|
||||
expand /etc/fstab | grep -v '^#' | grep -P '^.+$' | tr -s ' ' | tr ' ' '|' | cat <(grep -P '<.+>' /etc/fstab | cut -f 2- -d ' ' | sed 's/>[^<]*</>|</g') - | column -ts '|'
|
||||
}
|
||||
|
||||
serve() {
|
||||
python3 -m http.server 8800
|
||||
}
|
||||
|
||||
manpdf() {
|
||||
[[ -z "$1" ]] && { printf '%s' >&2 "$(man)" ; return ; }
|
||||
man -t "$1" | ps2pdf - - | zathura -
|
||||
}
|
||||
|
||||
myip4() {
|
||||
curl "http://ipv4.icanhazip.com"
|
||||
}
|
||||
|
||||
myip6() {
|
||||
curl "http://ipv6.icanhazip.com" 2>/dev/null || echo "no ip6"
|
||||
}
|
||||
|
||||
diffdir() {
|
||||
[[ "$1" ]] && [[ "$2" ]] || { echo "$0 <dir1> <dir2>" ; return 1 ; }
|
||||
diff <(cd "$1" && find -type f -exec md5sum {} \;) <(cd "$2" && find -type f -exec md5sum {} \;)
|
||||
}
|
||||
|
||||
diffdir2() {
|
||||
[[ "$1" ]] && [[ "$2" ]] || { echo "$0 <dir1> <dir2>" ; return 1 ; }
|
||||
comm -13 <(cd "$1" && find -type f | sort -g) <(cd "$2" && find -type f | sort -g)
|
||||
}
|
||||
|
||||
bm() {
|
||||
case "$1" in
|
||||
dev)
|
||||
cd "$HOME/development/projects"
|
||||
;;
|
||||
dot)
|
||||
cd "$HOME/dotfiles"
|
||||
;;
|
||||
*)
|
||||
echo "unknown target"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
man() {
|
||||
env LESS_TERMCAP_mb=$'\E[01;31m' \
|
||||
LESS_TERMCAP_md=$'\E[01;38;5;74m' \
|
||||
LESS_TERMCAP_me=$'\E[0m' \
|
||||
LESS_TERMCAP_se=$'\E[0m' \
|
||||
LESS_TERMCAP_so=$'\E[38;5;246m' \
|
||||
LESS_TERMCAP_ue=$'\E[0m' \
|
||||
LESS_TERMCAP_us=$'\E[04;38;5;146m' \
|
||||
man "$@"
|
||||
}
|
||||
|
||||
resolvecd() {
|
||||
cd "$(readlink -f $(pwd))"
|
||||
}
|
||||
|
||||
ssht () {
|
||||
ssh -t $@ "tmux a || tmux";
|
||||
}
|
||||
|
||||
t() {
|
||||
if [[ "$1" ]] ; then
|
||||
tmux new-session -A -s "$1"
|
||||
else
|
||||
tmux attach-session
|
||||
fi
|
||||
}
|
||||
|
||||
b() {
|
||||
bookmarks=${DOTFILES}/bookmarks
|
||||
bookmark="$1"
|
||||
if ! [[ "${bookmark}" ]] ; then
|
||||
printf 'Need a bookmark' >&2
|
||||
return 1
|
||||
fi
|
||||
if ! [[ -r "${bookmark}" ]] ; then
|
||||
printf 'Invalid bookmark %s' "${bookmark}" >&2
|
||||
return 1
|
||||
fi
|
||||
target="$(head -1 ${bookmark})"
|
||||
if ! [[ -e "${target}" ]] ; then
|
||||
printf 'Traget not found: %s' "${target}" >&2
|
||||
fi
|
||||
cd "$(eval ${target})"
|
||||
}
|
||||
|
||||
sb() {
|
||||
echo $(( $1 * $(cat /sys/class/backlight/intel_backlight/max_brightness) / 100)) | sudo tee /sys/class/backlight/intel_backlight/brightness
|
||||
}
|
||||
|
||||
clip() {
|
||||
tee >(xclip -selection clipboard) | tee >(xclip -selection primary)
|
||||
}
|
||||
|
||||
gb() {
|
||||
_superproject="$(git rev-parse --show-superproject-working-tree)"
|
||||
_root="$(git rev-parse --show-toplevel)"
|
||||
if [[ -n "${_superproject}" ]] ; then
|
||||
if [[ "$(pwd)" == "${_root}" ]] ; then
|
||||
builtin cd "${_superproject}"
|
||||
else
|
||||
builtin cd "${_root}"
|
||||
fi
|
||||
else
|
||||
builtin cd "${_root}"
|
||||
fi
|
||||
}
|
||||
|
||||
meetingnotes() {
|
||||
[[ "${1}" ]] || return 1
|
||||
file="$(date +%Y-%m-%d)-${1}.md"
|
||||
cp ~/snippets/meetingnotes.md "${file}"
|
||||
$EDITOR "${file}"
|
||||
}
|
||||
216
zsh/zshrc.d/40_functions.sh
Normal file
216
zsh/zshrc.d/40_functions.sh
Normal file
@@ -0,0 +1,216 @@
|
||||
_remote() {
|
||||
[[ -n "$SSH_CONNECTION" ]]
|
||||
}
|
||||
|
||||
cd() {
|
||||
builtin cd "$@" && ls
|
||||
}
|
||||
|
||||
mount() {
|
||||
if [[ $# == 0 ]] ; then
|
||||
command mount | column -t
|
||||
else
|
||||
command mount "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
extr()
|
||||
{
|
||||
if [[ -f "$1" ]] ; then
|
||||
case "$1" in
|
||||
*.tar.bz2 ) tar xvjf "$1" ;;
|
||||
*.tar.gz ) tar xvzf "$1" ;;
|
||||
*.tar.xz ) tar xvJf "$1" ;;
|
||||
*.bz2 ) bunzip2 "$1" ;;
|
||||
*.rar ) unrar x "$1" ;;
|
||||
*.gz ) gunzip "$1" ;;
|
||||
*.tar ) tar xvf "$1" ;;
|
||||
*.tbz2 ) tar xvjf "$1" ;;
|
||||
*.tgz ) tar xvzf "$1" ;;
|
||||
*.zip ) unzip "$1" ;;
|
||||
*.Z ) uncompress "$1" ;;
|
||||
*.7z ) 7z x "$1" ;;
|
||||
*)
|
||||
echo "$1 cannot be extracted via $0"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo "$1 is not a valid file"
|
||||
fi
|
||||
}
|
||||
|
||||
ruler() {
|
||||
for s in '....^....|' '1234567890'; do
|
||||
w=${#s}
|
||||
str=$(for (( i=1; $i<=$(( ($COLUMNS + $w) / $w )) ; i=$i+1 )); do echo -n $s; done )
|
||||
str=$(echo $str | cut -c -$COLUMNS)
|
||||
echo $str
|
||||
done
|
||||
}
|
||||
|
||||
addext() {
|
||||
[[ -z "$1" ]] || [[ -z "$2" ]] && { echo "Usage: $0 <file> <extension>" ; return }
|
||||
mv "$1" "$1$2"
|
||||
}
|
||||
|
||||
rmext() {
|
||||
[[ -e "$1" ]] && mv -i "$1" "${1%.*}"
|
||||
}
|
||||
|
||||
|
||||
ckwww() {
|
||||
ping -c 3 www.google.com
|
||||
}
|
||||
|
||||
httpcode() {
|
||||
curl http://httpcode.info/$1
|
||||
}
|
||||
|
||||
bak() {
|
||||
if ! [[ "$1" ]] ; then
|
||||
printf '%s\n' "usage: $0 FILE"
|
||||
return 1
|
||||
fi
|
||||
if ! [[ -e "$1" ]] ; then
|
||||
printf '%s\n' "\"$1\" not found"
|
||||
return 1
|
||||
fi
|
||||
name="$1.$(date +%Y%m%d%H%M%S.bak)"
|
||||
if [[ -e "${name}" ]] ; then
|
||||
printf '%s\n' "Backup file \"$name\" already exists"
|
||||
return 1
|
||||
fi
|
||||
cp --archive --verbose --no-clobber "$1" "${name}"
|
||||
}
|
||||
|
||||
fstab() {
|
||||
# yeah
|
||||
expand /etc/fstab | grep -v '^#' | grep -P '^.+$' | tr -s ' ' | tr ' ' '|' | cat <(grep -P '<.+>' /etc/fstab | cut -f 2- -d ' ' | sed 's/>[^<]*</>|</g') - | column -ts '|'
|
||||
}
|
||||
|
||||
serve() {
|
||||
python3 -m http.server 8800
|
||||
}
|
||||
|
||||
manpdf() {
|
||||
[[ -z "$1" ]] && { printf '%s' >&2 "$(man)" ; return ; }
|
||||
man -t "$1" | ps2pdf - - | zathura -
|
||||
}
|
||||
|
||||
myip4() {
|
||||
curl "http://ipv4.icanhazip.com"
|
||||
}
|
||||
|
||||
myip6() {
|
||||
curl "http://ipv6.icanhazip.com" 2>/dev/null || echo "no ip6"
|
||||
}
|
||||
|
||||
diffdir() {
|
||||
[[ "$1" ]] && [[ "$2" ]] || { echo "$0 <dir1> <dir2>" ; return 1 ; }
|
||||
diff <(cd "$1" && find -type f -exec md5sum {} \;) <(cd "$2" && find -type f -exec md5sum {} \;)
|
||||
}
|
||||
|
||||
diffdir2() {
|
||||
[[ "$1" ]] && [[ "$2" ]] || { echo "$0 <dir1> <dir2>" ; return 1 ; }
|
||||
comm -13 <(cd "$1" && find -type f | sort -g) <(cd "$2" && find -type f | sort -g)
|
||||
}
|
||||
|
||||
bm() {
|
||||
case "$1" in
|
||||
dev)
|
||||
cd "$HOME/development/projects"
|
||||
;;
|
||||
dot)
|
||||
cd "$HOME/dotfiles"
|
||||
;;
|
||||
*)
|
||||
echo "unknown target"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
man() {
|
||||
env LESS_TERMCAP_mb=$'\E[01;31m' \
|
||||
LESS_TERMCAP_md=$'\E[01;38;5;74m' \
|
||||
LESS_TERMCAP_me=$'\E[0m' \
|
||||
LESS_TERMCAP_se=$'\E[0m' \
|
||||
LESS_TERMCAP_so=$'\E[38;5;246m' \
|
||||
LESS_TERMCAP_ue=$'\E[0m' \
|
||||
LESS_TERMCAP_us=$'\E[04;38;5;146m' \
|
||||
man "$@"
|
||||
}
|
||||
|
||||
embiggen() {
|
||||
enscript --no-header --media=A4 --landscape --font="DejaVuSansMono30" -o - 2>/dev/null | ps2pdf - | zathura -
|
||||
}
|
||||
|
||||
resolvecd() {
|
||||
cd "$(readlink -f $(pwd))"
|
||||
}
|
||||
|
||||
ssht () {
|
||||
ssh -t $@ "tmux a || tmux";
|
||||
}
|
||||
|
||||
t() {
|
||||
if [[ "$1" ]] ; then
|
||||
tmux new-session -A -s "$1"
|
||||
else
|
||||
tmux attach-session
|
||||
fi
|
||||
}
|
||||
|
||||
b() {
|
||||
bookmarks=${DOTFILES}/bookmarks
|
||||
bookmark="$1"
|
||||
if ! [[ "${bookmark}" ]] ; then
|
||||
printf 'Need a bookmark' >&2
|
||||
return 1
|
||||
fi
|
||||
if ! [[ -r "${bookmark}" ]] ; then
|
||||
printf 'Invalid bookmark %s' "${bookmark}" >&2
|
||||
return 1
|
||||
fi
|
||||
target="$(head -1 ${bookmark})"
|
||||
if ! [[ -e "${target}" ]] ; then
|
||||
printf 'Traget not found: %s' "${target}" >&2
|
||||
fi
|
||||
cd "$(eval ${target})"
|
||||
}
|
||||
|
||||
sb() {
|
||||
echo $(( $1 * $(cat /sys/class/backlight/intel_backlight/max_brightness) / 100)) | sudo tee /sys/class/backlight/intel_backlight/brightness
|
||||
}
|
||||
|
||||
journal() {
|
||||
journaldir=~/journal/
|
||||
file=~/journal/$(date +%Y-%m-%d).md
|
||||
if [[ ! -e $file ]] ; then
|
||||
cp $journaldir/template.md $file || return
|
||||
fi
|
||||
vim +Goyo +PencilSoft $file
|
||||
}
|
||||
|
||||
syncfolder() {
|
||||
folder=$1
|
||||
mv $folder ~/sync
|
||||
ln -s ~/sync/$folder ~/$folder
|
||||
}
|
||||
|
||||
prefix() {
|
||||
prefix=$2
|
||||
file=$1
|
||||
mv $file ${prefix}${file}
|
||||
}
|
||||
|
||||
tmp() {
|
||||
cd "$(mktemp -d)"
|
||||
}
|
||||
|
||||
kubectl_pod() {
|
||||
kubectl-env mycloud get -n "${1}" pods --field-selector=status.phase=Running --selector=${2} -o jsonpath='{.items[*].metadata.name}'
|
||||
}
|
||||
|
||||
kubectl_deployment() {
|
||||
kubectl-env mycloud get -n "${1}" deployment --selector=${2} -o jsonpath='{.items[*].metadata.name}'
|
||||
}
|
||||
62
zsh/zshrc.d/50_prompt.sh
Normal file
62
zsh/zshrc.d/50_prompt.sh
Normal file
@@ -0,0 +1,62 @@
|
||||
autoload -Uz vcs_info
|
||||
|
||||
_vcsbase="%{$fg[red]%}[%r] %{$fg[blue]%}[%{%B%}%b%{$fg[red]%}%m%{$fg[blue]%}] %{$fg[red]%}%{%B%}%c%u"
|
||||
|
||||
zstyle ':vcs_info:*' stagedstr 'I'
|
||||
zstyle ':vcs_info:*' unstagedstr 'M'
|
||||
|
||||
zstyle ':vcs_info:*' enable git
|
||||
zstyle ':vcs_info:*' check-for-changes true
|
||||
zstyle ':vcs_info:*' get-revision true
|
||||
|
||||
zstyle ':vcs_info:git*' formats "$_vcsbase"
|
||||
zstyle ':vcs_info:git*' actionformats "%{$fg[red]%}(%a) $_vcsbase"
|
||||
|
||||
zstyle ':vcs_info:git*+set-message:*' hooks git-untracked git-st git-remotebranch
|
||||
|
||||
+vi-git-untracked() {
|
||||
if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' ]] && \
|
||||
[[ $(git ls-files --other --directory --exclude-standard | sed q | wc -l | tr -d ' ') == 1 ]] ; then
|
||||
hook_com[unstaged]+='?%f'
|
||||
fi
|
||||
}
|
||||
|
||||
+vi-git-st() {
|
||||
local ahead behind
|
||||
local -a gitstatus
|
||||
|
||||
ahead=$(git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
|
||||
(( $ahead )) && gitstatus+=( "+${ahead}" )
|
||||
|
||||
behind=$(git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
|
||||
(( $behind )) && gitstatus+=( "-${behind}" )
|
||||
|
||||
hook_com[misc]+=${(j:/:)gitstatus}
|
||||
}
|
||||
|
||||
+vi-git-remotebranch() {
|
||||
local remote
|
||||
|
||||
remote=${$(git rev-parse --verify ${hook_com[branch]}@{upstream} \
|
||||
--symbolic-full-name 2>/dev/null)/refs\/remotes\/}
|
||||
|
||||
if [[ -n ${remote} ]] ; then
|
||||
hook_com[branch]="${hook_com[branch]} %b%{$fg[magenta]%}<${remote}>"
|
||||
fi
|
||||
}
|
||||
|
||||
precmd() {
|
||||
vcs_info
|
||||
}
|
||||
|
||||
_topstr='%{$fg[green]%}%n@%m%{$fg[white]%} ─ %{%B$fg[yellow]%}%~%{%b%} ${vcs_info_msg_0_}%{$fg[white]%} '
|
||||
botstr='%B${PINFO}%#%b '
|
||||
|
||||
if _remote ; then
|
||||
_topstr="%{$fg[red]%}[remote]%{$fg[white]%} ${_topstr}"
|
||||
fi
|
||||
|
||||
setopt prompt_subst
|
||||
PROMPT='%{$fg[white]%}┌─ '"${_topstr}"'
|
||||
└─ '"${botstr}"
|
||||
RPROMPT="%{$fg[cyan]%}%*%{$fg[white]%} ─ [%?]"
|
||||
26
zsh/zshrc.d/60_keybinds.sh
Normal file
26
zsh/zshrc.d/60_keybinds.sh
Normal file
@@ -0,0 +1,26 @@
|
||||
autoload zkbd
|
||||
|
||||
bindkey "\e[1~" beginning-of-line
|
||||
bindkey "\e[4~" end-of-line
|
||||
bindkey "\e[5~" beginning-of-history
|
||||
bindkey "\e[6~" end-of-history
|
||||
bindkey "\e[3~" delete-char
|
||||
bindkey "\e[2~" quoted-insert
|
||||
bindkey "\e[5C" forward-word
|
||||
bindkey "\eOc" emacs-forward-word
|
||||
bindkey "\e[5D" backward-word
|
||||
bindkey "\eOd" emacs-backward-word
|
||||
bindkey "\ee[C" forward-word
|
||||
bindkey "\ee[D" backward-word
|
||||
bindkey "^H" backward-delete-word
|
||||
# for rxvt
|
||||
bindkey "\e[8~" end-of-line
|
||||
bindkey "\e[7~" beginning-of-line
|
||||
# for non RH/Debian xterm, can't hurt for RH/DEbian xterm
|
||||
bindkey "\eOH" beginning-of-line
|
||||
bindkey "\eOF" end-of-line
|
||||
# for freebsd console
|
||||
bindkey "\e[H" beginning-of-line
|
||||
bindkey "\e[F" end-of-line
|
||||
# completion in the middle of a line
|
||||
bindkey '^i' expand-or-complete-prefix
|
||||
472
zsh/zshrc.j2
472
zsh/zshrc.j2
@@ -1,476 +1,24 @@
|
||||
[[ -z "$PS1" ]] && return
|
||||
|
||||
_zshdir="$HOME/.zshrc.d"
|
||||
|
||||
{% if user.gpg_agent %}
|
||||
export GPG_TTY=$(tty)
|
||||
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
|
||||
{% endif %}
|
||||
|
||||
for file in "${_zshdir}"/* ; do
|
||||
if [[ -e "$file" ]] ; then
|
||||
source "$file"
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -f /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]] ; then
|
||||
source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||
elif [[ -f /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]] ; then
|
||||
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||
fi
|
||||
|
||||
{% if user.ssh_agent %}
|
||||
if ! pgrep -u "$USER" ssh-agent > /dev/null ; then
|
||||
ssh-agent > "$XDG_RUNTIME_DIR/ssh-agent.env"
|
||||
fi
|
||||
if [[ ! "$SSH_AUTH_SOCK" ]]; then
|
||||
source "$XDG_RUNTIME_DIR/ssh-agent.env" >/dev/null
|
||||
fi
|
||||
{% if distro == 'ubuntu' %}
|
||||
alias imv=imv-x11
|
||||
{% endif %}
|
||||
|
||||
{% raw %}
|
||||
|
||||
setopt EXTENDED_HISTORY
|
||||
setopt HIST_EXPIRE_DUPS_FIRST
|
||||
setopt HIST_VERIFY
|
||||
setopt INC_APPEND_HISTORY
|
||||
setopt SHARE_HISTORY
|
||||
setopt AUTO_CD
|
||||
setopt APPEND_HISTORY
|
||||
setopt HIST_IGNORE_DUPS
|
||||
setopt NOHIST_IGNORE_ALL_DUPS
|
||||
setopt HIST_IGNORE_SPACE
|
||||
setopt CORRECT
|
||||
setopt RM_STAR_SILENT
|
||||
setopt BG_NICE
|
||||
setopt CHECK_JOBS
|
||||
setopt HUP
|
||||
setopt LONG_LIST_JOBS
|
||||
|
||||
setopt share_history
|
||||
|
||||
bindkey -e
|
||||
|
||||
autoload -U promptinit
|
||||
promptinit
|
||||
|
||||
autoload -U colors
|
||||
colors
|
||||
|
||||
autoload -U compinit
|
||||
compinit
|
||||
zstyle ':completion:*' menu select
|
||||
setopt completealiases
|
||||
|
||||
autoload -U edit-command-line
|
||||
zle -N edit-command-line
|
||||
bindkey '^xe' edit-command-line
|
||||
bindkey '^x^e' edit-command-line
|
||||
|
||||
HISTSIZE=100000
|
||||
SAVEHIST=100000
|
||||
HISTFILE="$HOME/.zsh_history"
|
||||
|
||||
alias vim="nvim"
|
||||
|
||||
### BETTER COMMANDS
|
||||
alias ls="exa --oneline --icons --group-directories-first"
|
||||
alias ll='ls --all --long --classify --group --modified --time-style=long-iso --git'
|
||||
alias la='ls --all'
|
||||
|
||||
alias spm="sudo pacman"
|
||||
|
||||
alias tml="tmux list-sessions"
|
||||
alias tma="tmux ls 2>/dev/null && tmux attach-session || tmux"
|
||||
alias tmn="tmux new-session -A -s"
|
||||
|
||||
alias clipc="xclip -selection primary"
|
||||
alias clipo="xclip -out -selection clipboard"
|
||||
|
||||
alias rgrep="grep -r"
|
||||
|
||||
alias calc='python3 -ic "from math import *; import cmath"'
|
||||
|
||||
alias le_haxxor_1='clear && dmesg | pv -qL 20'
|
||||
alias le_haxxor_2='clear && hexdump -C /dev/urandom | pv -qlL 2'
|
||||
|
||||
alias root='sudo -sE'
|
||||
|
||||
### USEFUL DEFAULT OPTIONS
|
||||
alias tmux="tmux -2"
|
||||
|
||||
alias chmod="chmod -c"
|
||||
alias chown="chown -c"
|
||||
|
||||
alias diff="diff --color=auto"
|
||||
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
|
||||
alias rg='rg --hidden --glob "!.git/**" --glob "!.git"'
|
||||
|
||||
alias rm='rm -v'
|
||||
alias cp='cp -vi'
|
||||
alias mv='mv -vi'
|
||||
alias ln='ln -v'
|
||||
|
||||
alias du='du -h'
|
||||
alias df='df -h'
|
||||
|
||||
### SHORTENING COMMAND NAMES
|
||||
alias cs="cryptsetup"
|
||||
alias v="vim"
|
||||
alias g="git"
|
||||
alias c="cd"
|
||||
alias l="ls"
|
||||
alias s="sudo"
|
||||
alias cl="clear"
|
||||
|
||||
alias nocolor="sed -r \"s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g\""
|
||||
|
||||
alias ip="ip -color"
|
||||
|
||||
alias vimtask="vim -c :TW"
|
||||
|
||||
alias tw="task"
|
||||
alias twl="task list"
|
||||
alias twa="task add"
|
||||
alias twd="task done"
|
||||
alias inbox="task add +inbox"
|
||||
|
||||
alias yaml2json="python3 -c 'import sys, yaml, json; json.dump([d for d in yaml.safe_load_all(sys.stdin)][-1], sys.stdout, indent=4)'"
|
||||
alias json2yaml="python3 -c 'import sys, yaml, json; yaml.safe_dump(json.loads(sys.stdin.read()), stream=sys.stdout)'"
|
||||
|
||||
alias currentbranch='git rev-parse --abbrev-ref HEAD'
|
||||
|
||||
alias issh="ssh -o StrictHostKeyChecking=false -o UserKnownHostsFile=/dev/null"
|
||||
alias gfix='git commit --amend --no-edit'
|
||||
alias gfixa='git commit --amend --no-edit --all '
|
||||
alias gfixp='git commit --amend --no-edit --patch'
|
||||
|
||||
alias issh="ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
|
||||
|
||||
alias newpw="pwgen --secure 25 1"
|
||||
|
||||
alias sys="systemctl"
|
||||
alias sysu="systemctl --user"
|
||||
|
||||
alias gpg=gpg2
|
||||
|
||||
alias alacritty="alacritty --config-file $HOME/.config/alacritty.toml"
|
||||
|
||||
alias d=docker
|
||||
alias dc=docker-compose
|
||||
|
||||
alias hx=helix
|
||||
alias h=helix
|
||||
|
||||
alias wget="wget --hsts-file ${XDG_STATE_HOME}/wget-hsts"
|
||||
|
||||
gitmaster() {
|
||||
git stash push -m gitmaster-$(date -uIseconds) -u || return 1
|
||||
_branch=$(git rev-parse --abbrev-ref HEAD)
|
||||
git fe || return 1
|
||||
git checkout master || return 1
|
||||
git merge origin/master || return 1
|
||||
git checkout $_branch
|
||||
git stash pop
|
||||
}
|
||||
|
||||
_remote() {
|
||||
[[ -n "$SSH_CONNECTION" ]]
|
||||
}
|
||||
|
||||
cd() {
|
||||
builtin cd "$@" && ls
|
||||
}
|
||||
|
||||
mount() {
|
||||
if [[ $# == 0 ]] ; then
|
||||
command mount | column -t
|
||||
else
|
||||
command mount "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
extr()
|
||||
{
|
||||
if [[ -f "$1" ]] ; then
|
||||
case "$1" in
|
||||
*.tar.bz2 ) tar xvjf "$1" ;;
|
||||
*.tar.gz ) tar xvzf "$1" ;;
|
||||
*.tar.xz ) tar xvJf "$1" ;;
|
||||
*.bz2 ) bunzip2 "$1" ;;
|
||||
*.rar ) unrar x "$1" ;;
|
||||
*.gz ) gunzip "$1" ;;
|
||||
*.tar ) tar xvf "$1" ;;
|
||||
*.tbz2 ) tar xvjf "$1" ;;
|
||||
*.tgz ) tar xvzf "$1" ;;
|
||||
*.zip ) unzip "$1" ;;
|
||||
*.Z ) uncompress "$1" ;;
|
||||
*.7z ) 7z x "$1" ;;
|
||||
*)
|
||||
echo "$1 cannot be extracted via $0"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo "$1 is not a valid file"
|
||||
fi
|
||||
}
|
||||
|
||||
ruler() {
|
||||
for s in '....^....|' '1234567890'; do
|
||||
w=${#s}
|
||||
str=$(for (( i=1; $i<=$(( ($COLUMNS + $w) / $w )) ; i=$i+1 )); do echo -n $s; done )
|
||||
str=$(echo $str | cut -c -$COLUMNS)
|
||||
echo $str
|
||||
done
|
||||
}
|
||||
|
||||
addext() {
|
||||
[[ -z "$1" ]] || [[ -z "$2" ]] && { echo "Usage: $0 <file> <extension>" ; return }
|
||||
mv "$1" "$1$2"
|
||||
}
|
||||
|
||||
rmext() {
|
||||
[[ -e "$1" ]] && mv -i "$1" "${1%.*}"
|
||||
}
|
||||
|
||||
ckwww() {
|
||||
ping -c 3 www.google.com
|
||||
}
|
||||
|
||||
httpcode() {
|
||||
curl http://httpcode.info/$1
|
||||
}
|
||||
|
||||
bak() {
|
||||
if ! [[ "$1" ]] ; then
|
||||
printf '%s\n' "usage: $0 FILE"
|
||||
return 1
|
||||
fi
|
||||
if ! [[ -e "$1" ]] ; then
|
||||
printf '%s\n' "\"$1\" not found"
|
||||
return 1
|
||||
fi
|
||||
name="$1.$(date +%Y%m%d%H%M%S.bak)"
|
||||
if [[ -e "${name}" ]] ; then
|
||||
printf '%s\n' "Backup file \"$name\" already exists"
|
||||
return 1
|
||||
fi
|
||||
cp --archive --verbose --no-clobber "$1" "${name}"
|
||||
}
|
||||
|
||||
fstab() {
|
||||
# yeah
|
||||
expand /etc/fstab | grep -v '^#' | grep -P '^.+$' | tr -s ' ' | tr ' ' '|' | cat <(grep -P '<.+>' /etc/fstab | cut -f 2- -d ' ' | sed 's/>[^<]*</>|</g') - | column -ts '|'
|
||||
}
|
||||
|
||||
serve() {
|
||||
python3 -m http.server 8800
|
||||
}
|
||||
|
||||
manpdf() {
|
||||
[[ -z "$1" ]] && { printf '%s' >&2 "$(man)" ; return ; }
|
||||
man -t "$1" | ps2pdf - - | zathura -
|
||||
}
|
||||
|
||||
myip4() {
|
||||
curl "http://ipv4.icanhazip.com"
|
||||
}
|
||||
|
||||
myip6() {
|
||||
curl "http://ipv6.icanhazip.com" 2>/dev/null || echo "no ip6"
|
||||
}
|
||||
|
||||
diffdir() {
|
||||
[[ "$1" ]] && [[ "$2" ]] || { echo "$0 <dir1> <dir2>" ; return 1 ; }
|
||||
diff <(cd "$1" && find -type f -exec md5sum {} \;) <(cd "$2" && find -type f -exec md5sum {} \;)
|
||||
}
|
||||
|
||||
diffdir2() {
|
||||
[[ "$1" ]] && [[ "$2" ]] || { echo "$0 <dir1> <dir2>" ; return 1 ; }
|
||||
comm -13 <(cd "$1" && find -type f | sort -g) <(cd "$2" && find -type f | sort -g)
|
||||
}
|
||||
|
||||
man() {
|
||||
env LESS_TERMCAP_mb=$'\E[01;31m' \
|
||||
LESS_TERMCAP_md=$'\E[01;38;5;74m' \
|
||||
LESS_TERMCAP_me=$'\E[0m' \
|
||||
LESS_TERMCAP_se=$'\E[0m' \
|
||||
LESS_TERMCAP_so=$'\E[38;5;246m' \
|
||||
LESS_TERMCAP_ue=$'\E[0m' \
|
||||
LESS_TERMCAP_us=$'\E[04;38;5;146m' \
|
||||
man "$@"
|
||||
}
|
||||
|
||||
resolvecd() {
|
||||
cd "$(readlink -f $(pwd))"
|
||||
}
|
||||
|
||||
ssht () {
|
||||
ssh -t $@ "tmux a || tmux";
|
||||
}
|
||||
|
||||
t() {
|
||||
if [[ "$1" ]] ; then
|
||||
tmux new-session -A -s "$1"
|
||||
else
|
||||
tmux attach-session
|
||||
fi
|
||||
}
|
||||
|
||||
sb() {
|
||||
echo $(( $1 * $(cat /sys/class/backlight/intel_backlight/max_brightness) / 100)) | sudo tee /sys/class/backlight/intel_backlight/brightness
|
||||
}
|
||||
|
||||
clip() {
|
||||
tee >(xclip -selection clipboard) | tee >(xclip -selection primary)
|
||||
}
|
||||
|
||||
gb() {
|
||||
_superproject="$(git rev-parse --show-superproject-working-tree)"
|
||||
_root="$(git rev-parse --show-toplevel)"
|
||||
if [[ -n "${_superproject}" ]] ; then
|
||||
if [[ "$(pwd)" == "${_root}" ]] ; then
|
||||
builtin cd "${_superproject}"
|
||||
else
|
||||
builtin cd "${_root}"
|
||||
fi
|
||||
else
|
||||
builtin cd "${_root}"
|
||||
fi
|
||||
}
|
||||
|
||||
bm() {
|
||||
case "$1" in
|
||||
dev)
|
||||
cd "$HOME/development/projects"
|
||||
;;
|
||||
dot)
|
||||
cd "$HOME/dotfiles"
|
||||
;;
|
||||
*)
|
||||
echo "unknown target"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
embiggen() {
|
||||
enscript --no-header --media=A4 --landscape --font="DejaVuSansMono30" -o - 2>/dev/null | ps2pdf - | zathura -
|
||||
}
|
||||
|
||||
journal() {
|
||||
journaldir=~/sync/journal/
|
||||
file="$journaldir/$(date +%Y-%m-%d).md"
|
||||
if [[ ! -e $file ]] ; then
|
||||
cp $journaldir/template.md $file || return
|
||||
fi
|
||||
$EDITOR $file
|
||||
}
|
||||
|
||||
prefix() {
|
||||
prefix=$2
|
||||
file=$1
|
||||
mv $file ${prefix}${file}
|
||||
}
|
||||
|
||||
tmp() {
|
||||
cd "$(mktemp -d)"
|
||||
}
|
||||
|
||||
autoload -Uz vcs_info
|
||||
|
||||
_vcsbase="%{$fg[red]%}[%r] %{$fg[blue]%}[%{%B%}%b%{$fg[red]%}%m%{$fg[blue]%}] %{$fg[red]%}%{%B%}%c%u"
|
||||
|
||||
zstyle ':vcs_info:*' stagedstr 'I'
|
||||
zstyle ':vcs_info:*' unstagedstr 'M'
|
||||
|
||||
zstyle ':vcs_info:*' enable git
|
||||
zstyle ':vcs_info:*' check-for-changes true
|
||||
zstyle ':vcs_info:*' get-revision true
|
||||
|
||||
zstyle ':vcs_info:git*' formats "$_vcsbase"
|
||||
zstyle ':vcs_info:git*' actionformats "%{$fg[red]%}(%a) $_vcsbase"
|
||||
|
||||
zstyle ':vcs_info:git*+set-message:*' hooks git-untracked git-st git-remotebranch
|
||||
|
||||
+vi-git-untracked() {
|
||||
if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' ]] && \
|
||||
[[ $(git ls-files --other --directory --exclude-standard | sed q | wc -l | tr -d ' ') == 1 ]] ; then
|
||||
hook_com[unstaged]+='?%f'
|
||||
fi
|
||||
}
|
||||
|
||||
+vi-git-st() {
|
||||
local ahead behind
|
||||
local -a gitstatus
|
||||
|
||||
ahead=$(git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
|
||||
(( $ahead )) && gitstatus+=( "+${ahead}" )
|
||||
|
||||
behind=$(git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
|
||||
(( $behind )) && gitstatus+=( "-${behind}" )
|
||||
|
||||
hook_com[misc]+=${(j:/:)gitstatus}
|
||||
}
|
||||
|
||||
+vi-git-remotebranch() {
|
||||
local remote
|
||||
|
||||
remote=${$(git rev-parse --verify ${hook_com[branch]}@{upstream} \
|
||||
--symbolic-full-name 2>/dev/null)/refs\/remotes\/}
|
||||
|
||||
if [[ -n ${remote} ]] ; then
|
||||
hook_com[branch]="${hook_com[branch]} %b%{$fg[magenta]%}<${remote}>"
|
||||
fi
|
||||
}
|
||||
|
||||
precmd() {
|
||||
vcs_info
|
||||
}
|
||||
|
||||
autoload -Uz vcs_info
|
||||
zstyle ':vcs_info:*' enable git hg
|
||||
zstyle ':vcs_info:*' check-for-changes true
|
||||
|
||||
zstyle ':vcs_info:git*' formats "%{${fg[cyan]}%}[%{${fg[green]}%}%s%{${fg[cyan]}%}][%{${fg[blue]}%}%r/%S%%{${fg[cyan]}%}][%{${fg[blue]}%}%b%{${fg[yellow]}%}%m%u%c%{${fg[cyan]}%}]%{$reset_color%}"
|
||||
|
||||
_topstr='%{$fg[green]%}%n@%m%{$fg[white]%} ─ %{%B$fg[yellow]%}%~%{%b%} ${vcs_info_msg_0_}%{$fg[white]%} '
|
||||
botstr='%B${PINFO}%#%b '
|
||||
|
||||
if _remote ; then
|
||||
_topstr="%{$fg[red]%}[remote]%{$fg[white]%} ${_topstr}"
|
||||
fi
|
||||
|
||||
setopt prompt_subst
|
||||
|
||||
|
||||
PROMPT='%{$fg[white]%}┌─ '"${_topstr}"'
|
||||
└─ '"${botstr}"
|
||||
RPROMPT="%{$fg[cyan]%}%*%{$fg[white]%} ─ [%?]"
|
||||
|
||||
autoload zkbd
|
||||
|
||||
bindkey "\e[1~" beginning-of-line
|
||||
bindkey "\e[4~" end-of-line
|
||||
bindkey "\e[5~" beginning-of-history
|
||||
bindkey "\e[6~" end-of-history
|
||||
bindkey "\e[3~" delete-char
|
||||
bindkey "\e[2~" quoted-insert
|
||||
bindkey "\e[5C" forward-word
|
||||
bindkey "\eOc" emacs-forward-word
|
||||
bindkey "\e[5D" backward-word
|
||||
bindkey "\eOd" emacs-backward-word
|
||||
bindkey "\ee[C" forward-word
|
||||
bindkey "\ee[D" backward-word
|
||||
bindkey "^H" backward-delete-word
|
||||
# for rxvt
|
||||
bindkey "\e[8~" end-of-line
|
||||
bindkey "\e[7~" beginning-of-line
|
||||
# for non RH/Debian xterm, can't hurt for RH/DEbian xterm
|
||||
bindkey "\eOH" beginning-of-line
|
||||
bindkey "\eOF" end-of-line
|
||||
# for freebsd console
|
||||
bindkey "\e[H" beginning-of-line
|
||||
bindkey "\e[F" end-of-line
|
||||
# completion in the middle of a line
|
||||
bindkey '^i' expand-or-complete-prefix
|
||||
|
||||
export FZF_DEFAULT_OPTS='--height 50% --border'
|
||||
eval "$(fzf --zsh)"
|
||||
|
||||
{% endraw %}
|
||||
|
||||
Reference in New Issue
Block a user