Compare commits
36 Commits
9724ef1aa2
...
f56092ed67
| Author | SHA1 | Date | |
|---|---|---|---|
| f56092ed67 | |||
| 38a1abe7e7 | |||
| 63d998c1a4 | |||
| 6e487f4bc1 | |||
| c1cab46edf | |||
| 07c6553a3a | |||
| 11ac43cb35 | |||
| 271dd3b5a0 | |||
| 788cb8ac77 | |||
| b5b99476af | |||
| cb57530810 | |||
| 9d27d345d5 | |||
| 53d6b199b9 | |||
| 6891690305 | |||
| 34a3d55ef2 | |||
| be01f445ff | |||
| c06e834524 | |||
| b49101eef6 | |||
| fce869955f | |||
| 72a77275aa | |||
| d8a65e5082 | |||
| 6b8e016dd5 | |||
| b9d59e8ecf | |||
| 2230b49918 | |||
| 0cd51a17e3 | |||
| d6488c88f8 | |||
| 2240f4e6d2 | |||
| 9886db98d7 | |||
| 0ba83acd3a | |||
| db3daad968 | |||
| f3e54a2401 | |||
| 6aa5f0cd37 | |||
| f42eee05b7 | |||
| d45f2e1f2f | |||
| 678068e959 | |||
| 585fbdb174 |
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -13,3 +13,6 @@
|
|||||||
[submodule "pkgbuilds/vim-plug"]
|
[submodule "pkgbuilds/vim-plug"]
|
||||||
path = pkgbuilds/vim-plug
|
path = pkgbuilds/vim-plug
|
||||||
url = https://aur.archlinux.org/vim-plug.git
|
url = https://aur.archlinux.org/vim-plug.git
|
||||||
|
[submodule "pkgbuilds/terraform-ls-bin"]
|
||||||
|
path = pkgbuilds/terraform-ls-bin
|
||||||
|
url = https://aur.archlinux.org/terraform-ls-bin.git
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ font_size_2: 12
|
|||||||
|
|
||||||
gpu: amd
|
gpu: amd
|
||||||
|
|
||||||
i3bar_icon_padding: " "
|
|
||||||
|
|
||||||
users:
|
users:
|
||||||
- name: hannes
|
- name: hannes
|
||||||
vt: 1
|
vt: 1
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
font_size_1: 12
|
font_size_1: 12
|
||||||
font_size_2: 12
|
font_size_2: 12
|
||||||
|
|
||||||
i3bar_icon_padding: ""
|
gpu: nvidia
|
||||||
|
|
||||||
users:
|
users:
|
||||||
- name: hannes-work
|
- name: hannes-work
|
||||||
|
|||||||
@@ -5,6 +5,6 @@ ConditionPathExists=%t/features/machine_is_laptop
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
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 "^LID.*enabled" /proc/acpi/wakeup && echo " LID" | sudo tee /proc/acpi/wakeup || true'
|
||||||
RemainAfterExit=true
|
RemainAfterExit=true
|
||||||
PassEnvironment=DISPLAY
|
PassEnvironment=DISPLAY
|
||||||
|
|||||||
@@ -4,6 +4,6 @@ After=windowmanager.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=/usr/bin/env xrdb -merge -I%h %h/.Xresources
|
ExecStart=/usr/bin/env xrdb -merge -I%h %h/.config/Xresources
|
||||||
RemainAfterExit=true
|
RemainAfterExit=true
|
||||||
PassEnvironment=DISPLAY
|
PassEnvironment=DISPLAY
|
||||||
|
|||||||
@@ -16,4 +16,4 @@ for appname, appconfig in apps['packages']['list'].items():
|
|||||||
missing_config[distro] = []
|
missing_config[distro] = []
|
||||||
missing_config[distro].append(appname)
|
missing_config[distro].append(appname)
|
||||||
|
|
||||||
print(yaml.dump(missing_config))
|
print(yaml.dump(missing_config), end="")
|
||||||
|
|||||||
20
dotfiles.yml
20
dotfiles.yml
@@ -1,6 +1,4 @@
|
|||||||
empty_directories:
|
empty_directories:
|
||||||
- name: .gnupg
|
|
||||||
mode: '0700'
|
|
||||||
- name: .config/nvim
|
- name: .config/nvim
|
||||||
- name: .config/rofi
|
- name: .config/rofi
|
||||||
- name: .config/gtk-3.0
|
- name: .config/gtk-3.0
|
||||||
@@ -15,17 +13,18 @@ empty_directories:
|
|||||||
- name: .config/git
|
- name: .config/git
|
||||||
- name: .config/tmux
|
- name: .config/tmux
|
||||||
- name: .config/i3
|
- name: .config/i3
|
||||||
|
- name: .config/zsh
|
||||||
dotfiles:
|
dotfiles:
|
||||||
- from: git/gitconfig
|
- from: git/gitconfig
|
||||||
to: .config/git/config
|
to: .config/git/config
|
||||||
template: true
|
template: true
|
||||||
- from: gnupg/dirmngr.conf
|
- from: gnupg/dirmngr.conf
|
||||||
to: .gnupg/dirmngr.conf
|
to: .local/state/gnupg/dirmngr.conf
|
||||||
- from: gnupg/gpg-agent.conf
|
- from: gnupg/gpg-agent.conf
|
||||||
to: .gnupg/gpg-agent.conf
|
to: .local/state/gnupg/gpg-agent.conf
|
||||||
template: true
|
template: true
|
||||||
- from: gnupg/gpg.conf
|
- from: gnupg/gpg.conf
|
||||||
to: .gnupg/gpg.conf
|
to: .local/state/gnupg/gpg.conf
|
||||||
template: true
|
template: true
|
||||||
- from: i3/config
|
- from: i3/config
|
||||||
to: .config/i3/config
|
to: .config/i3/config
|
||||||
@@ -44,16 +43,17 @@ dotfiles:
|
|||||||
- from: vim/vimrc
|
- from: vim/vimrc
|
||||||
to: .config/nvim/init.vim
|
to: .config/nvim/init.vim
|
||||||
- from: x/Xresources
|
- from: x/Xresources
|
||||||
to: .Xresources
|
to: .config/Xresources
|
||||||
template: true
|
|
||||||
- from: x/xinitrc
|
- from: x/xinitrc
|
||||||
to: .xinitrc
|
to: .config/xinitrc
|
||||||
- from: zsh/zprofile
|
- from: zsh/zprofile
|
||||||
to: .zprofile
|
to: .config/zsh/.zprofile
|
||||||
template: true
|
template: true
|
||||||
- from: zsh/zshrc
|
- from: zsh/zshrc
|
||||||
to: .zshrc
|
to: .config/zsh/.zshrc
|
||||||
template: true
|
template: true
|
||||||
|
- from: zsh/zshenv
|
||||||
|
to: .zshenv
|
||||||
- from: dunst/dunstrc
|
- from: dunst/dunstrc
|
||||||
to: .config/dunstrc
|
to: .config/dunstrc
|
||||||
template: true
|
template: true
|
||||||
|
|||||||
@@ -9,3 +9,6 @@ enable-ssh-support
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
pinentry-program /usr/bin/pinentry-qt
|
pinentry-program /usr/bin/pinentry-qt
|
||||||
|
|
||||||
|
extra-socket none
|
||||||
|
browser-socket none
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
icons_format = "{{ machine.i3bar_icon_padding }}{icon}{{ machine.i3bar_icon_padding }}"
|
icons_format = "{icon}"
|
||||||
|
|
||||||
[icons]
|
[icons]
|
||||||
icons = "awesome"
|
icons = "awesome"
|
||||||
@@ -55,14 +55,7 @@ update = true
|
|||||||
|
|
||||||
[[block]]
|
[[block]]
|
||||||
block = "net"
|
block = "net"
|
||||||
format = " $icon{ $signal_strength|}{ $ssid | }"
|
format = " $icon{ $signal_strength|}{ $ssid.str(max_width:10) | }"
|
||||||
|
|
||||||
[[block]]
|
|
||||||
block = "load"
|
|
||||||
format = " $icon $1m.eng(w:4) "
|
|
||||||
warning = 4
|
|
||||||
critical = 1000
|
|
||||||
interval = 1
|
|
||||||
|
|
||||||
[[block]]
|
[[block]]
|
||||||
block = "battery"
|
block = "battery"
|
||||||
|
|||||||
12
packages.yml
12
packages.yml
@@ -68,6 +68,11 @@ packages:
|
|||||||
archlinux: ["ttf-linux-libertine"]
|
archlinux: ["ttf-linux-libertine"]
|
||||||
font-emoji:
|
font-emoji:
|
||||||
archlinux: ["noto-fonts-emoji"]
|
archlinux: ["noto-fonts-emoji"]
|
||||||
|
fonts:
|
||||||
|
archlinux:
|
||||||
|
- noto-fonts
|
||||||
|
- noto-fonts-extra
|
||||||
|
- noto-fonts-cjk
|
||||||
git:
|
git:
|
||||||
# tk required for gitk
|
# tk required for gitk
|
||||||
archlinux: ["git", "tk", "git-delta", "git-filter-repo"]
|
archlinux: ["git", "tk", "git-delta", "git-filter-repo"]
|
||||||
@@ -145,7 +150,7 @@ packages:
|
|||||||
black:
|
black:
|
||||||
archlinux: ["python-black"]
|
archlinux: ["python-black"]
|
||||||
xbacklight:
|
xbacklight:
|
||||||
archlinux: ["xorg-xbacklight"]
|
archlinux: ["acpilight"]
|
||||||
wireshark:
|
wireshark:
|
||||||
archlinux: ["wireshark-cli", "wireshark-qt"]
|
archlinux: ["wireshark-cli", "wireshark-qt"]
|
||||||
nmap:
|
nmap:
|
||||||
@@ -299,7 +304,7 @@ packages:
|
|||||||
signal:
|
signal:
|
||||||
archlinux: ["signal-desktop"]
|
archlinux: ["signal-desktop"]
|
||||||
go:
|
go:
|
||||||
archlinux: ["go", "gopls"]
|
archlinux: ["go", "gopls", "delve"]
|
||||||
helix:
|
helix:
|
||||||
archlinux: ["helix"]
|
archlinux: ["helix"]
|
||||||
keepassxc:
|
keepassxc:
|
||||||
@@ -440,6 +445,9 @@ packages:
|
|||||||
css:
|
css:
|
||||||
archlinux:
|
archlinux:
|
||||||
- vscode-css-languageserver
|
- vscode-css-languageserver
|
||||||
|
watchexec:
|
||||||
|
archlinux:
|
||||||
|
- watchexec
|
||||||
|
|
||||||
remove:
|
remove:
|
||||||
mousepad:
|
mousepad:
|
||||||
|
|||||||
1
pkgbuilds/terraform-ls-bin
Submodule
1
pkgbuilds/terraform-ls-bin
Submodule
Submodule pkgbuilds/terraform-ls-bin added at 326a96877d
93
playbook.yml
93
playbook.yml
@@ -238,6 +238,8 @@
|
|||||||
|
|
||||||
- name: vim-plug
|
- name: vim-plug
|
||||||
|
|
||||||
|
- name: terraform-ls-bin
|
||||||
|
|
||||||
- set_fact:
|
- set_fact:
|
||||||
aur_packages: "{{ aur_packages|map(attribute='dependencies', default=[]) | flatten + aur_packages }}"
|
aur_packages: "{{ aur_packages|map(attribute='dependencies', default=[]) | flatten + aur_packages }}"
|
||||||
|
|
||||||
@@ -605,39 +607,55 @@
|
|||||||
permit nopass nolog setenv {PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin} :sudonopw
|
permit nopass nolog setenv {PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin} :sudonopw
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
- block:
|
- name: gpu configuration
|
||||||
- name: install AMDGPU packages
|
tags:
|
||||||
package:
|
- gpu
|
||||||
name:
|
block:
|
||||||
- mesa
|
- name: AMD configuration
|
||||||
- lib32-mesa
|
when: machine.gpu == 'amd'
|
||||||
- xf86-video-amdgpu
|
block:
|
||||||
- vulkan-radeon
|
- name: install AMDGPU packages
|
||||||
- lib32-vulkan-radeon
|
package:
|
||||||
- libva-mesa-driver
|
name:
|
||||||
- lib32-libva-mesa-driver
|
- mesa
|
||||||
- mesa-vdpau
|
- lib32-mesa
|
||||||
- lib32-mesa-vdpau
|
- xf86-video-amdgpu
|
||||||
state: present
|
- vulkan-radeon
|
||||||
become: true
|
- lib32-vulkan-radeon
|
||||||
|
- libva-mesa-driver
|
||||||
|
- lib32-libva-mesa-driver
|
||||||
|
- mesa-vdpau
|
||||||
|
- lib32-mesa-vdpau
|
||||||
|
state: present
|
||||||
|
become: true
|
||||||
|
|
||||||
- name: set AMDGPU options
|
- name: set AMDGPU options
|
||||||
copy:
|
copy:
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: "0600"
|
mode: "0600"
|
||||||
dest: /etc/X11/xorg.conf.d/20-amdgpu.conf
|
dest: /etc/X11/xorg.conf.d/20-amdgpu.conf
|
||||||
content: |
|
content: |
|
||||||
Section "Device"
|
Section "Device"
|
||||||
Identifier "AMD"
|
Identifier "AMD"
|
||||||
Driver "amdgpu"
|
Driver "amdgpu"
|
||||||
Option "VariableRefresh" "true"
|
Option "VariableRefresh" "true"
|
||||||
Option "TearFree" "true"
|
Option "TearFree" "true"
|
||||||
EndSection
|
EndSection
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
|
- name: Nvidia configuration
|
||||||
|
when: machine.gpu == 'nvidia'
|
||||||
|
block:
|
||||||
|
- name: install nouveau packages
|
||||||
|
package:
|
||||||
|
name:
|
||||||
|
- mesa
|
||||||
|
- lib32-mesa
|
||||||
|
state: present
|
||||||
|
become: true
|
||||||
when:
|
when:
|
||||||
- machine.gpu is defined and machine.gpu == 'amd'
|
- machine.gpu is defined
|
||||||
|
|
||||||
- set_fact:
|
- set_fact:
|
||||||
users: "{{ machine.users }}"
|
users: "{{ machine.users }}"
|
||||||
@@ -661,6 +679,21 @@
|
|||||||
state: absent
|
state: absent
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
|
- name: backlight configuration
|
||||||
|
tags:
|
||||||
|
- backlight
|
||||||
|
block:
|
||||||
|
# See https://wiki.archlinux.org/title/backlight#ACPI
|
||||||
|
- name: create udev rule to allow video group backlight access
|
||||||
|
copy:
|
||||||
|
dest: /etc/udev/rules.d/backlight.rules
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: '0644'
|
||||||
|
content: |
|
||||||
|
ACTION=="add", SUBSYSTEM=="backlight", RUN+="/bin/chgrp video $sys$devpath/brightness", RUN+="/bin/chmod g+w $sys$devpath/brightness"
|
||||||
|
become: true
|
||||||
|
|
||||||
- include_tasks: user.yml
|
- include_tasks: user.yml
|
||||||
args:
|
args:
|
||||||
apply:
|
apply:
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
declare -a aurdeps=()
|
declare -a aurdeps=()
|
||||||
|
|
||||||
proctected=(
|
proctected=(
|
||||||
nvidia-dkms
|
|
||||||
intel-ucode
|
intel-ucode
|
||||||
amd-ucode
|
amd-ucode
|
||||||
base
|
base
|
||||||
@@ -37,5 +36,7 @@ readarray -d $'\0' -t packages_to_remove < <(comm --zero-terminated -13 \
|
|||||||
printf '%s\0' "${package}"
|
printf '%s\0' "${package}"
|
||||||
done)
|
done)
|
||||||
|
|
||||||
sudo pacman -Rcns "${packages_to_remove[@]}"
|
if (( "${#packages_to_remove}" > 0 )) ; then
|
||||||
|
sudo pacman -Rcns "${packages_to_remove[@]}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|||||||
92
user.yml
92
user.yml
@@ -1,32 +1,36 @@
|
|||||||
- set_fact:
|
- name: base user configuration
|
||||||
user_groups:
|
tags: [user:base]
|
||||||
- libvirt
|
block:
|
||||||
- wheel
|
- set_fact:
|
||||||
- vboxusers
|
user_groups:
|
||||||
- wireshark
|
- libvirt
|
||||||
- docker
|
- wheel
|
||||||
- sudonopw
|
- vboxusers
|
||||||
- games
|
- wireshark
|
||||||
- kvm
|
- docker
|
||||||
|
- sudonopw
|
||||||
|
- games
|
||||||
|
- kvm
|
||||||
|
- video
|
||||||
|
|
||||||
- name: create user group
|
- name: create user group
|
||||||
group:
|
group:
|
||||||
name: "{{ user.name }}"
|
name: "{{ user.name }}"
|
||||||
state: present
|
state: present
|
||||||
become: true
|
become: true
|
||||||
become_user: root
|
become_user: root
|
||||||
|
|
||||||
- name: create user
|
- name: create user
|
||||||
user:
|
user:
|
||||||
name: "{{ user.name }}"
|
name: "{{ user.name }}"
|
||||||
state: present
|
state: present
|
||||||
home: "/home/{{ user.name }}"
|
home: "/home/{{ user.name }}"
|
||||||
create_home: true
|
create_home: true
|
||||||
groups: "{{ [user.name, 'dotfiles'] + user_groups }}"
|
groups: "{{ [user.name, 'dotfiles'] + user_groups }}"
|
||||||
shell: /usr/bin/zsh
|
shell: /usr/bin/zsh
|
||||||
skeleton: /dev/null
|
skeleton: /dev/null
|
||||||
become: true
|
become: true
|
||||||
become_user: root
|
become_user: root
|
||||||
|
|
||||||
- name: create systemd directory
|
- name: create systemd directory
|
||||||
file:
|
file:
|
||||||
@@ -39,30 +43,6 @@
|
|||||||
- "/home/{{ user.name }}/.config/systemd/"
|
- "/home/{{ user.name }}/.config/systemd/"
|
||||||
- "/home/{{ user.name }}/.config/systemd/user/"
|
- "/home/{{ user.name }}/.config/systemd/user/"
|
||||||
|
|
||||||
- name: disable undesired services
|
|
||||||
tags:
|
|
||||||
- undesired-services
|
|
||||||
block:
|
|
||||||
- set_fact:
|
|
||||||
undesired_user_services:
|
|
||||||
- gpg-agent.socket
|
|
||||||
- gpg-agent.sock.service
|
|
||||||
- gpg-agent-browser.socket
|
|
||||||
- gpg-agent-ssh.socket
|
|
||||||
- gpg-agent-extra.socket
|
|
||||||
- xdg-user-dirs-update.service
|
|
||||||
- gnome-keyring-daemon.service
|
|
||||||
|
|
||||||
# systemd needs a login session, machinectl handles that for us
|
|
||||||
- name: stop and mask undesired services
|
|
||||||
command:
|
|
||||||
cmd: machinectl --quiet --uid {{ user.name }} shell -- .host /usr/bin/env systemctl --user mask --now "{{ item }}"
|
|
||||||
become: true
|
|
||||||
become_user: root
|
|
||||||
register: undesired_service_cmd
|
|
||||||
changed_when: undesired_service_cmd.stderr != ""
|
|
||||||
loop: "{{ undesired_user_services }}"
|
|
||||||
|
|
||||||
- name: create directory for getty autologin
|
- name: create directory for getty autologin
|
||||||
file:
|
file:
|
||||||
state: directory
|
state: directory
|
||||||
@@ -88,7 +68,7 @@
|
|||||||
|
|
||||||
- name: configure dotfiles
|
- name: configure dotfiles
|
||||||
tags:
|
tags:
|
||||||
- dotfiles
|
- user:dotfiles
|
||||||
block:
|
block:
|
||||||
- name: load dotfile list
|
- name: load dotfile list
|
||||||
include_vars:
|
include_vars:
|
||||||
@@ -258,7 +238,7 @@
|
|||||||
|
|
||||||
- name: vim
|
- name: vim
|
||||||
tags:
|
tags:
|
||||||
- vim
|
- user:vim
|
||||||
block:
|
block:
|
||||||
- name: install vim plugins
|
- name: install vim plugins
|
||||||
command: nvim --headless +PlugInstall +qall
|
command: nvim --headless +PlugInstall +qall
|
||||||
@@ -272,7 +252,7 @@
|
|||||||
|
|
||||||
- name: firefox
|
- name: firefox
|
||||||
tags:
|
tags:
|
||||||
- firefox
|
- user:firefox
|
||||||
block:
|
block:
|
||||||
- name: create firefox directories
|
- name: create firefox directories
|
||||||
firefox_profile:
|
firefox_profile:
|
||||||
@@ -365,7 +345,7 @@
|
|||||||
|
|
||||||
- name: handle autostart units
|
- name: handle autostart units
|
||||||
tags:
|
tags:
|
||||||
- autostart
|
- user:autostart
|
||||||
block:
|
block:
|
||||||
- name: create systemd user directory
|
- name: create systemd user directory
|
||||||
file:
|
file:
|
||||||
@@ -411,7 +391,7 @@
|
|||||||
|
|
||||||
- name: gpg
|
- name: gpg
|
||||||
tags:
|
tags:
|
||||||
- gpg
|
- user:gpg
|
||||||
block:
|
block:
|
||||||
- name: import gpg key
|
- name: import gpg key
|
||||||
command: gpg --import ./gpgkeys/{{ user.gpg_key.email }}.gpg.asc
|
command: gpg --import ./gpgkeys/{{ user.gpg_key.email }}.gpg.asc
|
||||||
|
|||||||
@@ -4,15 +4,7 @@ if [[ "$(passwd --status $USER | awk '{print $2}')" =~ ^(NP|L)$ ]] ; then
|
|||||||
while ! sudo passwd $USER ; do ; done
|
while ! sudo passwd $USER ; do ; done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_path=(
|
export PATH="${PATH}:${HOME}/bin"
|
||||||
"$HOME/bin"
|
|
||||||
"$HOME/.cargo/bin"
|
|
||||||
)
|
|
||||||
|
|
||||||
for part in ${_path[@]} ; do
|
|
||||||
PATH="${part}:$PATH"
|
|
||||||
done
|
|
||||||
export PATH
|
|
||||||
|
|
||||||
export EDITOR="helix"
|
export EDITOR="helix"
|
||||||
export VISUAL="helix"
|
export VISUAL="helix"
|
||||||
@@ -25,10 +17,19 @@ export LANG=en_US.UTF-8
|
|||||||
export LC_TIME=de_DE.UTF-8
|
export LC_TIME=de_DE.UTF-8
|
||||||
export LC_COLLATE=C
|
export LC_COLLATE=C
|
||||||
|
|
||||||
export GOPATH=~/.go
|
export XAUTHORITY="$XDG_RUNTIME_DIR"/Xauthority
|
||||||
export PATH=$PATH:$(go env GOPATH)/bin
|
|
||||||
|
|
||||||
export ACPI_LID_NAME=LID
|
export RUSTUP_HOME="$XDG_DATA_HOME"/rustup
|
||||||
|
|
||||||
|
export GOPATH="$XDG_DATA_HOME"/go
|
||||||
|
export GOMODCACHE="$XDG_CACHE_HOME"/go/mod
|
||||||
|
|
||||||
|
export SQLITE_HISTORY=$XDG_STATE_HOME/sqlite_history
|
||||||
|
|
||||||
|
export KUBECONFIG="$XDG_CONFIG_HOME/kube"
|
||||||
|
export KUBECACHEDIR="$XDG_CACHE_HOME/kube"
|
||||||
|
|
||||||
|
export PATH="$PATH:$(go env GOPATH)/bin"
|
||||||
|
|
||||||
export QT_QPA_PLATFORMTHEME=qt5ct
|
export QT_QPA_PLATFORMTHEME=qt5ct
|
||||||
|
|
||||||
@@ -37,12 +38,30 @@ export XDG_CACHE_HOME="$HOME/.cache"
|
|||||||
export XDG_DATA_HOME="$HOME/.local/share"
|
export XDG_DATA_HOME="$HOME/.local/share"
|
||||||
export XDG_STATE_HOME="$HOME/.local/state"
|
export XDG_STATE_HOME="$HOME/.local/state"
|
||||||
|
|
||||||
export GNUPGHOME="$HOME/.gnupg"
|
|
||||||
|
|
||||||
export PASSWORD_STORE_DIR="$HOME/.password-store"
|
export PASSWORD_STORE_DIR="$HOME/.password-store"
|
||||||
|
|
||||||
export GTK2_RC_FILES=${XDG_CONFIG_HOME}/gtkrc-2.0
|
export GTK2_RC_FILES=${XDG_CONFIG_HOME}/gtkrc-2.0
|
||||||
|
|
||||||
|
export CARGO_HOME="${XDG_STATE_HOME}/cargo"
|
||||||
|
export PATH="${PATH}:${CARGO_HOME}/bin"
|
||||||
|
|
||||||
|
export PASSWORD_STORE_DIR="$XDG_STATE_HOME"/pass
|
||||||
|
|
||||||
|
export ANSIBLE_HOME="${XDG_CONFIG_HOME}/ansible"
|
||||||
|
export ANSIBLE_CONFIG="${XDG_CONFIG_HOME}/ansible.cfg"
|
||||||
|
export ANSIBLE_GALAXY_CACHE_DIR="${XDG_CACHE_HOME}/ansible/galaxy_cache"
|
||||||
|
|
||||||
|
export DOCKER_CONFIG="$XDG_CONFIG_HOME"/docker
|
||||||
|
|
||||||
|
export GNUPGHOME="$XDG_STATE_HOME"/gnupg
|
||||||
|
mkdir -p "${GNUPGHOME}"
|
||||||
|
chmod --quiet 700 "${GNUPGHOME}"
|
||||||
|
|
||||||
|
export PYTHON_HISTORY=$XDG_STATE_HOME/python/history
|
||||||
|
export PYTHONPYCACHEPREFIX=$XDG_CACHE_HOME/python
|
||||||
|
|
||||||
|
export XINITRC="$XDG_CONFIG_HOME"/xinitrc
|
||||||
|
|
||||||
umask 0022
|
umask 0022
|
||||||
|
|
||||||
{% set env = machine.environment | combine(user.environment) %}
|
{% set env = machine.environment | combine(user.environment) %}
|
||||||
|
|||||||
1
zsh/zshenv
Normal file
1
zsh/zshenv
Normal file
@@ -0,0 +1 @@
|
|||||||
|
ZDOTDIR="$HOME/.config/zsh"
|
||||||
92
zsh/zshrc.j2
92
zsh/zshrc.j2
@@ -1,16 +1,8 @@
|
|||||||
[[ -z "$PS1" ]] && return
|
|
||||||
|
|
||||||
{% if user.gpg_agent %}
|
{% if user.gpg_agent %}
|
||||||
export GPG_TTY=$(tty)
|
export GPG_TTY=$(tty)
|
||||||
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
|
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
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 user.ssh_agent %}
|
||||||
if ! pgrep -u "$USER" ssh-agent > /dev/null ; then
|
if ! pgrep -u "$USER" ssh-agent > /dev/null ; then
|
||||||
ssh-agent > "$XDG_RUNTIME_DIR/ssh-agent.env"
|
ssh-agent > "$XDG_RUNTIME_DIR/ssh-agent.env"
|
||||||
@@ -61,7 +53,12 @@ bindkey '^x^e' edit-command-line
|
|||||||
|
|
||||||
HISTSIZE=100000
|
HISTSIZE=100000
|
||||||
SAVEHIST=100000
|
SAVEHIST=100000
|
||||||
HISTFILE="$HOME/.zsh_history"
|
HISTFILE="$XDG_STATE_HOME/zsh_history"
|
||||||
|
|
||||||
|
# Completion files: Use XDG dirs
|
||||||
|
[ -d "$XDG_CACHE_HOME"/zsh ] || mkdir -p "$XDG_CACHE_HOME"/zsh
|
||||||
|
zstyle ':completion:*' cache-path "$XDG_CACHE_HOME"/zsh/zcompcache
|
||||||
|
compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-$ZSH_VERSION
|
||||||
|
|
||||||
alias vim="nvim"
|
alias vim="nvim"
|
||||||
|
|
||||||
@@ -169,10 +166,6 @@ gitmaster() {
|
|||||||
git stash pop
|
git stash pop
|
||||||
}
|
}
|
||||||
|
|
||||||
_remote() {
|
|
||||||
[[ -n "$SSH_CONNECTION" ]]
|
|
||||||
}
|
|
||||||
|
|
||||||
cd() {
|
cd() {
|
||||||
builtin cd "$@" && ls
|
builtin cd "$@" && ls
|
||||||
}
|
}
|
||||||
@@ -371,30 +364,15 @@ tmp() {
|
|||||||
cd "$(mktemp -d)"
|
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() {
|
+vi-git-untracked() {
|
||||||
if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' ]] && \
|
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
|
[[ $(git ls-files --other --directory --exclude-standard | sed q | wc -l | tr -d ' ') == 1 ]] ; then
|
||||||
hook_com[unstaged]+='?%f'
|
hook_com[unstaged]+='+U'
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
+vi-git-st() {
|
+vi-git-remotebranch() {
|
||||||
|
local remote
|
||||||
local ahead behind
|
local ahead behind
|
||||||
local -a gitstatus
|
local -a gitstatus
|
||||||
|
|
||||||
@@ -404,43 +382,46 @@ zstyle ':vcs_info:git*+set-message:*' hooks git-untracked git-st git-remotebranc
|
|||||||
behind=$(git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
|
behind=$(git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
|
||||||
(( $behind )) && gitstatus+=( "-${behind}" )
|
(( $behind )) && gitstatus+=( "-${behind}" )
|
||||||
|
|
||||||
hook_com[misc]+=${(j:/:)gitstatus}
|
|
||||||
}
|
|
||||||
|
|
||||||
+vi-git-remotebranch() {
|
|
||||||
local remote
|
|
||||||
|
|
||||||
remote=${$(git rev-parse --verify ${hook_com[branch]}@{upstream} \
|
remote=${$(git rev-parse --verify ${hook_com[branch]}@{upstream} \
|
||||||
--symbolic-full-name 2>/dev/null)/refs\/remotes\/}
|
--symbolic-full-name 2>/dev/null)/refs\/remotes\/}
|
||||||
|
|
||||||
if [[ -n ${remote} ]] ; then
|
if [[ -n ${remote} ]] ; then
|
||||||
hook_com[branch]="${hook_com[branch]} %b%{$fg[magenta]%}<${remote}>"
|
hook_com[branch]="%F{cyan}${hook_com[branch]}%F{$mainc}:%b%F{magenta}${remote}%F{yellow}${(j:/:)gitstatus}%F{$mainc}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setopt PROMPT_SUBST
|
||||||
|
|
||||||
|
autoload -Uz vcs_info
|
||||||
|
|
||||||
|
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:*' formats "[%b] [%c%u]"
|
||||||
|
zstyle ':vcs_info:*' actionformats '%a '
|
||||||
|
|
||||||
|
zstyle ':vcs_info:git*+set-message:*' hooks git-untracked git-remotebranch
|
||||||
|
|
||||||
precmd() {
|
precmd() {
|
||||||
vcs_info
|
vcs_info
|
||||||
}
|
}
|
||||||
|
|
||||||
autoload -Uz vcs_info
|
if [[ -e "$XDG_RUNTIME_DIR/darkmode" ]] ; then
|
||||||
zstyle ':vcs_info:*' enable git hg
|
mainc=white
|
||||||
zstyle ':vcs_info:*' check-for-changes true
|
else
|
||||||
|
mainc=black
|
||||||
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
|
fi
|
||||||
|
|
||||||
setopt prompt_subst
|
_topstr='%F{green}%n%F{$mainc} ─ %B%F{yellow}%4~%b ${vcs_info_msg_0_}%F{$mainc} '
|
||||||
|
botstr='%B${PINFO}%(!.#.$)%b '
|
||||||
|
|
||||||
|
PROMPT='%F{$mainc}┌─ '"${_topstr}"'
|
||||||
PROMPT='%{$fg[white]%}┌─ '"${_topstr}"'
|
|
||||||
└─ '"${botstr}"
|
└─ '"${botstr}"
|
||||||
RPROMPT="%{$fg[cyan]%}%*%{$fg[white]%} ─ [%?]"
|
RPROMPT='%b%F{cyan}%*%F{$mainc} [%?]'
|
||||||
|
|
||||||
autoload zkbd
|
autoload zkbd
|
||||||
|
|
||||||
@@ -472,4 +453,9 @@ bindkey '^i' expand-or-complete-prefix
|
|||||||
export FZF_DEFAULT_OPTS='--height 50% --border'
|
export FZF_DEFAULT_OPTS='--height 50% --border'
|
||||||
eval "$(fzf --zsh)"
|
eval "$(fzf --zsh)"
|
||||||
|
|
||||||
|
# These have to be sourced at the end, see
|
||||||
|
# https://github.com/zsh-users/zsh-syntax-highlighting?tab=readme-ov-file#why-must-zsh-syntax-highlightingzsh-be-sourced-at-the-end-of-the-zshrc-file
|
||||||
|
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||||
|
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
|
||||||
|
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
|||||||
Reference in New Issue
Block a user