diff options
author | Jakob Stendahl <jakob.stendahl@outlook.com> | 2021-09-04 12:04:53 +0200 |
---|---|---|
committer | Jakob Stendahl <jakob.stendahl@outlook.com> | 2021-09-04 12:04:53 +0200 |
commit | 65b7f91e51d90e93c3d7c6704c0a8265467a8ea7 (patch) | |
tree | 88301071c7f1840b502f33cbd3b0f7c5e81b0c66 /Common/rofi/bin | |
parent | a77563ee1044ffa03f7c49e457a5f7c9f943188f (diff) | |
parent | e6df7072ab32493a561fc678eacc119b57981827 (diff) | |
download | dotfiles-65b7f91e51d90e93c3d7c6704c0a8265467a8ea7.tar.gz dotfiles-65b7f91e51d90e93c3d7c6704c0a8265467a8ea7.zip |
Merge branch 'master' of https://github.com/JakobS1n/dotfiles
Diffstat (limited to 'Common/rofi/bin')
35 files changed, 105 insertions, 0 deletions
diff --git a/Common/rofi/bin/android_apps b/Common/rofi/bin/android_apps new file mode 120000 index 0000000..7b11b66 --- /dev/null +++ b/Common/rofi/bin/android_apps @@ -0,0 +1 @@ +../applets/android/apps.sh
\ No newline at end of file diff --git a/Common/rofi/bin/android_backlight b/Common/rofi/bin/android_backlight new file mode 120000 index 0000000..9de32b8 --- /dev/null +++ b/Common/rofi/bin/android_backlight @@ -0,0 +1 @@ +../applets/android/backlight.sh
\ No newline at end of file diff --git a/Common/rofi/bin/android_mpd b/Common/rofi/bin/android_mpd new file mode 120000 index 0000000..1f16126 --- /dev/null +++ b/Common/rofi/bin/android_mpd @@ -0,0 +1 @@ +../applets/android/mpd.sh
\ No newline at end of file diff --git a/Common/rofi/bin/android_powermenu b/Common/rofi/bin/android_powermenu new file mode 120000 index 0000000..7d66a76 --- /dev/null +++ b/Common/rofi/bin/android_powermenu @@ -0,0 +1 @@ +../applets/android/powermenu.sh
\ No newline at end of file diff --git a/Common/rofi/bin/android_quicklinks b/Common/rofi/bin/android_quicklinks new file mode 120000 index 0000000..7d44c74 --- /dev/null +++ b/Common/rofi/bin/android_quicklinks @@ -0,0 +1 @@ +../applets/android/quicklinks.sh
\ No newline at end of file diff --git a/Common/rofi/bin/android_screenshot b/Common/rofi/bin/android_screenshot new file mode 120000 index 0000000..1bd8694 --- /dev/null +++ b/Common/rofi/bin/android_screenshot @@ -0,0 +1 @@ +../applets/android/screenshot.sh
\ No newline at end of file diff --git a/Common/rofi/bin/android_volume b/Common/rofi/bin/android_volume new file mode 120000 index 0000000..33bcea2 --- /dev/null +++ b/Common/rofi/bin/android_volume @@ -0,0 +1 @@ +../applets/android/volume.sh
\ No newline at end of file diff --git a/Common/rofi/bin/applet_apps b/Common/rofi/bin/applet_apps new file mode 120000 index 0000000..0cbf8f8 --- /dev/null +++ b/Common/rofi/bin/applet_apps @@ -0,0 +1 @@ +../applets/applets/apps.sh
\ No newline at end of file diff --git a/Common/rofi/bin/applet_backlight b/Common/rofi/bin/applet_backlight new file mode 120000 index 0000000..0663ec3 --- /dev/null +++ b/Common/rofi/bin/applet_backlight @@ -0,0 +1 @@ +../applets/applets/backlight.sh
\ No newline at end of file diff --git a/Common/rofi/bin/applet_battery b/Common/rofi/bin/applet_battery new file mode 120000 index 0000000..4b660cb --- /dev/null +++ b/Common/rofi/bin/applet_battery @@ -0,0 +1 @@ +../applets/applets/battery.sh
\ No newline at end of file diff --git a/Common/rofi/bin/applet_mpd b/Common/rofi/bin/applet_mpd new file mode 120000 index 0000000..2a55e5f --- /dev/null +++ b/Common/rofi/bin/applet_mpd @@ -0,0 +1 @@ +../applets/applets/mpd.sh
\ No newline at end of file diff --git a/Common/rofi/bin/applet_network b/Common/rofi/bin/applet_network new file mode 120000 index 0000000..cecf37c --- /dev/null +++ b/Common/rofi/bin/applet_network @@ -0,0 +1 @@ +../applets/applets/network.sh
\ No newline at end of file diff --git a/Common/rofi/bin/applet_powermenu b/Common/rofi/bin/applet_powermenu new file mode 120000 index 0000000..0a0635d --- /dev/null +++ b/Common/rofi/bin/applet_powermenu @@ -0,0 +1 @@ +../applets/applets/powermenu.sh
\ No newline at end of file diff --git a/Common/rofi/bin/applet_quicklinks b/Common/rofi/bin/applet_quicklinks new file mode 120000 index 0000000..319e0b2 --- /dev/null +++ b/Common/rofi/bin/applet_quicklinks @@ -0,0 +1 @@ +../applets/applets/quicklinks.sh
\ No newline at end of file diff --git a/Common/rofi/bin/applet_screenshot b/Common/rofi/bin/applet_screenshot new file mode 120000 index 0000000..3107901 --- /dev/null +++ b/Common/rofi/bin/applet_screenshot @@ -0,0 +1 @@ +../applets/applets/screenshot.sh
\ No newline at end of file diff --git a/Common/rofi/bin/applet_time b/Common/rofi/bin/applet_time new file mode 120000 index 0000000..0565f05 --- /dev/null +++ b/Common/rofi/bin/applet_time @@ -0,0 +1 @@ +../applets/applets/time.sh
\ No newline at end of file diff --git a/Common/rofi/bin/applet_volume b/Common/rofi/bin/applet_volume new file mode 120000 index 0000000..493275a --- /dev/null +++ b/Common/rofi/bin/applet_volume @@ -0,0 +1 @@ +../applets/applets/volume.sh
\ No newline at end of file diff --git a/Common/rofi/bin/launcher_colorful b/Common/rofi/bin/launcher_colorful new file mode 120000 index 0000000..8e48b54 --- /dev/null +++ b/Common/rofi/bin/launcher_colorful @@ -0,0 +1 @@ +../launchers/colorful/launcher.sh
\ No newline at end of file diff --git a/Common/rofi/bin/launcher_misc b/Common/rofi/bin/launcher_misc new file mode 120000 index 0000000..ff3f68f --- /dev/null +++ b/Common/rofi/bin/launcher_misc @@ -0,0 +1 @@ +../launchers/misc/launcher.sh
\ No newline at end of file diff --git a/Common/rofi/bin/launcher_ribbon b/Common/rofi/bin/launcher_ribbon new file mode 120000 index 0000000..925a1a8 --- /dev/null +++ b/Common/rofi/bin/launcher_ribbon @@ -0,0 +1 @@ +../launchers/ribbon/launcher.sh
\ No newline at end of file diff --git a/Common/rofi/bin/launcher_slate b/Common/rofi/bin/launcher_slate new file mode 120000 index 0000000..d409300 --- /dev/null +++ b/Common/rofi/bin/launcher_slate @@ -0,0 +1 @@ +../launchers/slate/launcher.sh
\ No newline at end of file diff --git a/Common/rofi/bin/launcher_text b/Common/rofi/bin/launcher_text new file mode 120000 index 0000000..65eac28 --- /dev/null +++ b/Common/rofi/bin/launcher_text @@ -0,0 +1 @@ +../launchers/text/launcher.sh
\ No newline at end of file diff --git a/Common/rofi/bin/menu_apps b/Common/rofi/bin/menu_apps new file mode 120000 index 0000000..a07c955 --- /dev/null +++ b/Common/rofi/bin/menu_apps @@ -0,0 +1 @@ +../applets/menu/apps.sh
\ No newline at end of file diff --git a/Common/rofi/bin/menu_backlight b/Common/rofi/bin/menu_backlight new file mode 120000 index 0000000..18eea2f --- /dev/null +++ b/Common/rofi/bin/menu_backlight @@ -0,0 +1 @@ +../applets/menu/backlight.sh
\ No newline at end of file diff --git a/Common/rofi/bin/menu_battery b/Common/rofi/bin/menu_battery new file mode 120000 index 0000000..10f11b5 --- /dev/null +++ b/Common/rofi/bin/menu_battery @@ -0,0 +1 @@ +../applets/menu/battery.sh
\ No newline at end of file diff --git a/Common/rofi/bin/menu_mpd b/Common/rofi/bin/menu_mpd new file mode 120000 index 0000000..b3e204b --- /dev/null +++ b/Common/rofi/bin/menu_mpd @@ -0,0 +1 @@ +../applets/menu/mpd.sh
\ No newline at end of file diff --git a/Common/rofi/bin/menu_network b/Common/rofi/bin/menu_network new file mode 120000 index 0000000..2c4c1d9 --- /dev/null +++ b/Common/rofi/bin/menu_network @@ -0,0 +1 @@ +../applets/menu/network.sh
\ No newline at end of file diff --git a/Common/rofi/bin/menu_powermenu b/Common/rofi/bin/menu_powermenu new file mode 120000 index 0000000..da40a0b --- /dev/null +++ b/Common/rofi/bin/menu_powermenu @@ -0,0 +1 @@ +../applets/menu/powermenu.sh
\ No newline at end of file diff --git a/Common/rofi/bin/menu_quicklinks b/Common/rofi/bin/menu_quicklinks new file mode 120000 index 0000000..e873658 --- /dev/null +++ b/Common/rofi/bin/menu_quicklinks @@ -0,0 +1 @@ +../applets/menu/quicklinks.sh
\ No newline at end of file diff --git a/Common/rofi/bin/menu_screenshot b/Common/rofi/bin/menu_screenshot new file mode 120000 index 0000000..8c4b92d --- /dev/null +++ b/Common/rofi/bin/menu_screenshot @@ -0,0 +1 @@ +../applets/menu/screenshot.sh
\ No newline at end of file diff --git a/Common/rofi/bin/menu_time b/Common/rofi/bin/menu_time new file mode 120000 index 0000000..a7d56c1 --- /dev/null +++ b/Common/rofi/bin/menu_time @@ -0,0 +1 @@ +../applets/menu/time.sh
\ No newline at end of file diff --git a/Common/rofi/bin/menu_volume b/Common/rofi/bin/menu_volume new file mode 120000 index 0000000..b0f235a --- /dev/null +++ b/Common/rofi/bin/menu_volume @@ -0,0 +1 @@ +../applets/menu/volume.sh
\ No newline at end of file diff --git a/Common/rofi/bin/powermenu b/Common/rofi/bin/powermenu new file mode 120000 index 0000000..d9f9d95 --- /dev/null +++ b/Common/rofi/bin/powermenu @@ -0,0 +1 @@ +../powermenu/powermenu.sh
\ No newline at end of file diff --git a/Common/rofi/bin/usedcpu b/Common/rofi/bin/usedcpu new file mode 100755 index 0000000..512933c --- /dev/null +++ b/Common/rofi/bin/usedcpu @@ -0,0 +1,45 @@ +#!/usr/bin/env bash + +PREV_TOTAL=0 +PREV_IDLE=0 + +cpuFile="/tmp/.cpu" + +if [[ -f "${cpuFile}" ]]; then + fileCont=$(cat "${cpuFile}") + PREV_TOTAL=$(echo "${fileCont}" | head -n 1) + PREV_IDLE=$(echo "${fileCont}" | tail -n 1) +fi + +CPU=(`cat /proc/stat | grep '^cpu '`) # Get the total CPU statistics. +unset CPU[0] # Discard the "cpu" prefix. +IDLE=${CPU[4]} # Get the idle CPU time. + +# Calculate the total CPU time. +TOTAL=0 + +for VALUE in "${CPU[@]:0:4}"; do + let "TOTAL=$TOTAL+$VALUE" +done + +if [[ "${PREV_TOTAL}" != "" ]] && [[ "${PREV_IDLE}" != "" ]]; then + # Calculate the CPU usage since we last checked. + let "DIFF_IDLE=$IDLE-$PREV_IDLE" + let "DIFF_TOTAL=$TOTAL-$PREV_TOTAL" + let "DIFF_USAGE=(1000*($DIFF_TOTAL-$DIFF_IDLE)/$DIFF_TOTAL+5)/10" + if [[ $1 = "-i" ]]; then + echo " ${DIFF_USAGE}%" + else + echo "${DIFF_USAGE}%" + fi +else + if [[ $1 = "-i" ]]; then + echo " ?" + else + echo "?" + fi +fi + +# Remember the total and idle CPU times for the next check. +echo "${TOTAL}" > "${cpuFile}" +echo "${IDLE}" >> "${cpuFile}" diff --git a/Common/rofi/bin/usedram b/Common/rofi/bin/usedram new file mode 100755 index 0000000..e8a6108 --- /dev/null +++ b/Common/rofi/bin/usedram @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +mem_info=$(</proc/meminfo) + mem_info=$(echo $(echo $(mem_info=${mem_info// /}; echo ${mem_info//kB/}))) + for m in $mem_info; do + case ${m//:*} in + "MemTotal") usedmem=$((usedmem+=${m//*:})); totalmem=${m//*:} ;; + "ShMem") usedmem=$((usedmem+=${m//*:})) ;; + "MemFree"|"Buffers"|"Cached"|"SReclaimable") usedmem=$((usedmem-=${m//*:})) ;; + esac + done + usedmem=$((usedmem / 1024)) + totalmem=$((totalmem / 1024)) + mem="${usedmem}MB / ${totalmem}MB" + +## Complete summary + if [[ $1 = "-fi" ]]; then + echo " $mem" + elif [[ $1 = "-f" ]]; then + echo "$mem" + +## Only used RAM + elif [[ $1 = "-i" ]]; then + echo " $usedmem MB" + else + echo "$usedmem MB" + fi |