From 4236c85f2076d32dc99828c81715c278f0634446 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Tue, 7 Sep 2021 23:44:05 +0200 Subject: [PATCH] feat: introducing gentoo on ThinkPad --- .config/X11/xprofile | 5 +---- .config/X11/xresources | 8 ++++---- .config/dunst/dunstrc | 2 +- .config/sxhkd/sxhkdrc | 16 +++++++--------- .config/zsh/.zprofile | 7 ++++--- .config/zsh/.zshrc | 6 +++--- .local/bin/statusbar/sb-battery | 9 ++++++--- .local/bin/statusbar/sb-internet | 7 ++++--- .local/bin/statusbar/sb-music | 2 +- .local/bin/statusbar/sb-volume | 15 +++++++++------ .zshenv | 3 --- 11 files changed, 40 insertions(+), 40 deletions(-) diff --git a/.config/X11/xprofile b/.config/X11/xprofile index f644d3e..babd1af 100644 --- a/.config/X11/xprofile +++ b/.config/X11/xprofile @@ -15,9 +15,6 @@ setbg & dwmblocks & xrdb ${XDG_CONFIG_HOME:-$HOME/.config}/X11/xresources -xinput set-prop 'Synaptics TM3072-003' 'libinput Tapping Enabled' 1 & -xinput set-prop 'Synaptics TM3072-003' 'libinput Natural Scrolling Enabled' 1 & -xinput set-prop 'Synaptics TM3072-003' 'libinput Accel Speed' 0.4 & setxkbmap 'fr(oss)' -remaps & +xmodmap "$XDG_CONFIG_HOME/X11/xmodmap" & sxhkd & diff --git a/.config/X11/xresources b/.config/X11/xresources index 46c4727..0c05f37 100644 --- a/.config/X11/xresources +++ b/.config/X11/xresources @@ -1,6 +1,6 @@ !! Set a default font and font size as below: -*.font: Iosevka Fixed Slab:size=12 -*.symbols: Symbols Nerd Font:size=11 +*.font: Fira Code:size=12 +*.symbols: Font Awesome 5 Free:size=11 /* name dark light */ /* black 0 8 */ @@ -37,8 +37,8 @@ *.cursorColor: #ebdbb2 /* st config */ -st.font: Iosevka Fixed Slab:size=14 -st.symbols: Symbols Nerd Font:size=14 +st.font: Fira Code:size=12 +st.symbols: Font Awesome 5 Free:size=12 st.termname: st-256color st.borderpx: 5 diff --git a/.config/dunst/dunstrc b/.config/dunst/dunstrc index d74e571..1020a9e 100644 --- a/.config/dunst/dunstrc +++ b/.config/dunst/dunstrc @@ -1,5 +1,5 @@ [global] -font = Iosevka Fixed Slab 14 +font = Fira Code 12 # Allow a small subset of html markup: # bold diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 7d0d706..4fdf052 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -2,12 +2,13 @@ # System stuff -super + F1 +XF86AudioMute pulsemixer --toggle-mute; audio-notify -super + {F2, F3} + +{XF86AudioLowerVolume, XF86AudioRaiseVolume} pulsemixer --change-volume {-5, +5}; audio-notify -super + {F5, F6} +{XF86MonBrightnessDown, XF86MonBrightnessUp} sbacklight {dec,inc} super + u @@ -17,20 +18,17 @@ super + shift + u dmenuumount super + s - dmenuprompt "suspend?" "systemctl suspend" + dmenuprompt "suspend?" "doas suspend" super + shift + s - dmenuprompt "shutdown?" "shutdown -h now" + dmenuprompt "shutdown?" "doas shutdown -h now" super + shift + r - dmenuprompt "reboot?" "reboot" + dmenuprompt "reboot?" "doas reboot" super + shift + d displayselect -super + F9 - kbacklight - super + shift + o dmenuopen diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile index 10dc4d9..25c2c2e 100644 --- a/.config/zsh/.zprofile +++ b/.config/zsh/.zprofile @@ -3,6 +3,9 @@ # This file is sourced when launching a DM from startx/xinit # environment variables +## path +export PATH="$(find $HOME/.local/bin -type d | tr '\n' ':' | sed 's/:$//'):$PATH" + ## dotfiles export DOTFILES="$HOME/.dotfiles.git" @@ -21,10 +24,8 @@ export TEXMFHOME="$XDG_DATA_HOME/texmf" export CARGO_HOME="$XDG_DATA_HOME/cargo" ## default programs -export SUDO_ASKPASS="$HOME/.local/bin/dmenupass" export GPG_ASKPASS="/usr/bin/pinentry-curses" -export SUDO_EDITOR="nvim" export EDITOR="nvim" export TERMINAL="st" export READER="zathura" -export BROWSER="firefox" +export BROWSER="firefox-bin" diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 8b1c592..d437673 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -39,8 +39,8 @@ bindkey -M menuselect 'j' vi-down-line-or-history bindkey -v '^?' backward-delete-char # Use arrows to search through history -bindkey '^[[A' history-substring-search-up -bindkey '^[[B' history-substring-search-down +#bindkey '^[[A' history-substring-search-up +#bindkey '^[[B' history-substring-search-down # Change cursor shape for different vi modes. function zle-keymap-select { @@ -66,7 +66,7 @@ precmd_dunctions() { zle-line-init ;} # Use beam shape cursor for each new promp [ -f "$HOME/.config/aliasrc" ] && source "$HOME/.config/aliasrc" # Load zsh-history-search -source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh 2>/dev/null +#source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh 2>/dev/null # Load zsh-syntax-highlighting source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2>/dev/null diff --git a/.local/bin/statusbar/sb-battery b/.local/bin/statusbar/sb-battery index 48d7821..f22d2dd 100755 --- a/.local/bin/statusbar/sb-battery +++ b/.local/bin/statusbar/sb-battery @@ -26,15 +26,17 @@ notify() { \ [ 300 -gt $delta ] && return; echo $now > $XDG_CONFIG_HOME/batteryupdate case "$capacity" in - 1[0-9]) notify-send -u "normal" "Battery is running low ($capacity%)" "Please plug your computer to a power source" ;; - [0-9]) notify-send -u "critical" "Battery is dangerously low ($capacity%)" "Please plug your computer to a power source - NOW!" ;; + [2-3][0-9]) notify-send -u "normal" "Battery is running low ($capacity%)" "Please plug your computer to a power source" ;; + *) notify-send -u "critical" "Battery is dangerously low ($capacity%)" "Please plug your computer to a power source - NOW!" ;; esac } +total=0 for bat in /sys/class/power_supply/BAT?/ do status="$(cat "$bat/status")" capacity="$(cat "$bat/capacity")" + total="$(expr $total + $capacity)" if [ "$status" = "Full" ]; then status=" " && capacity="FULL" printf " %s %s " "$status" "$capacity" && exit @@ -46,8 +48,9 @@ do [6-7][0-9]) status="" ;; [4-5][0-9]) status="" ;; [2-3][0-9]) status="" ;; - *) status="" ; notify;; + *) status="" ;; esac fi + [ 40 -gt $total ] && notify; printf " %s %3d%% " "$status" "$capacity"; done && return 0 diff --git a/.local/bin/statusbar/sb-internet b/.local/bin/statusbar/sb-internet index 0b47f56..513fe3d 100755 --- a/.local/bin/statusbar/sb-internet +++ b/.local/bin/statusbar/sb-internet @@ -11,13 +11,14 @@ # Wifi quality percentage and  icon if ethernet is connected. -wifi="$(grep "^\s*w" /proc/net/wireless | awk '{ printf int($3 * 100 / 70) }')" -[ $wifi -ne 0 ] && str="$(printf "直 %3d%%" $wifi)" || str="$(printf "睊")" +ssid="$(wpa_cli status | grep -i ^ssid | sed -e 's/.*=//')" +ip="$(wpa_cli status | grep -i ^ip_address | sed -e 's/.*=//')" +[ -n $ip ] && str="$(printf " %s" $ssid)" || str="$(printf " ---")" eth="$(cat /sys/class/net/eno1/operstate)" if [ "up" = "$eth" ]; then str="$(printf "%s /  " "$str")" fi vpn="$(pidof openvpn)" -[ -n "$vpn" ] && str="$(printf "() %s" "$str")" +[ -n "$vpn" ] && str="$(printf "() %s" "$str")" printf " %s " "$str" diff --git a/.local/bin/statusbar/sb-music b/.local/bin/statusbar/sb-music index 0202cb8..0c64956 100755 --- a/.local/bin/statusbar/sb-music +++ b/.local/bin/statusbar/sb-music @@ -11,7 +11,7 @@ unicode() { sed "s/[‘’]/'/g;s/[“”]/\"/g"; } -format() { sed "s/^volume:n\/a.*//g;/^volume:/d;s/\\&/&/g;s/\\[paused\\].*//g;s/\\[playing\\].*//g"; } +format() { sed "s/^volume:n\/a.*//g;/^volume:/d;s/\\&/&/g;s/\\[paused\\].*//g;s/\\[playing\\].*//g"; } mpc="$(mpc --format "%albumartist% - %title%")" title="$(echo "$mpc" | head -n1 | cut -d'-' -f2 | unicode)" diff --git a/.local/bin/statusbar/sb-volume b/.local/bin/statusbar/sb-volume index b7b0c08..15c5155 100755 --- a/.local/bin/statusbar/sb-volume +++ b/.local/bin/statusbar/sb-volume @@ -9,16 +9,19 @@ # @description : volume block for dwmblocks ###################################################################### -[ "1" = $(pulsemixer --get-mute) ] && echo " 婢 --- " && exit vol="$(pulsemixer --get-volume | awk -F " " '{ printf "%d", $1 }')" -if [ "$vol" -gt "70" ]; then - icon="墳" -elif [ "$vol" -lt "30" ]; then - icon="奄" +if [ "1" = $(pulsemixer --get-mute) ]; then + icon="" else - icon="奔" + if [ "$vol" -gt "70" ]; then + icon="" + elif [ "$vol" -lt "30" ]; then + icon="" + else + icon="" + fi fi printf " %s %3d%% " $icon $vol diff --git a/.zshenv b/.zshenv index ab9145e..5a8faba 100644 --- a/.zshenv +++ b/.zshenv @@ -7,9 +7,6 @@ export XDG_DATA_HOME="$HOME/.local/share" export ZDOTDIR="$HOME/.config/zsh" -## paths -export PATH="$(find $HOME/.local/bin -type d | tr '\n' ':' | sed 's/:$//'):$PATH" - ## misc export LESS_TERMCAP_md="$(printf '%b' '\e[01;32m')" export LESS_TERMCAP_me="$(printf '%b' '\e[0m')"