1
0
Fork 0

carrying over changes

This commit is contained in:
Luca Bilke 2022-09-15 20:27:44 +02:00
parent de6180f813
commit c8024f3d41
19 changed files with 148 additions and 166 deletions

View File

@ -86,7 +86,7 @@ cmd rsyncto ${{
clear; echo "rsync to where?" clear; echo "rsync to where?"
read dest read dest
for x in $fx; do for x in $fx; do
eval rsync -aAXHv \"$x\" \"$dest\" eval rsync -aAXHv \"$x\" \"$dest\"
done && done &&
notify-send "File(s) rsynced." "File(s) copies to $dest." notify-send "File(s) rsynced." "File(s) copies to $dest."
}} }}
@ -121,8 +121,6 @@ cmd git_branch ${{
lf -remote "send $id cd \"$pwd_shell\"" lf -remote "send $id cd \"$pwd_shell\""
}} }}
cmd on-cd &{{ cmd on-cd &{{
DIR=$(echo $PWD | sed "s|$HOME|~|") DIR=$(echo $PWD | sed "s|$HOME|~|")
printf "\033]0; $DIR\007" > /dev/tty printf "\033]0; $DIR\007" > /dev/tty
@ -134,23 +132,23 @@ cmd on-quit ${{
printf "\033]0; $DIR\007" > /dev/tty printf "\033]0; $DIR\007" > /dev/tty
}} }}
# cmd paste &{{ cmd paste &{{
# set -- $(cat ~/.local/share/lf/files) set -- $(cat ~/.local/share/lf/files)
# mode="$1" mode="$1"
# shift shift
# case "$mode" in case "$mode" in
# copy) copy)
# rsync -av --ignore-existing --progress -- "$@" . | rsync -av --ignore-existing --progress -- "$@" . |
# stdbuf -i0 -o0 -e0 tr '\r' '\n' | stdbuf -i0 -o0 -e0 tr '\r' '\n' |
# while IFS= read -r line; do while IFS= read -r line; do
# lf -remote "send $id echo $line" lf -remote "send $id echo $line"
# done done
# ;; ;;
# move) mv -n -- "$@" .;; move) mv -n -- "$@" .;;
# esac esac
# rm ~/.local/share/lf/files rm ~/.local/share/lf/files
# lf -remote "send clear" lf -remote "send clear"
# }} }}
cmd share $curl -F"file=@$fx" https://0x0.snaile.de | xclip -r -selection c cmd share $curl -F"file=@$fx" https://0x0.snaile.de | xclip -r -selection c
@ -179,6 +177,7 @@ map I push A<a-b> # after extension
map i push A<a-b><a-b><a-f> # before extension map i push A<a-b><a-b><a-f> # before extension
map c push A<c-u> # new rename map c push A<c-u> # new rename
map B bulkrename map B bulkrename
map b $cp "$f" "$f-COPY"
# Kitty Specific # Kitty Specific
map W $setsid -f $TERMINAL -e lf >/dev/null 2>&1 map W $setsid -f $TERMINAL -e lf >/dev/null 2>&1

View File

@ -2,12 +2,11 @@ map Ch cd "/home/luca"
map Cch cd "/home/luca/.cache" map Cch cd "/home/luca/.cache"
map Ccf cd "/home/luca/.config" map Ccf cd "/home/luca/.config"
map Cdt cd "/home/luca/.local/share" map Cdt cd "/home/luca/.local/share"
map Crr cd "/home/luca/.local/git" map Crr cd "/home/luca/.local/src"
map Csc cd "/home/luca/.local/bin" map Csc cd "/home/luca/.local/bin"
map Cmn cd "/mnt" map Cmn cd "/mnt"
map Cdl cd "/home/luca/Downloads" map Cdl cd "/home/luca/Downloads"
map Cdm cd "/home/luca/Documents" map Cdm cd "/home/luca/Documents"
map Cco cd "/home/luca/Documents/Code"
map Cms cd "/home/luca/Music" map Cms cd "/home/luca/Music"
map Cpc cd "/home/luca/Pictures" map Cpc cd "/home/luca/Pictures"
map Cvd cd "/home/luca/Videos" map Cvd cd "/home/luca/Videos"

View File

@ -5,11 +5,11 @@ shadow-opacity = 0.6;
shadow-offset-x = -12; shadow-offset-x = -12;
shadow-offset-y = -10; shadow-offset-y = -10;
shadow-exclude = [ shadow-exclude = [
"x = 10 && y = 10 && override_redirect = true", "x = 0 && y = 0 && override_redirect = true",
"class_g *= 'slop'", "class_g *= 'slop'",
"_GTK_FRAME_EXTENTS@:c", "_GTK_FRAME_EXTENTS@:c",
"_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'", "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'",
"class_g = 'librewolf' && argb", "class_g = 'librewolf-default' && argb"
]; ];
# Fading # Fading
@ -32,21 +32,12 @@ blur-background-frame = true;
blur-kern = "3x3box"; blur-kern = "3x3box";
blur-strength = 4; blur-strength = 4;
blur-background-exclude = [ blur-background-exclude = [
"class_g *= 'slop'", "class_g *= 'slop'",
"_GTK_FRAME_EXTENTS@:c", "_GTK_FRAME_EXTENTS@:c",
"_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'", "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'",
"class_g = 'librewolf' && argb", "class_g = 'librewolf-default' && argb"
]; ];
# Window type settings
wintypes:
{
menu = { shadow = false; blur-background = false; };
dropdown_menu = { shadow = false; blur-background = false; };
popup_menu = { shadow = false; blur-background = false; };
utility = { shadow = false; blur-background = false; };
};
# Other # Other
backend = "glx"; backend = "glx";
experimental-backends = true; experimental-backends = true;

View File

@ -5,38 +5,38 @@
# sudo not required for some system commands # sudo not required for some system commands
for command in mount umount sv pacman apt updatedb su shutdown poweroff reboot ; do for command in mount umount sv pacman apt updatedb su shutdown poweroff reboot ; do
alias $command="sudo $command" alias $command="sudo $command"
done; unset command done; unset command
# Verbosity and settings that you pretty much just always are going to want. # Verbosity and settings that you pretty much just always are going to want.
alias \ alias \
cp="cp -iv" \ cp="cp -iv" \
mv="mv -iv" \ mv="mv -iv" \
rm="rm -vI" \ rm="rm -vI" \
bc="bc -ql" \ bc="bc -ql" \
mkd="mkdir -pv" \ mkd="mkdir -pv" \
ffmpeg="ffmpeg -hide_banner" \ ffmpeg="ffmpeg -hide_banner" \
exa="exa -abghHliS" \ exa="exa -abghHliS" \
duf="duf -all" \ duf="duf -all" \
ls="ls -hN --color=auto --group-directories-first" \ ls="ls -hN --color=auto --group-directories-first" \
grep="grep --color=auto" \ grep="grep --color=auto" \
diff="diff --color=auto" \ diff="diff --color=auto" \
# Colorize commands when possible. # Colorize commands when possible.
alias \ alias \
ls="ls -hN --color=auto --group-directories-first" \ ls="ls -hN --color=auto --group-directories-first" \
grep="grep --color=auto" \ grep="grep --color=auto" \
diff="diff --color=auto" \ diff="diff --color=auto" \
ccat="highlight --out-format=ansi" \ ccat="highlight --out-format=ansi" \
ip="ip -color=auto" ip="ip -color=auto"
# These common commands are just too long! Abbreviate them. # These common commands are just too long! Abbreviate them.
alias \ alias \
ka="killall" \ ka="killall" \
e="$EDITOR" \ e="$EDITOR" \
z="zathura" \ z="zathura" \
p="pacman" \ p="pacman" \
ar="apt remove" \ ar="apt remove" \
are="apt reinstall" \ are="apt reinstall" \
ai="apt install" \ ai="apt install" \
@ -45,10 +45,10 @@ alias \
# Misc. # Misc.
alias \ alias \
ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" \ ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" \
weath="less -S ${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport" \ weath="less -S ${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport" \
remvirt="virt-manager -c 'qemu+ssh://luca@192.168.178.200/system'" \ remvirt="virt-manager -c 'qemu+ssh://luca@192.168.178.200/system'" \
vim="lvim" \ vim="lvim" \
wikidown='rclone sync cloud:files/luca/Notes ~/Documents/vimwiki' \ wikidown='rclone sync cloud:files/luca/Notes ~/Documents/vimwiki' \
wikiup='rclone sync ~/Documents/vimwiki cloud:files/luca/Notes' \ wikiup='rclone sync ~/Documents/vimwiki cloud:files/luca/Notes' \
cam="mpv --untimed --no-cache --no-osc --no-input-default-bindings --profile=low-latency --input-conf=/dev/null --title=webcam $(ls /dev/video[0,2,4,6,8] | tail -n 1)" \ cam="mpv --untimed --no-cache --no-osc --no-input-default-bindings --profile=low-latency --input-conf=/dev/null --title=webcam $(ls /dev/video[0,2,4,6,8] | tail -n 1)" \

View File

@ -3,12 +3,11 @@ h $HOME
ch ${XDG_CACHE_HOME:-$HOME/.cache} ch ${XDG_CACHE_HOME:-$HOME/.cache}
cf ${XDG_CONFIG_HOME:-$HOME/.config} cf ${XDG_CONFIG_HOME:-$HOME/.config}
dt ${XDG_DATA_HOME:-$HOME/.local/share} dt ${XDG_DATA_HOME:-$HOME/.local/share}
rr $HOME/.local/git rr $HOME/.local/src
sc $HOME/.local/bin sc $HOME/.local/bin
mn /mnt mn /mnt
dl ${XDG_DOWNLOAD_DIR:-$HOME/Downloads} dl ${XDG_DOWNLOAD_DIR:-$HOME/Downloads}
dm ${XDG_DOCUMENTS_DIR:-$HOME/Documents} dm ${XDG_DOCUMENTS_DIR:-$HOME/Documents}
co ${XDG_DOCUMENTS_DIR:-$HOME/Documents}/Code
ms ${XDG_MUSIC_DIR:-$HOME/Music} ms ${XDG_MUSIC_DIR:-$HOME/Music}
pc ${XDG_PICTURES_DIR:-$HOME/Pictures} pc ${XDG_PICTURES_DIR:-$HOME/Pictures}
vd ${XDG_VIDEOS_DIR:-$HOME/Videos} vd ${XDG_VIDEOS_DIR:-$HOME/Videos}

View File

@ -1,23 +1,23 @@
# These files automatically update when edited/saved in vim: # These files automatically update when edited/saved in vim:
# keys filename description # keys filename description
bf ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-files # This file, a list of bookmarked files bf ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-files # This file, a list of bookmarked files
bd ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs # A list of bookmarked directories similar to this file bd ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs # A list of bookmarked directories similar to this file
cfx ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources # Colors, themes and variables for X11 cfx ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources # Colors, themes and variables for X11
cfb ${XDG_HOME:-$HOME}/.local/src/dwmblocks/config.h # dwmblocks: the status bar for dwm cfb ${XDG_HOME:-$HOME}/.local/src/dwmblocks/config.h # dwmblocks: the status bar for dwm
# These do not update automatically, but on the next new instance of a program: # These do not update automatically, but on the next new instance of a program:
cfv ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/init.vim # vim/neovim config cfv ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/init.vim # vim/neovim config
cfz $ZDOTDIR/.zshrc # zsh (shell) config cfz $ZDOTDIR/.zshrc # zsh (shell) config
cfa ${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc # aliases used by zsh (and potentially other shells) cfa ${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc # aliases used by zsh (and potentially other shells)
cfp ${XDG_CONFIG_HOME:-$HOME/.config}/shell/profile # profile file for login settings for zsh cfp ${XDG_CONFIG_HOME:-$HOME/.config}/shell/profile # profile file for login settings for zsh
cfm ${XDG_CONFIG_HOME:-$HOME/.config}/mutt/muttrc # mutt (email client) config cfm ${XDG_CONFIG_HOME:-$HOME/.config}/mutt/muttrc # mutt (email client) config
cfn ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/config # newsboat (RSS reader) cfn ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/config # newsboat (RSS reader)
cfu ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/urls # RSS urls for newsboat cfu ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/urls # RSS urls for newsboat
cfmb ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/bindings # ncmpcpp (music player) keybinds file cfmb ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/bindings # ncmpcpp (music player) keybinds file
cfmc ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/config # ncmpcpp (music player) config cfmc ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/config # ncmpcpp (music player) config
cfl ${XDG_CONFIG_HOME:-$HOME/.config}/lf/lfrc # lf (file browser) config cfl ${XDG_CONFIG_HOME:-$HOME/.config}/lf/lfrc # lf (file browser) config
cfL ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope # lf's scope/preview file cfL ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope # lf's scope/preview file
cfX ${XDG_CONFIG_HOME:-$HOME/.config}/sxiv/exec/key-handler # sxiv (image viewer) key/script handler cfX ${XDG_CONFIG_HOME:-$HOME/.config}/sxiv/exec/key-handler # sxiv (image viewer) key/script handler

View File

@ -235,6 +235,5 @@ ex=:\
[ "$(tty)" = "/dev/tty1" ] && ! pidof -s Xorg >/dev/null 2>&1 && exec startx "$XINITRC" [ "$(tty)" = "/dev/tty1" ] && ! pidof -s Xorg >/dev/null 2>&1 && exec startx "$XINITRC"
[ ! -f ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ] && setsid shortcuts >/dev/null 2>&1 [ ! -f ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ] && setsid shortcuts >/dev/null 2>&1
sudo -n loadkeys ${XDG_DATA_HOME:-$HOME/.local/share}/ttymaps.kmap 2>/dev/null # sudo -n loadkeys ${XDG_DATA_HOME:-$HOME/.local/share}/ttymaps.kmap 2>/dev/null

View File

@ -3,12 +3,11 @@ alias h="cd /home/luca && tput cuu1;tput el" \
ch="cd /home/luca/.cache && tput cuu1;tput el" \ ch="cd /home/luca/.cache && tput cuu1;tput el" \
cf="cd /home/luca/.config && tput cuu1;tput el" \ cf="cd /home/luca/.config && tput cuu1;tput el" \
dt="cd /home/luca/.local/share && tput cuu1;tput el" \ dt="cd /home/luca/.local/share && tput cuu1;tput el" \
rr="cd /home/luca/.local/git && tput cuu1;tput el" \ rr="cd /home/luca/.local/src && tput cuu1;tput el" \
sc="cd /home/luca/.local/bin && tput cuu1;tput el" \ sc="cd /home/luca/.local/bin && tput cuu1;tput el" \
mn="cd /mnt && tput cuu1;tput el" \ mn="cd /mnt && tput cuu1;tput el" \
dl="cd /home/luca/Downloads && tput cuu1;tput el" \ dl="cd /home/luca/Downloads && tput cuu1;tput el" \
dm="cd /home/luca/Documents && tput cuu1;tput el" \ dm="cd /home/luca/Documents && tput cuu1;tput el" \
co="cd /home/luca/Documents/Code && tput cuu1;tput el" \
ms="cd /home/luca/Music && tput cuu1;tput el" \ ms="cd /home/luca/Music && tput cuu1;tput el" \
pc="cd /home/luca/Pictures && tput cuu1;tput el" \ pc="cd /home/luca/Pictures && tput cuu1;tput el" \
vd="cd /home/luca/Videos && tput cuu1;tput el" \ vd="cd /home/luca/Videos && tput cuu1;tput el" \

View File

@ -2,12 +2,11 @@ hash -d h=/home/luca
hash -d ch=/home/luca/.cache hash -d ch=/home/luca/.cache
hash -d cf=/home/luca/.config hash -d cf=/home/luca/.config
hash -d dt=/home/luca/.local/share hash -d dt=/home/luca/.local/share
hash -d rr=/home/luca/.local/git hash -d rr=/home/luca/.local/src
hash -d sc=/home/luca/.local/bin hash -d sc=/home/luca/.local/bin
hash -d mn=/mnt hash -d mn=/mnt
hash -d dl=/home/luca/Downloads hash -d dl=/home/luca/Downloads
hash -d dm=/home/luca/Documents hash -d dm=/home/luca/Documents
hash -d co=/home/luca/Documents/Code
hash -d ms=/home/luca/Music hash -d ms=/home/luca/Music
hash -d pc=/home/luca/Pictures hash -d pc=/home/luca/Pictures
hash -d vd=/home/luca/Videos hash -d vd=/home/luca/Videos

View File

@ -13,51 +13,3 @@ if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/x11/xprofile" ]; then
else else
. "$HOME/.xprofile" . "$HOME/.xprofile"
fi fi
# Start gpg-agent if not already running
if ! pgrep -x -u "${USER}" gpg-agent 1> /dev/null 2>&1; then
gpg-connect-agent /bye 1> /dev/null 2>&1
fi
# Set SSH to use gpg-agent (see 'man gpg-agent', section EXAMPLES)
unset SSH_AGENT_PID
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
# export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh"
SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
export SSH_AUTH_SOCK
fi
# Set GPG TTY as stated in 'man gpg-agent'
GPG_TTY="$(tty)"
export GPG_TTY
# Refresh gpg-agent tty
gpg-connect-agent updatestartuptty /bye > /dev/null
export XSECURELOCK_AUTH_BACKGROUND_COLOR="#24283b"
export XSECURELOCK_AUTH_FOREGROUND_COLOR="#c0caf5"
export XSECURELOCK_AUTH_WARNING_COLOR="#f7768e"
export XSECURELOCK_BACKGROUND_COLOR="#15161E"
export XSECURELOCK_DATETIME_FORMAT="%d.%m.%Y %H:%M"
export XSECURELOCK_PASSWORD_PROMPT="time_hex"
export XSECURELOCK_AUTH_TIMEOUT=10
export XSECURELOCK_SHOW_DATETIME=1
export XSECURELOCK_SAVER="saver_xscreensaver"
export XSECURELOCK_COMPOSITE_OBSCURER=0
xset s 300
xss-lock -- xsecurelock &
# Set GPU settings
# gwe --hide-window &
xset r rate 300 50
killall xcape 2>/dev/null ; xcape -e 'Super_L=Escape'
xset -q | grep "Caps Lock:\s*on" && xdotool key Caps_Lock
setxkbmap -layout de -variant nodeadkeys -option caps:super
setsid -f dwmblocks
setsid -f picom --experimental-backends
# Start Console TDM
exec dwm

View File

@ -5,11 +5,57 @@ xrandr --dpi 109 --fb 4480x1633 \
setbg & # set the background with the `setbg` script setbg & # set the background with the `setbg` script
xrdb ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources & xrdbpid=$! # Uncomment to use Xresources colors/settings on startup xrdb ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources & xrdbpid=$! # Uncomment to use Xresources colors/settings on startup
autostart="checkup mpd dunst unclutter pipewire" autostart="checkup mpd dunst unclutter pipewire dwmblocks"
for program in $autostart; do for program in $autostart; do
pidof -s "$program" || "$program" & pidof -s "$program" || "$program" &
done >/dev/null 2>&1 done >/dev/null 2>&1
pidof -s "picom" || picom --experimental-backends &
# Ensure that xrdb has finished running before moving on to start the WM/DE. # Ensure that xrdb has finished running before moving on to start the WM/DE.
[ -n "$xrdbpid" ] && wait "$xrdbpid" [ -n "$xrdbpid" ] && wait "$xrdbpid"
# Start gpg-agent if not already running
if ! pgrep -x -u "${USER}" gpg-agent 1> /dev/null 2>&1; then
gpg-connect-agent /bye 1> /dev/null 2>&1
fi
# Set SSH to use gpg-agent (see 'man gpg-agent', section EXAMPLES)
unset SSH_AGENT_PID
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
# export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh"
SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
export SSH_AUTH_SOCK
fi
# Set GPG TTY as stated in 'man gpg-agent'
GPG_TTY="$(tty)"
export GPG_TTY
# Refresh gpg-agent tty
gpg-connect-agent updatestartuptty /bye > /dev/null
export XSECURELOCK_AUTH_BACKGROUND_COLOR="#24283b"
export XSECURELOCK_AUTH_FOREGROUND_COLOR="#c0caf5"
export XSECURELOCK_AUTH_WARNING_COLOR="#f7768e"
export XSECURELOCK_BACKGROUND_COLOR="#15161E"
export XSECURELOCK_DATETIME_FORMAT="%d.%m.%Y %H:%M"
export XSECURELOCK_PASSWORD_PROMPT="time_hex"
export XSECURELOCK_AUTH_TIMEOUT=10
export XSECURELOCK_SHOW_DATETIME=1
export XSECURELOCK_SAVER="saver_xscreensaver"
export XSECURELOCK_COMPOSITE_OBSCURER=0
xset s 300
xss-lock -- xsecurelock &
# Set GPU settings
# gwe --hide-window &
xset r rate 300 50
killall xcape 2>/dev/null ; xcape -e 'Super_L=Escape'
xset -q | grep "Caps Lock:\s*on" && xdotool key Caps_Lock
setxkbmap -layout de -variant nodeadkeys -option caps:super
# Start Console TDM
exec dwm

View File

@ -9,7 +9,11 @@ Xcursor.theme: Fluent-dark-cursors
!! DWM Settings !! DWM Settings
dwm.bordernorm: #1D202F dwm.bordernorm: #1D202F
dwm.bordersel: #414868 dwm.bordersel: #414868;
dwm.font: NotoSans Nerd Font:style=Regular:pixelsize=14:antialias=true;
!! dmenu settings
dmenu.font: NotoSans Nerd Font:style=Regular:pixelsize=14:antialias=true;
/* name dark light */ /* name dark light */
/* black 0 8 */ /* black 0 8 */

View File

@ -1,12 +0,0 @@
#!/bin/sh
# Some optional functions in LARBS require programs not installed by default. I
# use this little script to check to see if a command exists and if it doesn't
# it informs the user that they need that command to continue. This is used in
# various other scripts for clarity's sake.
for x in "$@"; do
if ! which "$x" >/dev/null 2>&1 && ! pacman -Qq "$x" >/dev/null 2>&1; then
notify-send " $x" "must be installed for this function." && exit 1 ;
fi
done

View File

@ -15,4 +15,4 @@ case "$clock" in
"11") icon="" ;; "11") icon="" ;;
"12") icon="" ;; "12") icon="" ;;
esac esac
printf "%s \033[11m%s\033[10m %s\n" "$(date "+%H:%M")" "$icon" "$(date "+%d.%M.%Y")" printf "%s \033[11m%s\033[10m %s\n" "$(date "+%H:%M")" "$icon" "$(date "+%d.%m.%Y")"

View File

@ -12,14 +12,14 @@ echo "$stats" | while read -r row; do
case "$(echo "$old" | awk '{if ($1 == id) case "$(echo "$old" | awk '{if ($1 == id)
printf "%d\n", (1 - (idle - $3) / (total - $2))*100 /12.5}' \ printf "%d\n", (1 - (idle - $3) / (total - $2))*100 /12.5}' \
id="$id" total="$total" idle="$idle")" in id="$id" total="$total" idle="$idle")" in
"0") printf "\033[32m▁\033[0m";; "0") printf "\033[32m▁";;
"1") printf "\033[32m▂\033[0m";; "1") printf "\033[32m▂";;
"2") printf "\033[32m▃\033[0m";; "2") printf "\033[32m▃";;
"3") printf "\033[33m▄\033[0m";; "3") printf "\033[33m▄";;
"4") printf "\033[33m▅\033[0m";; "4") printf "\033[33m▅";;
"5") printf "\033[33m▆\033[0m";; "5") printf "\033[33m▆";;
"6"|"7"|"8") printf "\033[31m▇\033[0m";; "6"|"7"|"8") printf "\033[31m▇";;
esac esac
done; printf "\\n" done; printf "\033[0m\\n"
echo "$stats" > "$cache" echo "$stats" > "$cache"

View File

@ -1,7 +1,13 @@
#!/bin/sh #!/bin/sh
big="\033[11m"
norm="\033[10m"
if grep -xq 'up' /sys/class/net/w*/operstate 2>/dev/null ; then if grep -xq 'up' /sys/class/net/w*/operstate 2>/dev/null ; then
wifiicon="$(awk '/^\s*w/ { print "直", int($3 * 100 / 70) "% " }' /proc/net/wireless)" percent="$(cat /proc/net/wireless | tail -1 | tr -s ' ' | cut -d ' ' -f3 | sed 's/\.//')"
wifi_icon="直"
elif grep -xq 'down' /sys/class/net/w*/operstate 2>/dev/null ; then elif grep -xq 'down' /sys/class/net/w*/operstate 2>/dev/null ; then
grep -xq '0x1003' /sys/class/net/w*/flags && wifiicon="睊" || wifiicon="" grep -xq '0x1003' /sys/class/net/w*/flags && wifi_icon="睊" || wifi_icon=""
fi fi
printf "%s%s%s%s\n" "$wifiicon" "$(sed "s/down/ /;s/up/ /" /sys/class/net/e*/operstate 2>/dev/null)" "$(sed "s/.*/嬨/" /sys/class/net/tun*/operstate 2>/dev/null)" "$(ip route get 8.8.8.8 | sed 's/.*src \([^ ]*\).*/\1/;t;d')"
ls /sys/class/net/tun* 1>/dev/null 2>&1 && vpn_icon="$(sed "s/.*/嬨/" /sys/class/net/tun*/operstate 2>/dev/null)" || vpn_icon=""
printf "$big%s$norm %s $big%s%s$norm" "$wifi_icon" " $percent" "$(sed "s/down//;s/up//" /sys/class/net/e*/operstate 2>/dev/null | tr "\n" " " | xargs echo -n)" "$vpn_icon"

6
.local/bin/statusbar/sb-ip Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
# https://www.maketecheasier.com/ip-address-geolocation-lookups-linux/
loc_addr="$(ip route get 9.9.9.9 | head -1 | cut -d ' ' -f3)"
pub_addr="$(curl snaile.de/ip 2>/dev/null)" || exit
flag="$(grep "flag: " "${XDG_DATA_HOME:-$HOME/.local/share}/emoji" | grep "$(geoiplookup "$addr" | sed 's/.*, //')" | sed 's/ flag: .*//')"
printf "%s %s" $loc_addr $pub_addr

View File

@ -1,5 +0,0 @@
#!/bin/sh
# https://www.maketecheasier.com/ip-address-geolocation-lookups-linux/
ifinstalled "geoip" || exit
addr="$(curl snaile.de/ip 2>/dev/null)" || exit
grep "flag: " "${XDG_DATA_HOME:-$HOME/.local/share}/larbs/emoji" | grep "$(geoiplookup "$addr" | sed 's/.*, //')" | sed "s/flag: //;s/;.*//"

View File

@ -12,6 +12,6 @@ elif [ "$vol" -gt "0" ]; then
elif [ "$vol" -eq "0" ]; then elif [ "$vol" -eq "0" ]; then
icon="" icon=""
else else
echo " \033[11m\033[10m  " && exit echo "\033[11m\033[10m " && exit
fi fi
printf "\033[11m%s\033[10m %s" "$icon" "$vol" printf "\033[11m%s\033[10m %s" "$icon" "$vol"