Fix the merge conflicts

This commit is contained in:
yzenati 2020-10-17 20:37:01 +02:00
commit 8aa94372c3
8 changed files with 66 additions and 6 deletions

View file

@ -1,4 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# setting the locale, some users have issues with different locales, this forces the correct one
export LC_ALL=en_US.UTF-8
linux_acpi() { linux_acpi() {
arg=$1 arg=$1
@ -43,6 +45,10 @@ battery_percent()
echo $(pmset -g batt | grep -Eo '[0-9]?[0-9]?[0-9]%') echo $(pmset -g batt | grep -Eo '[0-9]?[0-9]?[0-9]%')
;; ;;
FreeBSD)
echo $(apm | sed '8,11d' | grep life | awk '{print $4}')
;;
CYGWIN*|MINGW32*|MSYS*|MINGW*) CYGWIN*|MINGW32*|MSYS*|MINGW*)
# leaving empty - TODO - windows compatability # leaving empty - TODO - windows compatability
;; ;;
@ -64,6 +70,10 @@ battery_status()
status=$(pmset -g batt | sed -n 2p | cut -d ';' -f 2) status=$(pmset -g batt | sed -n 2p | cut -d ';' -f 2)
;; ;;
FreeBSD)
status=$(apm | sed '8,11d' | grep Status | awk '{printf $3}')
;;
CYGWIN*|MINGW32*|MSYS*|MINGW*) CYGWIN*|MINGW32*|MSYS*|MINGW*)
# leaving empty - TODO - windows compatability # leaving empty - TODO - windows compatability
;; ;;
@ -72,11 +82,28 @@ battery_status()
;; ;;
esac esac
if [ $status = 'discharging' ] || [ $status = 'Discharging' ]; then case $status in
discharging|Discharging)
echo '' echo ''
else ;;
high)
echo ''
;;
charging)
echo 'AC' echo 'AC'
fi ;;
*)
echo 'AC'
;;
esac
### Old if statements didn't work on BSD, they're probably not POSIX compliant, not sure
# if [ $status = 'discharging' ] || [ $status = 'Discharging' ]; then
# echo ''
# # elif [ $status = 'charging' ]; then # This is needed for FreeBSD AC checking support
# # echo 'AC'
# else
# echo 'AC'
# fi
} }
main() main()

View file

@ -1,4 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# setting the locale, some users have issues with different locales, this forces the correct one
export LC_ALL=en_US.UTF-8
# function for getting the refresh rate # function for getting the refresh rate
get_tmux_option() { get_tmux_option() {

View file

@ -1,4 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# setting the locale, some users have issues with different locales, this forces the correct one
export LC_ALL=en_US.UTF-8
get_tmux_option() { get_tmux_option() {
local option=$1 local option=$1

View file

@ -1,4 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# setting the locale, some users have issues with different locales, this forces the correct one
export LC_ALL=en_US.UTF-8
# function for getting the refresh rate # function for getting the refresh rate
get_tmux_option() { get_tmux_option() {

View file

@ -1,4 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# setting the locale, some users have issues with different locales, this forces the correct one
export LC_ALL=en_US.UTF-8
HOSTS="google.com github.com example.com" HOSTS="google.com github.com example.com"

View file

@ -1,4 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# setting the locale, some users have issues with different locales, this forces the correct one
export LC_ALL=en_US.UTF-8
# function for getting the refresh rate # function for getting the refresh rate
get_tmux_option() { get_tmux_option() {
@ -46,6 +48,25 @@ get_percent()
fi fi
;; ;;
FreeBSD)
# Looked at the code from neofetch
hw_pagesize="$(sysctl -n hw.pagesize)"
mem_inactive="$(($(sysctl -n vm.stats.vm.v_inactive_count) * hw_pagesize))"
mem_unused="$(($(sysctl -n vm.stats.vm.v_free_count) * hw_pagesize))"
mem_cache="$(($(sysctl -n vm.stats.vm.v_cache_count) * hw_pagesize))"
free_mem=$(((mem_inactive + mem_unused + mem_cache) / 1024 / 1024))
total_mem=$(($(sysctl -n hw.physmem) / 1024 / 1024))
used_mem=$((total_mem - free_mem))
echo $used_mem
if (( $used_mem < 1024 )); then
echo $used_mem\M\B/$total_mem
else
memory=$(($used_mem/1024))
echo $memory\G\B/$total_mem
fi
;;
CYGWIN*|MINGW32*|MSYS*|MINGW*) CYGWIN*|MINGW32*|MSYS*|MINGW*)
# TODO - windows compatability # TODO - windows compatability
;; ;;

View file

@ -1,4 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# setting the locale, some users have issues with different locales, this forces the correct one
export LC_ALL=en_US.UTF-8
#wrapper script for running weather on interval #wrapper script for running weather on interval

View file

@ -1,4 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# setting the locale, some users have issues with different locales, this forces the correct one
export LC_ALL=en_US.UTF-8
fahrenheit=$1 fahrenheit=$1
location=$2 location=$2