From c377eb276a015f025b6d1125167eba63dc80a28b Mon Sep 17 00:00:00 2001 From: shokinn Date: Sat, 11 Sep 2021 23:45:56 +0200 Subject: [PATCH] consolidate and templeate my to files in order to stop maintainung different files for each operationg system --- .env.public | 2 +- README.md | 15 +- config.yaml | 51 ++--- dotfiles/Xresources | 2 +- dotfiles/bin/c3check | 12 +- dotfiles/bin/c3cp | 6 +- dotfiles/bin/c3kdenlive | 10 +- dotfiles/bin/c3l | 10 +- dotfiles/bin/c3mpv | 10 +- dotfiles/bin/mount_c3voc | 40 ++-- dotfiles/config/bspwm/bspwmrc | 5 +- dotfiles/config/bspwm/lock.sh | 10 +- dotfiles/config/compton/compton.conf | 2 +- dotfiles/config/polybar/config | 2 +- dotfiles/config/polybar/cpuload.sh | 3 +- dotfiles/config/polybar/launch.sh | 5 +- dotfiles/config/polybar/mod_config | 2 +- .../config/polybar/refresh_bar_usb_nic.sh | 29 ++- dotfiles/config/rofi/config | 2 +- dotfiles/config/sxhkd/sxhkdrc | 2 +- .../config/systemd/user/ssh-agent.service | 2 +- dotfiles/fehbg | 2 +- dotfiles/local/bin/kite | 6 +- .../themes/bspwm.qss | 2 +- dotfiles/p10k.zsh | 2 +- dotfiles/powerlevel9krc | 2 +- dotfiles/profile | 16 -- dotfiles/profile_win | 13 -- dotfiles/start_systemd_shell.sh | 3 +- dotfiles/vim/colors/nord.vim | 2 +- dotfiles/vim/colors/smyck.vim | 2 +- dotfiles/vimrc | 2 +- dotfiles/xinitrc | 27 +-- dotfiles/xsession | 7 +- dotfiles/z_profile | 25 +++ dotfiles/zprofile_mac | 13 -- dotfiles/zshenv | 35 +++- dotfiles/zshenv_win | 44 ----- dotfiles/zshrc | 97 ++++++---- dotfiles/zshrc_mac | 178 ------------------ 40 files changed, 246 insertions(+), 454 deletions(-) delete mode 100644 dotfiles/profile delete mode 100644 dotfiles/profile_win create mode 100644 dotfiles/z_profile delete mode 100644 dotfiles/zprofile_mac delete mode 100644 dotfiles/zshenv_win delete mode 100644 dotfiles/zshrc_mac diff --git a/.env.public b/.env.public index eea9b2b..19d1f9a 100644 --- a/.env.public +++ b/.env.public @@ -1 +1 @@ -dotdrop_warning="This file is managed by dotdrop, only edit it in your dotdrop files!" +# Environment Variables for dotdrop templating \ No newline at end of file diff --git a/README.md b/README.md index 976ff0c..0c1436f 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,19 @@ I manage my dotfiles using [dotdrop](https://github.com/deadc0de6/dotdrop). ## How to install +1. Install [Homebrew](https://brew.sh/) +2. Install `coreutils` via Homebrew. +3. Install [pyenv](https://github.com/pyenv/pyenv) +4. Install the latest python version via pyenv +5. Configure the latest python version as system (global) default +6. Clone dotfiles, install dependencies for dotdrop and install dotfiles. ```shell -# git clone https://github.com/shokinn/.files ~/.files -# eval $(grep -v "^#" ~/.files/.env.public) ~/.files/dotdrop.sh +git clone https://github.com/shokinn/.files ~/.files \ +&& pip3 install --user -r ~/.files/dotdrop/requirements.txt \ +&& eval $(grep -v "^#" ~/.files/.env.public) ~/.files/dotdrop.sh install ``` ## Documentation -Maybe you should [take a look to my documentation](https://docs.pphg.tech/) to understand how I use my dotfiles. - +~~Maybe you should [take a look to my documentation](https://docs.pphg.tech/) to understand how I use my dotfiles.~~ +My documentation is currently quite outdated and should not be considered for help. diff --git a/config.yaml b/config.yaml index b9f29ad..a2dc542 100644 --- a/config.yaml +++ b/config.yaml @@ -1,3 +1,7 @@ +config: + backup: true + create: true + dotpath: dotfiles actions: oh-my-zsh: | [[ ! -d ${{HOME}}/.oh-my-zsh ]] && sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" "" --unattended || echo "do nothing" >/dev/null @@ -8,10 +12,6 @@ actions: powerlevel10k-theme: | [[ ! -d ${{ZSH_CUSTOM:-${{HOME}}/.oh-my-zsh/custom}}/themes ]] && mkdir -p ${{ZSH_CUSTOM:-${{HOME}}/.oh-my-zsh/custom}}/themes || echo "do nothing" >/dev/null [[ ! -d ${{ZSH_CUSTOM:-${{HOME}}/.oh-my-zsh/custom}}/themes/powerlevel10k ]] && git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${{ZSH_CUSTOM:-${{HOME}}/.oh-my-zsh/custom}}/themes/powerlevel10k || echo "do nothing" >/dev/null -config: - backup: true - create: true - dotpath: dotfiles dotfiles: d_bspwm: dst: ~/.config/bspwm @@ -64,10 +64,7 @@ dotfiles: src: p10k.zsh f_profile: dst: ~/.profile - src: profile - f_profile_win: - dst: ~/.profile - src: profile_win + src: z_profile f_rofi_config: dst: ~/.config/rofi/config src: config/rofi/config @@ -88,29 +85,15 @@ dotfiles: src: xsession f_zprofile: dst: ~/.zprofile - src: profile - f_zprofile_win: - dst: ~/.zprofile - src: profile_win - f_zprofile_mac: - dst: ~/.zprofile - src: zprofile_mac + src: z_profile f_zshenv: dst: ~/.zshenv src: zshenv - f_zshenv_win: - dst: ~/.zshenv - src: zshenv_win f_zshrc: actions: - oh-my-zsh dst: ~/.zshrc src: zshrc - f_zshrc_mac: - actions: - - oh-my-zsh - dst: ~/.zshrc - src: zshrc_mac f_start_systemd_shell.sh: src: start_systemd_shell.sh dst: ~/start_systemd_shell.sh @@ -121,10 +104,10 @@ profiles: YOETUNHEIMR-wsl: dotfiles: - d_fonts - - f_profile_win + - f_profile - f_vimrc - f_zshrc - - f_zshenv_win + - f_zshenv - f_powerlevel10krc - d_colors - f_compton.conf @@ -135,15 +118,15 @@ profiles: - f_c3kdenlive - f_c3mpv - f_c3check - - f_zprofile_win + - f_zprofile - f_start_systemd_shell.sh AINCRAD: dotfiles: - d_fonts - - f_profile_win + - f_profile - f_vimrc - f_zshrc - - f_zshenv_win + - f_zshenv - f_powerlevel10krc - d_colors - f_compton.conf @@ -154,15 +137,15 @@ profiles: - f_c3kdenlive - f_c3mpv - f_c3check - - f_zprofile_win + - f_zprofile - f_start_systemd_shell.sh AINCRAD-wsl: dotfiles: - d_fonts - - f_profile_win + - f_profile - f_vimrc - f_zshrc - - f_zshenv_win + - f_zshenv - f_powerlevel10krc - d_colors - f_compton.conf @@ -173,7 +156,7 @@ profiles: - f_c3kdenlive - f_c3mpv - f_c3check - - f_zprofile_win + - f_zprofile - f_start_systemd_shell.sh yoetunheimr: dotfiles: @@ -214,7 +197,7 @@ profiles: VWAGWOY00349: dotfiles: - f_vimrc - - f_zshrc_mac + - f_zshrc - f_zshenv - f_powerlevel10krc - d_colors @@ -224,4 +207,4 @@ profiles: - f_c3kdenlive - f_c3mpv - f_c3check - - f_zprofile_mac + - f_zprofile diff --git a/dotfiles/Xresources b/dotfiles/Xresources index 38e7c56..f2c4ffc 100644 --- a/dotfiles/Xresources +++ b/dotfiles/Xresources @@ -1,5 +1,5 @@ /* - {{@@ env['dotdrop_warning'] @@}} + {{@@ header() @@}} */ /* Set each shell as loginShell */ diff --git a/dotfiles/bin/c3check b/dotfiles/bin/c3check index eb5aac5..e5d590e 100755 --- a/dotfiles/bin/c3check +++ b/dotfiles/bin/c3check @@ -1,17 +1,17 @@ #!/usr/bin/env bash # -# {{@@ env['dotdrop_warning'] @@}} +# {{@@ header() @@}} # -if [[ -z "$1" ]] || [[ -z "$2" ]] || [[ -z "$3" ]]; then - echo "Usage: $0 " - echo "e.g.: $0 vlc 35c3 9766" +if [[ -z "${1}" ]] || [[ -z "${2}" ]] || [[ -z "${3}" ]]; then + echo "Usage: ${0} " + echo "e.g.: ${0} vlc 35c3 9766" exit 1 fi -mediainfo /video/video/encoded/$2/$3-hd.mp4 +mediainfo /video/video/encoded/${2}/${3}-hd.mp4 read -p "Press any key to continue... " -n1 -s -$1 /video/video/encoded/$2/$3-hd.mp4 +${1} /video/video/encoded/${2}/${3}-hd.mp4 diff --git a/dotfiles/bin/c3cp b/dotfiles/bin/c3cp index b7809a1..c3a9348 100755 --- a/dotfiles/bin/c3cp +++ b/dotfiles/bin/c3cp @@ -1,12 +1,12 @@ #!/usr/bin/env bash # -# {{@@ env['dotdrop_warning'] @@}} +# {{@@ header() @@}} # -if [[ -z "$1" ]]; then +if [[ -z "${1}" ]]; then echo "Filepath missing." exit 1 fi -rsync --verbose --progress --inplace $1 /tmp/ +rsync --verbose --progress --inplace ${1} /tmp/ diff --git a/dotfiles/bin/c3kdenlive b/dotfiles/bin/c3kdenlive index 52b0756..8ac3da8 100755 --- a/dotfiles/bin/c3kdenlive +++ b/dotfiles/bin/c3kdenlive @@ -1,13 +1,13 @@ #!/usr/bin/env bash # -# {{@@ env['dotdrop_warning'] @@}} +# {{@@ header() @@}} # -if [[ -z "$1" ]] || [[ -z "$2" ]]; then - echo "Usage: $0 " - echo "e.g.: $0 35c3 9766" +if [[ -z "${1}" ]] || [[ -z "${2}" ]]; then + echo "Usage: ${0} " + echo "e.g.: ${0} 35c3 9766" exit 1 fi -kdenlive /video/fuse/$1/*/$2/project.kdenlive +kdenlive /video/fuse/${1}/*/${2}/project.kdenlive diff --git a/dotfiles/bin/c3l b/dotfiles/bin/c3l index 8a01a78..3c73676 100755 --- a/dotfiles/bin/c3l +++ b/dotfiles/bin/c3l @@ -1,13 +1,13 @@ #!/usr/bin/env bash # -# {{@@ env['dotdrop_warning'] @@}} +# {{@@ header() @@}} # -if [[ -z "$1" ]] || [[ -z "$2" ]]; then - echo "Usage: $0 " - echo "e.g.: $0 35c3 9766" +if [[ -z "${1}" ]] || [[ -z "${2}" ]]; then + echo "Usage: ${0} " + echo "e.g.: ${0} 35c3 9766" exit 1 fi -ls -lah --color=tty /video/fuse/$1/*/$2/ +ls -lah --color=tty /video/fuse/${1}/*/${2}/ diff --git a/dotfiles/bin/c3mpv b/dotfiles/bin/c3mpv index dbf6165..b101c8b 100755 --- a/dotfiles/bin/c3mpv +++ b/dotfiles/bin/c3mpv @@ -1,13 +1,13 @@ #!/usr/bin/env bash # -# {{@@ env['dotdrop_warning'] @@}} +# {{@@ header() @@}} # -if [[ -z "$1" ]] || [[ -z "$2" ]]; then - echo "Usage: $0 " - echo "e.g.: $0 35c3 9766" +if [[ -z "${1}" ]] || [[ -z "${2}" ]]; then + echo "Usage: ${0} " + echo "e.g.: ${0} 35c3 9766" exit 1 fi -mpv /video/fuse/$1/*/$2/uncut.ts +mpv /video/fuse/${1}/*/${2}/uncut.ts diff --git a/dotfiles/bin/mount_c3voc b/dotfiles/bin/mount_c3voc index 11008df..50f8921 100755 --- a/dotfiles/bin/mount_c3voc +++ b/dotfiles/bin/mount_c3voc @@ -1,23 +1,23 @@ #!/usr/bin/env bash # -# {{@@ env['dotdrop_warning'] @@}} +# {{@@ header() @@}} # -if [[ $UID -ne 0 ]]; then +if [[ ${UID} -ne 0 ]]; then echo "You have to run this script as root!" exit 1 fi options=( storage aws umount ) -if [[ -z "$1" ]]; then - echo "Usage: $0 " - echo "e.g.: $0 c3" +if [[ -z "${1}" ]]; then + echo "Usage: ${0} " + echo "e.g.: ${0} c3" echo " " echo "Valid options:" for i in "${options[@]}"; do - echo " - $i" + echo " - ${i}" done fi @@ -25,28 +25,28 @@ fuse="/video/fuse" video="/video/video" tmp="/video/tmp" -if mount | grep $fuse > /dev/null; then - umount $fuse +if mount | grep ${fuse} > /dev/null; then + umount ${fuse} fi -if mount | grep $video > /dev/null; then - umount $video +if mount | grep ${video} > /dev/null; then + umount ${video} fi -if mount | grep $tmp > /dev/null; then - umount $tmp +if mount | grep ${tmp} > /dev/null; then + umount ${tmp} fi -case $1 in +case ${1} in storage) - mount.cifs //storage.lan.c3voc.de/fuse $fuse -o rw,guest -o uid=phg - mount.cifs //storage.lan.c3voc.de/video $video -o rw,guest -o uid=phg - mount.cifs //storage.lan.c3voc.de/tmp $tmp -o rw,guest -o uid=phg + mount.cifs //storage.lan.c3voc.de/fuse ${fuse} -o rw,guest -o uid=phg + mount.cifs //storage.lan.c3voc.de/video ${video} -o rw,guest -o uid=phg + mount.cifs //storage.lan.c3voc.de/tmp ${tmp} -o rw,guest -o uid=phg ;; aws) - mount.cifs //aws.lan.c3voc.de/fuse $fuse -o rw,guest -o uid=phg - mount.cifs //aws.lan.c3voc.de/video $video -o rw,guest -o uid=phg - mount.cifs //aws.lan.c3voc.de/tmp $tmp -o rw,guest -o uid=phg + mount.cifs //aws.lan.c3voc.de/fuse ${fuse} -o rw,guest -o uid=phg + mount.cifs //aws.lan.c3voc.de/video ${video} -o rw,guest -o uid=phg + mount.cifs //aws.lan.c3voc.de/tmp ${tmp} -o rw,guest -o uid=phg ;; umount) ;; @@ -54,6 +54,6 @@ case $1 in echo "Mountpoint does not exist." echo "Please use one of the following:" for i in "${options[@]}"; do - echo " - $i" + echo " - ${i}" done esac diff --git a/dotfiles/config/bspwm/bspwmrc b/dotfiles/config/bspwm/bspwmrc index 6bf07b2..767ce75 100755 --- a/dotfiles/config/bspwm/bspwmrc +++ b/dotfiles/config/bspwm/bspwmrc @@ -1,13 +1,14 @@ #! /bin/sh + # -# {{@@ env['dotdrop_warning'] @@}} +# {{@@ header() @@}} # # https://wiki.archlinux.org/index.php/GNOME/Keyring # Launch sxhkd sxhkd & # Launch polybar(s) -$HOME/.config/polybar/launch.sh & +{{@@ env['HOME'] @@}}/.config/polybar/launch.sh & # Set windomanager name to LG3D to get JAVA programs back to work wmname LG3D diff --git a/dotfiles/config/bspwm/lock.sh b/dotfiles/config/bspwm/lock.sh index 615391f..fbf5e48 100755 --- a/dotfiles/config/bspwm/lock.sh +++ b/dotfiles/config/bspwm/lock.sh @@ -1,11 +1,11 @@ -# -# {{@@ env['dotdrop_warning'] @@}} -# - #!/bin/bash +# +# {{@@ header() @@}} +# + # Set lock screen background -lockscreen="$HOME/.config/bspwm/lock.png" +lockscreen="{{@@ env['HOME'] @@}}/.config/bspwm/lock.png" # Lock all KeePass databases keepass --lock-all diff --git a/dotfiles/config/compton/compton.conf b/dotfiles/config/compton/compton.conf index 8247d15..8649662 100644 --- a/dotfiles/config/compton/compton.conf +++ b/dotfiles/config/compton/compton.conf @@ -1,5 +1,5 @@ # -# {{@@ env['dotdrop_warning'] @@}} +# {{@@ header() @@}} # # Thank you code_nomad: http://9m.no/ꪯ鵞 diff --git a/dotfiles/config/polybar/config b/dotfiles/config/polybar/config index 3874fdf..8d83947 100644 --- a/dotfiles/config/polybar/config +++ b/dotfiles/config/polybar/config @@ -1,6 +1,6 @@ ;======================================= ; -; {{@@ env['dotdrop_warning'] @@}} +; {{@@ header() @@}} ; ; Polybar configuration for ; Dell XPS 15 9560 diff --git a/dotfiles/config/polybar/cpuload.sh b/dotfiles/config/polybar/cpuload.sh index 1ce3303..1da89e2 100755 --- a/dotfiles/config/polybar/cpuload.sh +++ b/dotfiles/config/polybar/cpuload.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash + # -# {{@@ env['dotdrop_warning'] @@}} +# {{@@ header() @@}} # load=$(uptime | grep -ohe 'load average[s:][: ].*' | sed 's/,//g' | awk '{print $3" "$4" "$5}') diff --git a/dotfiles/config/polybar/launch.sh b/dotfiles/config/polybar/launch.sh index aad629b..65f979e 100755 --- a/dotfiles/config/polybar/launch.sh +++ b/dotfiles/config/polybar/launch.sh @@ -1,6 +1,7 @@ #!/usr/bin/env sh + # -# {{@@ env['dotdrop_warning'] @@}} +# {{@@ header() @@}} # # Terminate already running bar instances @@ -13,4 +14,4 @@ while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done # Launch bar1 and bar2 polybar -r -q 9560-top & polybar -r -q 9560-bottom & -$HOME/.config/polybar/refresh_bar_usb_nic.sh & +{{@@ env['HOME'] @@}}/.config/polybar/refresh_bar_usb_nic.sh & diff --git a/dotfiles/config/polybar/mod_config b/dotfiles/config/polybar/mod_config index 9272650..35ef779 100644 --- a/dotfiles/config/polybar/mod_config +++ b/dotfiles/config/polybar/mod_config @@ -1,5 +1,5 @@ ; -; {{@@ env['dotdrop_warning'] @@}} +; {{@@ header() @@}} ; ; diff --git a/dotfiles/config/polybar/refresh_bar_usb_nic.sh b/dotfiles/config/polybar/refresh_bar_usb_nic.sh index 15ffc43..491315d 100755 --- a/dotfiles/config/polybar/refresh_bar_usb_nic.sh +++ b/dotfiles/config/polybar/refresh_bar_usb_nic.sh @@ -1,8 +1,7 @@ -#!/bin/bash +#!/usr/bin/env bash -###################### # -# {{@@ env['dotdrop_warning'] @@}} +# {{@@ header() @@}} # # This script detects if an USB NIC was connected and reloads the bar # @@ -11,30 +10,30 @@ while true; do # Get PID of the bottom bar pid_bottom_bar=$(ps -x | awk '!/awk/ && /9560-bottom/ {print $1}') # 1st USB port (right) - if [[ -z $USB_NIC1 ]]; then + if [[ -z ${USB_NIC1} ]]; then USB_NIC1=$(ip link | awk '!/awk/ && /enp0s20f0u1/ {print $2}' | cut -d":" -f1) - if [[ -n $USB_NIC1 ]]; then - polybar-msg -p $pid_bottom_bar cmd restart + if [[ -n ${USB_NIC1} ]]; then + polybar-msg -p ${pid_bottom_bar} cmd restart fi - elif [[ -n $USB_NIC1 ]]; then + elif [[ -n ${USB_NIC1} ]]; then USB_NIC1_CHECK=$(ip link | awk '!/awk/ && /enp0s20f0u1/ {print $2}' | cut -d":" -f1) - if [[ -z $USB_NIC1_CHECK ]]; then + if [[ -z ${USB_NIC1_CHECK} ]]; then unset USB_NIC1 - polybar-msg -p $pid_bottom_bar cmd restart + polybar-msg -p ${pid_bottom_bar} cmd restart fi fi # 2nd USB port (left) - if [[ -z $USB_NIC2 ]]; then + if [[ -z ${USB_NIC2} ]]; then USB_NIC2=$(ip link | awk '!/awk/ && /enp0s20f0u2/ {print $2}' | cut -d":" -f1) - if [[ -n $USB_NIC2 ]]; then - polybar-msg -p $pid_bottom_bar cmd restart + if [[ -n ${USB_NIC2} ]]; then + polybar-msg -p ${pid_bottom_bar} cmd restart fi - elif [[ -n $USB_NIC2 ]]; then + elif [[ -n ${USB_NIC2} ]]; then USB_NIC2_CHECK=$(ip link | awk '!/awk/ && /enp0s20f0u2/ {print $2}' | cut -d":" -f1) - if [[ -z $USB_NIC2_CHECK ]]; then + if [[ -z ${USB_NIC2_CHECK} ]]; then unset USB_NIC2 - polybar-msg -p $pid_bottom_bar cmd restart + polybar-msg -p ${pid_bottom_bar} cmd restart fi fi diff --git a/dotfiles/config/rofi/config b/dotfiles/config/rofi/config index a1b75d4..a623941 100644 --- a/dotfiles/config/rofi/config +++ b/dotfiles/config/rofi/config @@ -1,5 +1,5 @@ ! -! {{@@ env['dotdrop_warning'] @@}} +! {{@@ header() @@}} ! ! ------------------------------------------------------------------------------ diff --git a/dotfiles/config/sxhkd/sxhkdrc b/dotfiles/config/sxhkd/sxhkdrc index 9e5d6ba..ebd3344 100755 --- a/dotfiles/config/sxhkd/sxhkdrc +++ b/dotfiles/config/sxhkd/sxhkdrc @@ -1,5 +1,5 @@ # -# {{@@ env['dotdrop_warning'] @@}} +# {{@@ header() @@}} # ## diff --git a/dotfiles/config/systemd/user/ssh-agent.service b/dotfiles/config/systemd/user/ssh-agent.service index a806574..30c9353 100644 --- a/dotfiles/config/systemd/user/ssh-agent.service +++ b/dotfiles/config/systemd/user/ssh-agent.service @@ -1,5 +1,5 @@ # -# {{@@ env['dotdrop_warning'] @@}} +# {{@@ header() @@}} # [Unit] diff --git a/dotfiles/fehbg b/dotfiles/fehbg index 139f0f3..4d456a0 100755 --- a/dotfiles/fehbg +++ b/dotfiles/fehbg @@ -1,7 +1,7 @@ #!/bin/sh # -# {{@@ env['dotdrop_warning'] @@}} +# {{@@ header() @@}} # 'feh' '--image-bg' 'black' '--bg-center' '{{@@ env['HOME'] @@}}/.config/bspwm/bg.png' diff --git a/dotfiles/local/bin/kite b/dotfiles/local/bin/kite index 97fa38e..fd915da 100755 --- a/dotfiles/local/bin/kite +++ b/dotfiles/local/bin/kite @@ -1,3 +1,7 @@ #!/usr/bin/env zsh -$HOME/.local/share/kite/kited > /dev/null 2>&1 & +# +# {{@@ header() @@}} +# + +{{@@ env['HOME'] @@}}/.local/share/kite/kited > /dev/null 2>&1 & diff --git a/dotfiles/local/share/albert/org.albert.frontend.boxmodel.widgets/themes/bspwm.qss b/dotfiles/local/share/albert/org.albert.frontend.boxmodel.widgets/themes/bspwm.qss index dc3b8a6..fc9114d 100644 --- a/dotfiles/local/share/albert/org.albert.frontend.boxmodel.widgets/themes/bspwm.qss +++ b/dotfiles/local/share/albert/org.albert.frontend.boxmodel.widgets/themes/bspwm.qss @@ -1,6 +1,6 @@ /* * - * {{@@ env['dotdrop_warning'] @@}} + * {{@@ header() @@}} * * This theme was made using Albert theme creator (https://albertlauncher.github.io/docs/theming/themecreator/). * diff --git a/dotfiles/p10k.zsh b/dotfiles/p10k.zsh index 206aa58..e945755 100644 --- a/dotfiles/p10k.zsh +++ b/dotfiles/p10k.zsh @@ -1,5 +1,5 @@ # -# {{@@ env['dotdrop_warning'] @@}} +# {{@@ header() @@}} # # Generated by Powerlevel10k configuration wizard on 2020-08-12 at 12:35 CEST. diff --git a/dotfiles/powerlevel9krc b/dotfiles/powerlevel9krc index b31c735..f13d4cd 100644 --- a/dotfiles/powerlevel9krc +++ b/dotfiles/powerlevel9krc @@ -1,5 +1,5 @@ # -# {{@@ env['dotdrop_warning'] @@}} +# {{@@ header() @@}} # POWERLEVEL9K_MODE='awesome-patched' diff --git a/dotfiles/profile b/dotfiles/profile deleted file mode 100644 index 527c535..0000000 --- a/dotfiles/profile +++ /dev/null @@ -1,16 +0,0 @@ -# -# {{@@ env['dotdrop_warning'] @@}} -# - -# Set XDG_CONFIG_HOME -XDG_CONFIG_HOME="$HOME/.config" -export XDG_CONFIG_HOME -# SSH Agent (KeeAgent) -SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" -export SSH_AUTH_SOCK -# Use vim as editor on X -VISUAL='vim' -export VISUAL -# Use vim as standard editor -EDITOR='vim' -export EDITOR diff --git a/dotfiles/profile_win b/dotfiles/profile_win deleted file mode 100644 index fba3cfc..0000000 --- a/dotfiles/profile_win +++ /dev/null @@ -1,13 +0,0 @@ -# -# {{@@ env['dotdrop_warning'] @@}} -# - -# Use vim as editor on X -VISUAL='vim' -export VISUAL -# Use vim as standard editor -EDITOR='vim' -export EDITOR -# Set DOTNET_ROOT enviroment variable -DOTNET_ROOT=/opt/dotnet -export DOTNET_ROOT diff --git a/dotfiles/start_systemd_shell.sh b/dotfiles/start_systemd_shell.sh index 5b1e528..04016fd 100644 --- a/dotfiles/start_systemd_shell.sh +++ b/dotfiles/start_systemd_shell.sh @@ -1,6 +1,7 @@ #!/usr/bin/env sh + # -# {{@@ env['dotdrop_warning'] @@}} +# {{@@ header() @@}} # export DOTNET_ROOT=/opt/dotnet diff --git a/dotfiles/vim/colors/nord.vim b/dotfiles/vim/colors/nord.vim index 618cd25..e76d00a 100644 --- a/dotfiles/vim/colors/nord.vim +++ b/dotfiles/vim/colors/nord.vim @@ -1,4 +1,4 @@ -" {{@@ env['dotdrop_warning'] @@}} +" {{@@ header() @@}} " Copyright (C) 2016-present Arctic Ice Studio " Copyright (C) 2016-present Sven Greb diff --git a/dotfiles/vim/colors/smyck.vim b/dotfiles/vim/colors/smyck.vim index c161e40..534af49 100755 --- a/dotfiles/vim/colors/smyck.vim +++ b/dotfiles/vim/colors/smyck.vim @@ -1,6 +1,6 @@ " ---------------------------------------------------------------------------- " -" {{@@ env['dotdrop_warning'] @@}} +" {{@@ header() @@}} " " Vim color file " Maintainer: John-Paul Bader diff --git a/dotfiles/vimrc b/dotfiles/vimrc index 35bb6aa..5d656a8 100644 --- a/dotfiles/vimrc +++ b/dotfiles/vimrc @@ -1,5 +1,5 @@ " -" {{@@ env['dotdrop_warning'] @@}} +" {{@@ header() @@}} " " Enable syntaxhightlighting diff --git a/dotfiles/xinitrc b/dotfiles/xinitrc index 0355677..748243a 100644 --- a/dotfiles/xinitrc +++ b/dotfiles/xinitrc @@ -1,36 +1,29 @@ -#!/bin/sh +#!/usr/bin/env bash + # -# {{@@ env['dotdrop_warning'] @@}} +# {{@@ header() @@}} # -userresources=$HOME/.Xresources -usermodmap=$HOME/.Xmodmap +userresources={{@@ env['HOME'] @@}}/.Xresources +usermodmap={{@@ env['HOME'] @@}}/.Xmodmap sysresources=/etc/X11/xinit/.Xresources sysmodmap=/etc/X11/xinit/.Xmodmap # merge in defaults and keymaps -if [ -f $sysresources ]; then - xrdb -merge $sysresources -fi +[[ -f ${sysresources} ]] && xrdb -merge ${sysresources} -if [ -f $sysmodmap ]; then - xmodmap $sysmodmap -fi +[[ -f ${sysmodmap} ]] && xmodmap ${sysmodmap} -if [ -f "$userresources" ]; then - xrdb -merge "$userresources" -fi +[[ -f "${userresources}" ]] && xrdb -merge "${userresources}" -if [ -f "$usermodmap" ]; then - xmodmap "$usermodmap" -fi +[[ -f "${usermodmap}" ]] && xmodmap "${usermodmap}" # start some nice programs if [ -d /etc/X11/xinit/xinitrc.d ] ; then for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do - [ -x "$f" ] && . "$f" + [ -x "${f}" ] && . "${f}" done unset f fi diff --git a/dotfiles/xsession b/dotfiles/xsession index 1190906..7bf3747 100644 --- a/dotfiles/xsession +++ b/dotfiles/xsession @@ -1,6 +1,7 @@ -#!/bin/sh +#!/usr/bin/env bash + # -# {{@@ env['dotdrop_warning'] @@}} +# {{@@ header() @@}} # -/bin/zsh --login -i ~/.xinitrc +/bin/zsh --login -i {{@@ env['HOME'] @@}}/.xinitrc diff --git a/dotfiles/z_profile b/dotfiles/z_profile new file mode 100644 index 0000000..0c5cc39 --- /dev/null +++ b/dotfiles/z_profile @@ -0,0 +1,25 @@ +# +# {{@@ header() @@}} +# + +# Use vim as editor on X +VISUAL='vim' +export VISUAL +# Use vim as standard editor +EDITOR='vim' +export EDITOR + +{%@@ if profile == 'VWAGWOY00349' @@%} +[[ $(command -v /opt/homebrew/bin/brew) ]] && eval "$(/opt/homebrew/bin/brew shellenv)" +{%@@ endif @@%} +[[ $(command -v pyenv) ]] && eval "$(pyenv init --path)" + +{%@@ if profile == 'AINCRAD-wsl' or profile == 'AINCRAD' or profile == 'YOETUNHEIMR-wsl' or profile == 'yoetunheimr' @@%} +# Set DOTNET_ROOT enviroment variable +DOTNET_ROOT=/opt/dotnet +export DOTNET_ROOT + +# Set XDG_CONFIG_HOME +XDG_CONFIG_HOME="{{@@ env['HOME'] @@}}/.config" +export XDG_CONFIG_HOME +{%@@ endif @@%} diff --git a/dotfiles/zprofile_mac b/dotfiles/zprofile_mac deleted file mode 100644 index a33f83e..0000000 --- a/dotfiles/zprofile_mac +++ /dev/null @@ -1,13 +0,0 @@ -# -# {{@@ env['dotdrop_warning'] @@}} -# - -# Use vim as editor on X -VISUAL='vim' -export VISUAL -# Use vim as standard editor -EDITOR='vim' -export EDITOR - -[[ $(command -v /opt/homebrew/bin/brew) ]] && eval "$(/opt/homebrew/bin/brew shellenv)" -[[ $(command -v pyenv) ]] && eval "$(pyenv init --path)" diff --git a/dotfiles/zshenv b/dotfiles/zshenv index 6c8272b..5029ced 100644 --- a/dotfiles/zshenv +++ b/dotfiles/zshenv @@ -1,5 +1,5 @@ # -# {{@@ env['dotdrop_warning'] @@}} +# {{@@ header() @@}} # @@ -7,12 +7,33 @@ export _JAVA_AWT_WM_NONREPARENTING=1 # Disable Ansible cowsay export ANSIBLE_NOCOWS=1 + # Include ~/.bin to PATH -if [ -d "$HOME/.bin" ] ; then - export PATH="$HOME/.bin:$PATH" -fi -# Includ ~/.local/bin to PATH -if [ -d "$HOME/.local/bin" ] ; then - export PATH="$HOME/.local/bin:$PATH" +[[ -d "{{@@ env['HOME'] @@}}/.bin" ]] && export PATH="{{@@ env['HOME'] @@}}/.bin:${PATH}" + +# Include ~/.local/bin to PATH +[[ -d "{{@@ env['HOME'] @@}}/.local/bin" ]] && export PATH="{{@@ env['HOME'] @@}}/.local/bin:${PATH}" + + +{%@@ if profile == 'AINCRAD-wsl' or profile == 'AINCRAD' or profile == 'YOETUNHEIMR-wsl' or profile == 'yoetunheimr' @@%} +# Connect to windows ssh pageant +# https://github.com/BlackReloaded/wsl2-ssh-pageant +export SSH_AUTH_SOCK={{@@ env['HOME'] @@}}/.ssh/agent.sock +ss -a | grep -q $SSH_AUTH_SOCK +if [ $? -ne 0 ]; then + rm -f $SSH_AUTH_SOCK + (setsid nohup socat UNIX-LISTEN:$SSH_AUTH_SOCK,fork EXEC:{{@@ env['HOME'] @@}}/.ssh/wsl2-ssh-pageant.exe >/dev/null 2>&1 &) fi +# Connect to windows gpg agent +# https://github.com/BlackReloaded/wsl2-ssh-pageant +export GPG_AGENT_SOCK={{@@ env['HOME'] @@}}/.gnupg/S.gpg-agent +ss -a | grep -q $GPG_AGENT_SOCK +if [ $? -ne 0 ]; then + rm -rf $GPG_AGENT_SOCK + (setsid nohup socat UNIX-LISTEN:$GPG_AGENT_SOCK,fork EXEC:"{{@@ env['HOME'] @@}}/.ssh/wsl2-ssh-pageant.exe --gpg S.gpg-agent" >/dev/null 2>&1 &) +fi + +# X410 (Windows X11 Server) +export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0 +{%@@ endif @@%} diff --git a/dotfiles/zshenv_win b/dotfiles/zshenv_win deleted file mode 100644 index d23aa25..0000000 --- a/dotfiles/zshenv_win +++ /dev/null @@ -1,44 +0,0 @@ -# -# {{@@ env['dotdrop_warning'] @@}} -# - - -# Fix for JetBrains with non-re-parenting window managers -export _JAVA_AWT_WM_NONREPARENTING=1 -# Disable Ansible cowsay -export ANSIBLE_NOCOWS=1 - -# Include ~/.bin to PATH -if [ -d "${HOME}/.bin" ] ; then - export PATH="${HOME}/.bin:${PATH}" -fi -# Include ~/.local/bin to PATH -if [ -d "${HOME}/.local/bin" ] ; then - export PATH="${HOME}/.local/bin:${PATH}" -fi -# Inclue ~/.krew/bin to PATH for krew kubectl extensions -if [ -d "${HOME}/.krew/bin" ] ; then - export PATH="${HOME}/.krew/bin:${PATH}" -fi - -# Connect to windows ssh pageant -# https://github.com/BlackReloaded/wsl2-ssh-pageant -export SSH_AUTH_SOCK=$HOME/.ssh/agent.sock -ss -a | grep -q $SSH_AUTH_SOCK -if [ $? -ne 0 ]; then - rm -f $SSH_AUTH_SOCK - (setsid nohup socat UNIX-LISTEN:$SSH_AUTH_SOCK,fork EXEC:$HOME/.ssh/wsl2-ssh-pageant.exe >/dev/null 2>&1 &) -fi - -# Connect to windows gpg agent -# https://github.com/BlackReloaded/wsl2-ssh-pageant -export GPG_AGENT_SOCK=$HOME/.gnupg/S.gpg-agent -ss -a | grep -q $GPG_AGENT_SOCK -if [ $? -ne 0 ]; then - rm -rf $GPG_AGENT_SOCK - (setsid nohup socat UNIX-LISTEN:$GPG_AGENT_SOCK,fork EXEC:"$HOME/.ssh/wsl2-ssh-pageant.exe --gpg S.gpg-agent" >/dev/null 2>&1 &) -fi - -# X410 (Windows X11 Server) -export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0 - diff --git a/dotfiles/zshrc b/dotfiles/zshrc index 6c0032f..26e0e95 100644 --- a/dotfiles/zshrc +++ b/dotfiles/zshrc @@ -1,16 +1,26 @@ # -# {{@@ env['dotdrop_warning'] @@}} +# {{@@ header() @@}} # +{%@@ if profile == 'VWAGWOY00349' @@%} +#### FIG ENV VARIABLES #### +# Please make sure this block is at the start of this file. +[ -s {{@@ env['HOME'] @@}}/.fig/shell/pre.sh ] && source {{@@ env['HOME'] @@}}/.fig/shell/pre.sh +#### END FIG ENV VARIABLES #### +{%@@ endif @@%} + # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. # Initialization code that may require console input (password prompts, [y/n] # confirmations, etc.) must go above this block; everything else may go below. -if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then - source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" +if [[ -r "${XDG_CACHE_HOME:-{{@@ env['HOME'] @@}}/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then + source "${XDG_CACHE_HOME:-{{@@ env['HOME'] @@}}/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" fi +# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. +[[ ! -f {{@@ env['HOME'] @@}}/.p10k.zsh ]] || source {{@@ env['HOME'] @@}}/.p10k.zsh + # If you come from bash you might have to change your $PATH. -# export PATH=$HOME/bin:/usr/local/bin:$PATH +# export PATH=${HOME}/bin:/usr/local/bin:$PATH # Path to your oh-my-zsh installation. export ZSH={{@@ env['HOME'] @@}}/.oh-my-zsh @@ -18,10 +28,10 @@ fi # Set name of the theme to load. Optionally, if you set this to "random" # it'll load a random theme each time that oh-my-zsh is loaded. # See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes -if [[ $TERM == 'linux' ]]; then - ZSH_THEME="agnoster" +if [[ ${TERM} == 'linux' ]]; then + ZSH_THEME="agnoster" else - ZSH_THEME="powerlevel10k/powerlevel10k" + ZSH_THEME="powerlevel10k/powerlevel10k" fi # Set list of themes to load @@ -74,26 +84,27 @@ COMPLETION_WAITING_DOTS="true" # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. plugins=( - archlinux - colored-man-pages - cp - git - git-extras - gitignore - kubectl - pip - pyenv - pylint - python - screen - sublime - sudo - systemd - themes - zsh-navigation-tools +{%@@ if profile == 'yoetunheimr' or profile == 'AINCRAD-wsl' or profile == 'AINCRAD' or profile == 'YOETUNHEIMR-wsl' @@%} archlinux +{%@@ endif @@%} colored-man-pages + cp + git + git-extras + gitignore + kubectl + pip + pyenv + pylint + python + screen + sublime + sudo + systemd + themes + vscode + zsh-navigation-tools ) -source $ZSH/oh-my-zsh.sh +source ${ZSH}/oh-my-zsh.sh # User configuration # export MANPATH="/usr/local/man:$MANPATH" @@ -122,27 +133,36 @@ source $ZSH/oh-my-zsh.sh # Example aliases # alias zshconfig="mate ~/.zshrc" # alias ohmyzsh="mate ~/.oh-my-zsh" -alias dotdrop='eval $(grep -v "^#" ~/.files/.env.public) ~/.files/dotdrop.sh' -eval $(thefuck --alias) +[[ -f {{@@ env['HOME'] @@}}/.files/dotdrop.sh ]] && alias dotdrop='eval $(grep -v "^#" {{@@ env['HOME'] @@}}/.files/.env.public) {{@@ env['HOME'] @@}}/.files/dotdrop.sh' +[[ $(command -v thefuck) ]] && eval $(thefuck --alias) +{%@@ if profile == 'AINCRAD-wsl' or profile == 'YOETUNHEIMR-wsl' @@%} # Use https://github.com/jgaa/shinysocks as simple socks5 proxy for windows -alias proxy_kubectl="http_proxy=socks5://$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):1080 https_proxy=socks5://$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):1080 kubectl" -alias pk='proxy_kubectl' +[[ $(command -v kubectl) ]] && alias proxy_kubectl="http_proxy=socks5://$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):1080 https_proxy=socks5://$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):1080 kubectl" +[[ $(command -v kubectl) ]] && alias pk='proxy_kubectl' +{%@@ endif @@%} + +# Initialize pyenv +[[ $(command -v pyenv) ]] && eval "$(pyenv init -)" # Enable pipx completions -if [ -f "$HOME/.local/bin/pipx" ]; then - autoload -U bashcompinit - bashcompinit - eval "$(register-python-argcomplete pipx)" +if [ -f "{{@@ env['HOME'] @@}}/.local/bin/pipx" ]; then + autoload -U bashcompinit + bashcompinit + eval "$(register-python-argcomplete pipx)" fi -# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. -[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh +{%@@ if profile == 'VWAGWOY00349' @@%} +#### FIG ENV VARIABLES #### +# Please make sure this block is at the end of this file. +[ -s {{@@ env['HOME'] @@}}/.fig/fig.sh ] && source {{@@ env['HOME'] @@}}/.fig/fig.sh +#### END FIG ENV VARIABLES #### +{%@@ endif @@%} # Functions (or more complex aliases) wttr() { - if [ -z "$1" ]; then + if [ -z "${1}" ]; then curl http://wttr.in - elif [[ "$1" == "help" ]]; then + elif [[ "${1}" == "help" ]]; then cat << EOF usage: wttr (City|3-letter airport code|'~Special+Location') City: @@ -162,7 +182,6 @@ usage: wttr (City|3-letter airport code|'~Special+Location') wttr '~Kilimanjaro' EOF else - curl http://wttr.in/$1 + curl http://wttr.in/${1} fi } - diff --git a/dotfiles/zshrc_mac b/dotfiles/zshrc_mac deleted file mode 100644 index ea460c2..0000000 --- a/dotfiles/zshrc_mac +++ /dev/null @@ -1,178 +0,0 @@ -# -# {{@@ env['dotdrop_warning'] @@}} -# - -#### FIG ENV VARIABLES #### -# Please make sure this block is at the start of this file. -[ -s ~/.fig/shell/pre.sh ] && source ~/.fig/shell/pre.sh -#### END FIG ENV VARIABLES #### - -# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. -# Initialization code that may require console input (password prompts, [y/n] -# confirmations, etc.) must go above this block; everything else may go below. -if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then - source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" -fi - -# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. -[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh - -# If you come from bash you might have to change your $PATH. -# export PATH=$HOME/bin:/usr/local/bin:$PATH - -# Path to your oh-my-zsh installation. - export ZSH={{@@ env['HOME'] @@}}/.oh-my-zsh - -# Set name of the theme to load. Optionally, if you set this to "random" -# it'll load a random theme each time that oh-my-zsh is loaded. -# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes -if [[ ${TERM} == 'linux' ]]; then - ZSH_THEME="agnoster" -else - ZSH_THEME="powerlevel10k/powerlevel10k" -fi - -# Set list of themes to load -# Setting this variable when ZSH_THEME=random -# cause zsh load theme from this variable instead of -# looking in ~/.oh-my-zsh/themes/ -# An empty array have no effect -# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) - -# Uncomment the following line to use case-sensitive completion. -# CASE_SENSITIVE="true" - -# Uncomment the following line to use hyphen-insensitive completion. Case -# sensitive completion must be off. _ and - will be interchangeable. -# HYPHEN_INSENSITIVE="true" - -# Uncomment the following line to disable bi-weekly auto-update checks. -# DISABLE_AUTO_UPDATE="true" - -# Uncomment the following line to change how often to auto-update (in days). -# export UPDATE_ZSH_DAYS=13 - -# Uncomment the following line to disable colors in ls. -# DISABLE_LS_COLORS="true" - -# Uncomment the following line to disable auto-setting terminal title. -# DISABLE_AUTO_TITLE="true" - -# Uncomment the following line to enable command auto-correction. -# ENABLE_CORRECTION="true" - -# Uncomment the following line to display red dots whilst waiting for completion. -COMPLETION_WAITING_DOTS="true" - -# Uncomment the following line if you want to disable marking untracked files -# under VCS as dirty. This makes repository status check for large repositories -# much, much faster. -# DISABLE_UNTRACKED_FILES_DIRTY="true" - -# Uncomment the following line if you want to change the command execution time -# stamp shown in the history command output. -# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" -# HIST_STAMPS="mm/dd/yyyy" - -# Would you like to use another custom folder than $ZSH/custom? -# ZSH_CUSTOM=/path/to/new-custom-folder - -# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) -# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ -# Example format: plugins=(rails git textmate ruby lighthouse) -# Add wisely, as too many plugins slow down shell startup. -plugins=( - colored-man-pages - cp - git - git-extras - gitignore - kubectl - pip - pyenv - pylint - python - screen - sublime - sudo - systemd - themes - vscode - zsh-navigation-tools -) - -source ${ZSH}/oh-my-zsh.sh - -# User configuration -# export MANPATH="/usr/local/man:$MANPATH" - -# You may need to manually set your language environment -# export LANG=en_US.UTF-8 - -# Preferred editor for local and remote sessions -# if [[ -n $SSH_CONNECTION ]]; then -# export EDITOR='vim' -# else -# export EDITOR='mvim' -# fi - -# Compilation flags -# export ARCHFLAGS="-arch x86_64" - -# ssh -# export SSH_KEY_PATH="~/.ssh/rsa_id" - -# Set personal aliases, overriding those provided by oh-my-zsh libs, -# plugins, and themes. Aliases can be placed here, though oh-my-zsh -# users are encouraged to define aliases within the ZSH_CUSTOM folder. -# For a full list of active aliases, run `alias`. -# -# Example aliases -# alias zshconfig="mate ~/.zshrc" -# alias ohmyzsh="mate ~/.oh-my-zsh" -[[ -f ${HOME}/.files/dotdrop.sh ]] && alias dotdrop='eval $(grep -v "^#" ~/.files/.env.public) ~/.files/dotdrop.sh' -[[ $(command -v thefuck) ]] && eval $(thefuck --alias) - -# Enable pipx completions -if [ -f "${HOME}/.local/bin/pipx" ]; then - autoload -U bashcompinit - bashcompinit - eval "$(register-python-argcomplete pipx)" -fi - -# Initialize pyenv -[[ $(command -v pyenv) ]] && eval "$(pyenv init -)" - -#### FIG ENV VARIABLES #### -# Please make sure this block is at the end of this file. -[ -s ~/.fig/fig.sh ] && source ~/.fig/fig.sh -#### END FIG ENV VARIABLES #### - -# Functions (or more complex aliases) -wttr() { - if [ -z "$1" ]; then - curl http://wttr.in - elif [[ "$1" == "help" ]]; then - cat << EOF -usage: wttr (City|3-letter airport code|'~Special+Location') - City: - Just write down the name of the city. - e.G.: - wttr London - 3-letter airport code: - Use 3-letter airport codes in order to get the weather information at a certain airport. - e.G.: - wttr muc #for Munich Internation Airpot, Germany - Special Location: - Let's say you'd like to get the weather for a geographical location other than a town or city - - maybe an attraction in a city, a mountain name, or some special location. - Add the character '~' before the name to look up that special location name before the weather is then retrieved. - e.G.: - wttr '~Eiffel+Tower' - wttr '~Kilimanjaro' -EOF - else - curl http://wttr.in/$1 - fi -} -