diff --git a/.config/nvim/pack/plugins/opt/lspconfig b/.config/nvim/pack/plugins/opt/lspconfig index d177ad2..cc388d3 160000 --- a/.config/nvim/pack/plugins/opt/lspconfig +++ b/.config/nvim/pack/plugins/opt/lspconfig @@ -1 +1 @@ -Subproject commit d177ad277a638f262edb73c75ffe33e377b95dc5 +Subproject commit cc388d3f6b9c7c943ae2b2dcd46ad470fd257f91 diff --git a/.config/nvim/pack/plugins/opt/plenary b/.config/nvim/pack/plugins/opt/plenary index 0232372..9ce85b0 160000 --- a/.config/nvim/pack/plugins/opt/plenary +++ b/.config/nvim/pack/plugins/opt/plenary @@ -1 +1 @@ -Subproject commit 0232372b906f275f76ac42029eba25eaf95e76b9 +Subproject commit 9ce85b0f7dcfe5358c0be937ad23e456907d410b diff --git a/.config/nvim/pack/plugins/opt/telescope b/.config/nvim/pack/plugins/opt/telescope index a197706..b543aaa 160000 --- a/.config/nvim/pack/plugins/opt/telescope +++ b/.config/nvim/pack/plugins/opt/telescope @@ -1 +1 @@ -Subproject commit a19770625aed49ad2a9f591a5e3946707f7359f6 +Subproject commit b543aaa2c9cf8123ed2fe7dbb6c211a9cd415124 diff --git a/.config/nvim/pack/plugins/opt/treesitter b/.config/nvim/pack/plugins/opt/treesitter index 96a5024..f903481 160000 --- a/.config/nvim/pack/plugins/opt/treesitter +++ b/.config/nvim/pack/plugins/opt/treesitter @@ -1 +1 @@ -Subproject commit 96a50241987531fdb8a516998b72c19f563ccd6c +Subproject commit f9034812d8335356ef3ede49110d1569624033fa diff --git a/.config/suckless b/.config/suckless index 0a0a3b1..f4d4ada 160000 --- a/.config/suckless +++ b/.config/suckless @@ -1 +1 @@ -Subproject commit 0a0a3b1a819626969f7e39a664d24ebf82e06245 +Subproject commit f4d4ada805a642bf599baf86f32aa60ee7e5cacd diff --git a/.config/zsh/.docker_aliases b/.config/zsh/.docker_aliases index 439359a..7bb6287 100644 --- a/.config/zsh/.docker_aliases +++ b/.config/zsh/.docker_aliases @@ -1,7 +1,7 @@ -alias docker='sudo docker' -alias docker-compose='sudo docker-compose' +# podman +alias docker='podman' +alias docker-compose='podman-compose' -# docker alias dk='docker' ## container @@ -22,12 +22,17 @@ alias dkr='docker run -i -t' alias dktop='docker top' ## image -alias dkb='docker build .' +alias dkb='docker build . -t' alias dki='docker image' alias dkic='docker image create' alias dkii='docker image inspect' alias dkil='docker pull' -alias dkila="docker image ls | grep -v none | awk '{print \"docker pull \" \$1 \":\" \$2}' | $SHELL" +function dkila() { + readarray -t IMG \ + <<< "$(docker image ls | grep -v localhost | awk '{print $1 ":" $2}')" + + docker pull "${IMG[@]}" +} alias dkils='docker image ls' alias dkilsa='docker image ls -a' alias dkilsaq='docker image ls -a -q' diff --git a/.config/zsh/.kubectl_aliases b/.config/zsh/.kubectl_aliases index d96eabb..e7500bb 100644 --- a/.config/zsh/.kubectl_aliases +++ b/.config/zsh/.kubectl_aliases @@ -17,14 +17,9 @@ function kxn() { local ctx="$(echo - "$1" | awk '{print $1}')"; ctx="${ctx:l}" local ns="${2-$(echo - "$1" | awk '{print $2}')}"; ns="${ns:l}" - [ "$ctx" = hrmn ] \ - && ln -sf /usr/local/bin/k1.18 /var/tmp/kubectl \ - || ln -sf /usr/bin/kubectl /var/tmp/kubectl - kubectx "$ctx" [ -n "$ns" ] && kubens "$ns" } -alias kubectl='/var/tmp/kubectl' alias kns='kubens' alias k='kubectl' diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile index b23ba3b..0add2d5 100644 --- a/.config/zsh/.zprofile +++ b/.config/zsh/.zprofile @@ -1,6 +1,3 @@ -ln -sf "$(mktemp -d chromiumconfigXXX)" "$XDG_CACHE_HOME/chromium" -ln -sf "$(mktemp -d chromiumcacheXXXX)" "$XDG_CONFIG_HOME/chromium" - if [ "$XDG_VTNR" = 1 ]; then GUILOG="$HOME/.local/share/gui.log" diff --git a/.config/zsh/.zsh_aliases b/.config/zsh/.zsh_aliases index a6bb8ec..38a7308 100644 --- a/.config/zsh/.zsh_aliases +++ b/.config/zsh/.zsh_aliases @@ -1,5 +1,4 @@ # system -alias tmp='cd "$(mktemp -d)"' alias update='sudo pacman -Syu && config submodule update --remote --recursive --init' alias pac='sudo pacman' alias vi='$EDITOR' @@ -38,4 +37,8 @@ function j() { cd "$dest" } +function tmp() { + cd "$(mktemp -dt "$1"XXX)" +} + # vim: ft=zsh diff --git a/.config/zsh/ohmyzsh b/.config/zsh/ohmyzsh index cd18bce..cdd7dab 160000 --- a/.config/zsh/ohmyzsh +++ b/.config/zsh/ohmyzsh @@ -1 +1 @@ -Subproject commit cd18bce53e01d0f614ffcbb7429053fb508cb095 +Subproject commit cdd7dab5db4c668b962f908b57e244aa1ff4b574 diff --git a/.xinitrc b/.xinitrc index edd920d..0ae54fa 100644 --- a/.xinitrc +++ b/.xinitrc @@ -4,6 +4,7 @@ #(i3status | while read line; do xsetroot -name "$line"; done) & # startup +. <(ssh-agent) wallpaper & xss-lock -n screensaver -- lock & /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 || # arch @@ -12,5 +13,6 @@ xss-lock -n screensaver -- lock & picom & gammastep 2> /dev/null & sbar & +./keepass/start.sh & exec dbus-launch dwm diff --git a/bin/containers/banana b/bin/containers/banana index 5a32a92..0dc1bba 100755 --- a/bin/containers/banana +++ b/bin/containers/banana @@ -1,7 +1,6 @@ #!/bin/bash -e # shellcheck disable=SC2034 -DBUS_SESSION_BUS_ADDRESS= # https://wiki.archlinux.org/title/Podman#Permission_denied:_OCI_permission_denied CRI=(podman) IMG=ghcr.io/epitech/coding-style-checker diff --git a/bin/containers/gui b/bin/containers/gui index 4a04d75..93015c3 100755 --- a/bin/containers/gui +++ b/bin/containers/gui @@ -1,9 +1,5 @@ #!/bin/bash -e -if grep -q 'Arch' /etc/os-release; then - unset DBUS_SESSION_BUS_ADDRESS -fi - if [ -z "$WAYLAND_DISPLAY" ]; then CRI_OPT+=( --network host diff --git a/bin/containers/lutris b/bin/containers/lutris index 4afe0b1..2ce02d4 100755 --- a/bin/containers/lutris +++ b/bin/containers/lutris @@ -1,9 +1,5 @@ #!/bin/bash -e -if grep -q 'Arch' /etc/os-release; then - unset DBUS_SESSION_BUS_ADDRESS -fi - if [ -z "$WAYLAND_DISPLAY" ]; then CRI_OPT+=( --network host diff --git a/bin/containers/minecraft b/bin/containers/minecraft index a702a86..f8fe15b 100755 --- a/bin/containers/minecraft +++ b/bin/containers/minecraft @@ -1,9 +1,5 @@ #!/bin/bash -e -if grep -q 'Arch' /etc/os-release; then - unset DBUS_SESSION_BUS_ADDRESS -fi - if [ -z "$WAYLAND_DISPLAY" ]; then CRI_OPT+=( --network host diff --git a/bin/keepassxc b/bin/keepassxc new file mode 100755 index 0000000..589325c --- /dev/null +++ b/bin/keepassxc @@ -0,0 +1,5 @@ +#!/bin/bash + +KEEPASS="$HOME/keepass" + +/usr/bin/keepassxc --config "$KEEPASS/keepassxc.ini" "$KEEPASS/Passwords.kdbx" diff --git a/bin/scanpdf b/bin/scanpdf deleted file mode 100755 index 5ec6741..0000000 --- a/bin/scanpdf +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -set -e - -usage() { - echo "USAGE: $0 FILE.pdf" - exit -} - -if [[ "$1" != *.pdf ]]; then - usage -fi - -DEVICE='pixma:04A9178A_31A16C' -FORMAT='png' -RES=300 - -scanimage -d "$DEVICE" --format="$FORMAT" --resolution "$RES" | convert - "$1" diff --git a/bin/wlp b/bin/wlp index 3ba1d7a..f702fc2 100755 --- a/bin/wlp +++ b/bin/wlp @@ -1,50 +1,76 @@ #!/bin/bash -e NMCLI=(nmcli -f 'SSID,RATE,BARS,SECURITY' dev wifi) -CON=("${NMCLI[@]}" connect) -RESCAN=0 -function rescan() { - if [ "$RESCAN" = 1 ]; then - return 1 - fi - RESCAN=1 - "${NMCLI[@]}" list --rescan yes > /dev/null - readarray -t NET <<< "$("${NMCLI[@]}" list | awk '!w[$1]++' | tail -n+2)" +function ask_pass() { + local net="$1" p + + while [ "${#p}" -lt 8 ]; do + p="$(zenity --entry --entry-text="$pass" --text "Enter password for $net")" + if [ "$?" -ne 0 ]; then + return 1 + fi + pass="$p" + done + echo "$p" +} + +function get_net() { + local cmd=("${NMCLI[@]}" list) + + [ "$1" = '-r' ] && cmd+=(--rescan yes) + readarray -t NET <<< "$("${cmd[@]}" | awk '!w[$1]++' | tail +2)" } function connect() { + local cmd=("${NMCLI[@]}" connect "$1") local pass - if ! "${CON[@]}" "$1"; then - case "$?" in - 4) - pass="$(zenity --entry --text "Enter password for $1")" - "${CON[@]}" "$1" password "$pass" - ;; - 10) - rescan && connect "$@" - ;; - esac - fi + [[ "$2" -ge 2 ]] && return 1 + "${cmd[@]}" + case "$?" in + 0) + ;; + 4) # Connection activation failed. + while [ "$?" = 4 ]; do + pass="$(ask_pass "$1")" + if [ -z "$pass" ]; then + exit + fi + "${cmd[@]}" password "$pass" + done + ;; + 10) # Connection, device, or access point does not exist. + get_net -r && connect "$@" "$(($2 + 1))" + ;; + *) + return 1 + ;; + esac kill -36 "$(cat "$HOME/.cache/pidofbar")" exit } -if [ -n "$1" ]; then - connect "$1" -fi - -readarray -t NET <<< "$("${NMCLI[@]}" list | awk '!w[$1]++' | tail -n+2)" -while true; do - n="$(printf '%s\n' "${NET[@]}" rescan | dmenu -i -l 10)" - if [ -z "$n" ]; then +function readopt() { + if ! printf '%s\n' "${NET[@]}" rescan | dmenu -i -l 10; then exit fi - if [ "$n" = rescan ]; then - RESCAN=0 - rescan - else - connect "$(awk '{print $1}' <<< "$n")" - fi +} + +if [ -n "$1" ]; then + connect "$1" + exit +fi + +get_net +while true; do + opt="$(readopt)" + case "$opt" in + rescan) + get_net -r + ;; + *) + connect "$(awk '{print $1}' <<< "$opt")" + ;; + esac done