Skip to content

Commit

Permalink
change to [[double brackets]], preferred for BASH compatability
Browse files Browse the repository at this point in the history
  • Loading branch information
wick3dr0se committed Nov 24, 2021
1 parent 2ad68d3 commit 666fa88
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion components/cpu_gpu.sh
Expand Up @@ -13,7 +13,7 @@ fi


# get cpu frequency if /sys/devices/system/cpu exist
if test -e /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq ; then
if [[ -e /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq ]] ; then
max_cpu=$(head /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq | sed 's/......$/.&/;s/....$//' | tr -d '\n')
scal_cpu=$(head /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq | sed 's/......$/.&/;s/.....$//' | tr -d '\n')
echo -ne "${CYAN}$max_cpu${NC}"
Expand Down
2 changes: 1 addition & 1 deletion components/de-wm_theme.sh
Expand Up @@ -2,7 +2,7 @@

# // DE/WM // if file exist print 'DesktopNames'
echo -ne "${YELLOW}de/wm${NC} ~ "
if test -e /usr/share/xsession/ ; then
if [[ -e /usr/share/xsession/ ]] ; then
head /usr/share/xsessions/* | grep -im1 'names=' | sed 's/DesktopNames=//' | tr -d '\n'
elif test -e /usr/share/wayland-sessions/ ; then
head /usr/share/wayland-sessions/* | grep -im1 'name=' | sed 's/name=//gi' | sort -u | sed ':a;N;$!ba;s/\n/, /gi' | tr -d '\n'
Expand Down
11 changes: 5 additions & 6 deletions components/term_shell.sh
Expand Up @@ -3,15 +3,14 @@

# // TERM // get terminal name w/ pstree
shell="$(echo $SHELL | sed 's%.*/%%')"
if [ `command -v pstree` ] ; then
term="$(pstree -sA $$)"; term="$(echo ${term%%---${shell}*})"; term="$(echo ${term##*---})"
term="$(pstree -sA $$)"; term="$(echo ${term%%---${shell}*})"; term="$(echo ${term##*---})"
if [[ $(command -v pstree) ]] ; then
echo -ne "${GREEN}term${NC} ~ "
echo $term | tr -d '\n'
else
echo $TERM
echo $TERM
fi

echo -ne "${GREEN}term${NC} ~ "
echo $term | tr -d "\n"


# // SHELL // echo '$SHELL' enviornment variable
echo -ne " \e \e \e \e "
Expand Down
8 changes: 0 additions & 8 deletions components/test.sh

This file was deleted.

0 comments on commit 666fa88

Please sign in to comment.