diff --git a/bin/calculator b/bin/calculator index 9c4ea4a..d8257cf 100755 --- a/bin/calculator +++ b/bin/calculator @@ -1,8 +1,8 @@ #!/bin/sh -EXPRESSION=$(printf "" | dmenu -b -w $(xdotool getactivewindow) -p "calculator") -RESULT=$(qalc $EXPRESSION) -printf "" | dmenu -b -w $(xdotool getactivewindow) -p "$RESULT" -echo $RESULT | sed 's/^[^=≈]*[=≈]//' | xclip -selection clipboard +#EXPRESSION=$(printf "" | dmenu -b -w $(xdotool getactivewindow) -p "calculator") +#RESULT=$(qalc $EXPRESSION) +#printf "" | dmenu -b -w $(xdotool getactivewindow) -p "$RESULT" +#echo $RESULT | sed 's/^[^=≈]*[=≈]//' | xclip -selection clipboard # start qalc in terminal instead -#st -i -g 60x30+200+200 -e qalc +st -i -g 60x20-100+100 -e qalc diff --git a/bin/cpuctl b/bin/cpuctl new file mode 100755 index 0000000..d2c2b57 --- /dev/null +++ b/bin/cpuctl @@ -0,0 +1,31 @@ +#!/bin/sh +MIN_FREQUENCY=$(cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_min_freq) +MAX_FREQUENCY=$(cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_max_freq) +SCALING_MAX=$(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq) +SCALING_MIN=$(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq) +GOVERNOR=$(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_governor) + +if [ "$1" = "get" ]; then + echo "Minimum / Maximum Frequencies: $SCALING_MIN / $SCALING_MAX" + echo "Governor: $GOVERNOR" +elif [ "$1" = "set" ]; then + case "$2" in + "") + echo "Set what? Nothing was changed, exiting...";; + "defaults") + echo "$MIN_FREQUENCY" | sudo tee /sys/devices/system/cpu/cpufreq/policy*/scaling_min_freq + echo "$MAX_FREQUENCY" | sudo tee /sys/devices/system/cpu/cpufreq/policy*/scaling_max_freq;; + "minfreq") + echo "$MIN_FREQUENCY" | sudo tee /sys/devices/system/cpu/cpufreq/policy*/scaling_max_freq + echo "$MIN_FREQUENCY" | sudo tee /sys/devices/system/cpu/cpufreq/policy*/scaling_min_freq;; + "maxfreq") + echo "$MAX_FREQUENCY" | sudo tee /sys/devices/system/cpu/cpufreq/policy*/scaling_min_freq + echo "$MAX_FREQUENCY" | sudo tee /sys/devices/system/cpu/cpufreq/policy*/scaling_max_freq;; + "ondemand") + echo "ondemand" | sudo tee /sys/devices/system/cpu/cpufreq/policy*/scaling_governor;; + "schedutil") + echo "schedutil" | sudo tee /sys/devices/system/cpu/cpufreq/policy*/scaling_governor;; + "performance") + echo "performance" | sudo tee /sys/devices/system/cpu/cpufreq/policy*/scaling_governor;; + esac +fi diff --git a/bin/st-cpu b/bin/st-cpu new file mode 100755 index 0000000..3d4e463 --- /dev/null +++ b/bin/st-cpu @@ -0,0 +1,25 @@ +#!/bin/sh +CPUTEMP=$(sensors | grep "Package id 0" | awk '{print $4}' | sed 's/+//;s/\.0//g' ) +#CPUFREQ=$(cat /sys/devices/system/cpu/cpufreq/policy1/scaling_cur_freq) +# +#if [ $CPUFREQ -gt 1000000 ]; then +# CPUFREQ="$(echo "scale=1; $CPUFREQ / 1000000" | bc) GHz" +#else +# CPUFREQ="$(echo "scale=0; $CPUFREQ / 1000" | bc) MHz" +#fi + +# freebsd +#CORETEMPS=$(sysctl dev.cpu | grep temperature | awk '{print $2}' | sed s/.[0-9]C$//g) +# +#CORE_COUNT=0 +#SUM=0 +# +#for temp in $CORETEMPS; do +# SUM=$((SUM + temp)) +# CORE_COUNT=$((CORE_COUNT + 1)) +#done +# +# +#CPUTEMP="$((SUM / CORE_COUNT)) C" + +echo $CPUTEMP