mirror of
https://github.com/elenapan/dotfiles.git
synced 2026-01-07 00:57:28 +08:00
updated scripts, added configs, new screenshot
This commit is contained in:
parent
b633e81511
commit
80e5a611d9
437 changed files with 46668 additions and 22 deletions
|
|
@ -1,2 +1,27 @@
|
|||
#upower -i $(upower -e | grep 'BAT') | grep -E "state|to\ full|percentage"
|
||||
echo -n " "; upower -i $(upower -e | grep 'BAT') | grep -E "percentage" | awk '{print $2;}'
|
||||
#!/bin/zsh
|
||||
# upower -i $(upower -e | grep 'BAT') | grep -E "state|to\ full|percentage"
|
||||
# glyphs:
|
||||
|
||||
INFO="$(upower -i "$(upower -e | grep 'BAT')")"
|
||||
|
||||
STATE="$(echo $INFO | grep "state" | awk '{print $2}')"
|
||||
# Note: I cut off the percentage sign so i can later compare POWER as an int
|
||||
POWER="$(echo $INFO | grep "percentage" | awk '{print $2}' | head -c -2)"
|
||||
|
||||
# TODO!
|
||||
if [[ "$STATE" = "discharging" ]]; then
|
||||
if [ "$POWER" -ge "85" ]; then
|
||||
echo " $POWER%"
|
||||
elif [ "$POWER" -ge "60" ]; then
|
||||
echo " $POWER%"
|
||||
elif [ "$POWER" -ge "35" ]; then
|
||||
echo " $POWER%"
|
||||
elif [ "$POWER" -ge "10" ]; then
|
||||
echo " $POWER%"
|
||||
else
|
||||
echo " $POWER%"
|
||||
fi
|
||||
else
|
||||
# State = fully charged or charging
|
||||
echo " $POWER%"
|
||||
fi
|
||||
|
|
@ -1,3 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
#
|
||||
CPU="$[100-$(vmstat 1 2|tail -1|awk '{printf "%d", $15}')]"
|
||||
echo " $CPU%"
|
||||
GOVERNOR="$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)"
|
||||
|
||||
if [[ "$GOVERNOR" == "performance" ]]; then
|
||||
echo " $CPU%"
|
||||
else
|
||||
echo " $CPU%"
|
||||
fi
|
||||
9
Scripts/flux-toggle
Executable file
9
Scripts/flux-toggle
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
#NEEDS WORK!
|
||||
|
||||
redshift -p > /home/elena/redtemp
|
||||
CURRENT="$(cat /home/elena/redtemp | grep "temp" | awk '{print $3;}')"
|
||||
DAY = "5500K"
|
||||
if [ "$CURRENT" == "$DAY" ]
|
||||
then echo "REDSHIFT OFF"
|
||||
else echo "REDSHIFT ON"
|
||||
fi
|
||||
|
|
@ -1 +1 @@
|
|||
rofi -show combi -combi-modi "window,run" -lines 10 -width 100 -padding 10 -fullscreen -font "Hurmit Nerd Font 18" -separator-style "none"
|
||||
rofi -show combi -combi-modi "window,run" -lines 12 -width 100 -padding 80 -fullscreen -font "Hurmit Nerd Font 30" -separator-style "none"
|
||||
|
|
|
|||
3
Scripts/hello_world.sh
Executable file
3
Scripts/hello_world.sh
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
# For testing purposes
|
||||
notify-send 'Hello world!' 'This is an example notification.' --icon=dialog-information
|
||||
17
Scripts/inet.sh
Executable file
17
Scripts/inet.sh
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
# needs work! not thoroughly tested...
|
||||
# Replace with your own interface names here
|
||||
WIRELESS_IF="wlp3s0"
|
||||
WIRED_IF="enp2s0f0"
|
||||
|
||||
WIFI="$(ifconfig | grep -A 1 $WIRELESS_IF | grep "inet" | awk '{print $2}')"
|
||||
ETHER="$(ifconfig | grep -A 1 $WIRED_IF | grep "inet" | awk '{print $2}')"
|
||||
|
||||
if [ ${#ETHER} -eq "0" ]; then
|
||||
if [ ${#WIFI} -eq "0" ]; then
|
||||
echo " "
|
||||
else
|
||||
echo " $WIFI"
|
||||
fi
|
||||
else
|
||||
echo " $ETHER"
|
||||
fi
|
||||
1
Scripts/mail
Executable file
1
Scripts/mail
Executable file
|
|
@ -0,0 +1 @@
|
|||
chromium-browser --new-window https://mail.google.com/mail/u/0/#inbox https://outlook.live.com/owa/ https://webmail.uth.gr/login.php https://mail.yahoo.com/
|
||||
12
Scripts/print_xcolors
Executable file
12
Scripts/print_xcolors
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
declare -a color
|
||||
declare -a XCOLOR_OLD
|
||||
declare -a XCOLOR_NEW
|
||||
|
||||
# Create array with old colors
|
||||
for (( i = 0; i < 8; i++ )); do
|
||||
color[$i]="$(echo color$i)"
|
||||
XCOLOR_OLD[$i]="$(cat ~/.Xresources | grep -m 1 ${color[$i]} | awk '{print $2}')"
|
||||
echo ${XCOLOR_OLD[$i]}
|
||||
done
|
||||
|
|
@ -1 +1,2 @@
|
|||
free -m | awk 'NR==2{printf " %d%%\n", $3*100/$2 }'
|
||||
free -m | awk 'NR==2{printf " %d%%\n", $3*100/$2 }'
|
||||
#
|
||||
25
Scripts/scrollingtext.sh
Executable file
25
Scripts/scrollingtext.sh
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
# Scrolling text v2
|
||||
LIMIT=12
|
||||
SEPERATOR=" ~~~ "
|
||||
SEPERATOR_LENGTH="$(echo ${#SEPERATOR})"
|
||||
|
||||
i=1
|
||||
while :
|
||||
do
|
||||
# Get input and create the full string that will be used
|
||||
INPUT="$@"
|
||||
INPUT_LENGTH="$(echo ${#INPUT})"
|
||||
LOOPTAIL="$(echo $INPUT | cut -c -$LIMIT)"
|
||||
FULLSTRING="$(echo $INPUT | sed "s/$/$SEPERATOR/" | sed "s/$/$LOOPTAIL/" )"
|
||||
|
||||
# Show only LIMIT characters. Output scrolls due to incrementing i
|
||||
echo -n $FULLSTRING | cut -c $i-$(($LIMIT+$i))
|
||||
|
||||
# If we have shown the full string, start over
|
||||
if [ $i -eq $(($INPUT_LENGTH+$SEPERATOR_LENGTH)) ]; then
|
||||
i=0
|
||||
fi
|
||||
|
||||
i=$(($i+1))
|
||||
sleep 1
|
||||
done
|
||||
3
Scripts/temperature.sh
Executable file
3
Scripts/temperature.sh
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
#
|
||||
TEMP="$(sensors | grep "Package" | awk '{print $4}' | cut -c 2-3,6-8)"
|
||||
echo " $TEMP"
|
||||
|
|
@ -1 +1,3 @@
|
|||
killall tint2 && sleep 1 && tint2 &
|
||||
killall tint2
|
||||
sleep 1
|
||||
tint2 &
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
amixer get Master | grep "${snd_cha}" | awk -F'[]%[]' '/%/ {if ($7 == "off") {print " xxx\n"} else {printf " %d%%\n", $2}}'
|
||||
amixer get Master | grep "${snd_cha}" | awk -F'[]%[]' '/%/ {if ($7 == "off") {print " \n"} else {printf " %d%%\n", $2}}'
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash
|
||||
# Requires wal or pywal (github)
|
||||
|
||||
# Run like this
|
||||
# wally /path/to/wallpaper/or/directory
|
||||
|
|
@ -13,6 +14,7 @@ if [ $# == 0 ]; then
|
|||
exit 0;
|
||||
fi
|
||||
|
||||
# Declare arrays
|
||||
declare -a color
|
||||
declare -a XCOLOR_OLD
|
||||
declare -a XCOLOR_NEW
|
||||
|
|
@ -48,7 +50,8 @@ for (( i = 0; i < 8; i++ )); do
|
|||
done
|
||||
|
||||
# Restart tint2 to reload config file
|
||||
# The grep is to supress tint2 output (doesn't work very well though)
|
||||
# The grep is to supress tint2 output
|
||||
# (doesn't work very well because tint2 is run in the background and can bypass this)
|
||||
tint2restart | grep shutup! &
|
||||
echo "> tint2 has restarted!"
|
||||
|
||||
|
|
@ -57,13 +60,6 @@ echo "> tint2 has restarted!"
|
|||
openbox --reconfigure
|
||||
echo "> Openbox is reconfigured!"
|
||||
|
||||
# Customize login screen: REQUIRES SUDO :(
|
||||
# (needs to happen after oomox has generated a gtk theme with the name wally)
|
||||
#
|
||||
# echo "> Attempting to change login theme (you will be prompted for a password)"
|
||||
# gksu cp -r ~/.themes/oomox-wally /usr/share/themes/wally
|
||||
# gksu lightdm-gtk-greeter-settings
|
||||
|
||||
# Copy new wallpaper path to wally's directory
|
||||
cp ~/.cache/wal/wal ~/.wally/path_to_wallpaper
|
||||
WALLPAPER="$(cat ~/.wally/path_to_wallpaper)"
|
||||
|
|
|
|||
11
Scripts/wally-setlogintheme
Executable file
11
Scripts/wally-setlogintheme
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
# Copies the gtk theme created by oomox to /usr/share/icons
|
||||
# so that it can be used by lightdm greeter
|
||||
echo -n "> Replacing gtk theme and icons... "
|
||||
rm -rf /usr/share/themes/wally
|
||||
rm -rf /usr/share/icons/wally
|
||||
cp -r ~/.themes/oomox-wally /usr/share/themes/wally
|
||||
cp -r ~/.icons/oomox-wally-flat /usr/share/icons/wally
|
||||
echo "Done!"
|
||||
echo "> Starting lightdm-gtk-greeter-settings..."
|
||||
lightdm-gtk-greeter-settings
|
||||
echo "> All done :)"
|
||||
60
Scripts/weather.sh
Executable file
60
Scripts/weather.sh
Executable file
|
|
@ -0,0 +1,60 @@
|
|||
#!/bin/bash
|
||||
# needs work
|
||||
|
||||
CITY="Hamburg"
|
||||
|
||||
# glyphs (TODO)
|
||||
# day cloud
|
||||
# storm
|
||||
# night cloud
|
||||
# rain
|
||||
# umbrella
|
||||
# snow
|
||||
# sun
|
||||
# cloud
|
||||
# moon star
|
||||
# house
|
||||
# globe
|
||||
# bed
|
||||
|
||||
# curl -4 http://wttr.in/@$(curl -s 'https://api.ipify.org?format=plaintext')
|
||||
|
||||
|
||||
TEMP="$(curl -s -A "Mozilla/5.0" wttr.in/$CITY | grep -m 1 '°C'| awk '{print $(NF-1)}' | cut -d ">" -f2 | cut -f1 -d "<")"
|
||||
|
||||
# NOTE: Currently weather state disabled. Uncomment to reenable
|
||||
# STATE="$(curl -s -A "Mozilla/5.0" wttr.in/$CITY | grep -m 1 -B 1 '°C' | sed '$d' | awk '{printf "%s %s", $(NF-1), $NF}')"
|
||||
# PRELAST="$(echo $STATE | awk '{print $1}')"
|
||||
# HOUR="$(date +%H)"
|
||||
|
||||
# # Check if state is only one word
|
||||
# if [[ "$PRELAST" = "</span>" ]]; then
|
||||
# STATE="$(echo $STATE | awk '{print $2}')"
|
||||
# fi
|
||||
|
||||
# if [[ "$STATE" = "Clear" ]]; then
|
||||
# if [ $HOUR -lt 20 ] && [ $HOUR -gt $5 ]; then
|
||||
# echo " $TEMP°C"
|
||||
# else
|
||||
# echo " $TEMP°C"
|
||||
# fi
|
||||
# elif [[ "$STATE" = "Partly cloudy" ]]; then
|
||||
# if [ $HOUR -lt 20 ] && [ $HOUR -gt 5 ]; then
|
||||
# echo " $TEMP°C"
|
||||
# else
|
||||
# echo " $TEMP°C"
|
||||
# fi
|
||||
# elif [[ "$STATE" = "Cloudy" ]]; then
|
||||
# echo " $TEMP°C"
|
||||
# elif [[ "$STATE" = "Sunny" ]]; then
|
||||
# echo " $TEMP°C"
|
||||
# else
|
||||
# echo " $TEMP°C"
|
||||
# fi
|
||||
|
||||
|
||||
# City+degrees
|
||||
#echo $CITY $TEMP°C
|
||||
|
||||
# Degrees only
|
||||
echo "$TEMP°C"
|
||||
|
|
@ -1,13 +1,92 @@
|
|||
# Prints the title of the first open YouTube window
|
||||
#!/bin/bash
|
||||
|
||||
# Prints the title of the first open YouTube window, while scrolling (sexy!)
|
||||
# It works if the tab is in focus, so seperate the youtube tab from
|
||||
# the rest of the browser so you don't have to keep it in focus and the script will work.
|
||||
|
||||
OUTPUT="$(wmctrl -l | grep -v "wmctrl" | grep -m 1 YouTube | awk -v skipstart=3 -v skipend=4 '{delim = ""; for (i=skipstart+1;i<=NF-skipend;i++) {printf delim "%s", $i; delim = OFS};}')"
|
||||
if [ "$OUTPUT" = "" ]; then
|
||||
echo " "
|
||||
else
|
||||
echo " $OUTPUT" | head -c 35
|
||||
fi
|
||||
# Note: on tint2, set interval=0 and continuous output=2 or larger
|
||||
# (in general continuous output should be larger than sleep time)
|
||||
|
||||
# TODO: start from the beginning if the output has changed (if the song has changed)
|
||||
|
||||
# Another way
|
||||
# b=${a:12:5}
|
||||
# (where 12 is the offset (zero-based) and 5 is the length)
|
||||
|
||||
# Limit for scrolling text
|
||||
LIMIT=16
|
||||
#SEPERATOR=" --- "
|
||||
#SEPERATOR=" -- "
|
||||
SEPERATOR=" ~~~ "
|
||||
#SEPERATOR=" ~~ "
|
||||
#SEPERATOR=" <> "
|
||||
SEPERATOR_LENGTH="$(echo ${#SEPERATOR})"
|
||||
|
||||
# for multibyte chars (idk if it works):
|
||||
# iconv -sc -t UTF-8 -f cp1251
|
||||
# tr -dc '[:print:]'
|
||||
|
||||
i=1
|
||||
while :
|
||||
do
|
||||
# Seach for youtube and pandora windows
|
||||
YOUTUBE="$(wmctrl -l | grep -v "wmctrl" | grep -m 1 "YouTube")"
|
||||
PANDORA="$(wmctrl -l | grep -v "wmctrl" | grep -m 1 "Pandora Radio")"
|
||||
|
||||
# Get input and create the full string that will be used
|
||||
#INPUT="$(echo $YOUTUBE | awk -v skipstart=3 -v skipend=4 '{delim = ""; for (i=skipstart+1;i<=NF-skipend;i++) {printf delim "%s", $i; delim = OFS};}')"
|
||||
INPUT="$(echo $YOUTUBE | awk -v skipstart=3 -v skipend=4 '{delim = ""; for (i=skipstart+1;i<=NF-skipend;i++) {printf delim "%s", $i; delim = OFS};}' | tr -dc '[:print:]')"
|
||||
INPUT_LENGTH="$(echo ${#INPUT})"
|
||||
|
||||
# If the song has changed, start from the beginning (buggy if you use $INPUT with trimmed multibyte characters)
|
||||
# if [[ "$INPUT" != "$OLD_INPUT" ]]; then
|
||||
# i=1
|
||||
# fi
|
||||
|
||||
# todo: if i > length, i=1
|
||||
|
||||
|
||||
# If no youtube window is found (+pandora)
|
||||
if [ ${#YOUTUBE} -eq "0" ]; then
|
||||
if [ ${#PANDORA} -eq "0" ]; then
|
||||
#echo " "
|
||||
echo " "
|
||||
else
|
||||
echo " Pandora Radio"
|
||||
fi
|
||||
elif [ $INPUT_LENGTH -le $LIMIT ]; then
|
||||
echo -n " "
|
||||
echo $INPUT
|
||||
else
|
||||
LOOPTAIL="$(echo $INPUT | cut -c -$LIMIT)"
|
||||
FULLSTRING="$(echo $INPUT | sed "s/$/$SEPERATOR/" | sed "s/$/$LOOPTAIL/" )"
|
||||
|
||||
# This is to prevent the bug when song changes and current i is larger than current song length
|
||||
if [ $i -gt "${#FULLSTRING}" ]; then
|
||||
i=1
|
||||
fi
|
||||
|
||||
echo -n " "
|
||||
# Show only LIMIT characters, from i to i+LIMIT. Output scrolls due to incrementing i
|
||||
echo -n $FULLSTRING | cut -c $i-$(($LIMIT+$i))
|
||||
#echo -n $FULLSTRING | awk -v charlimit="$LIMIT" -v start="$i" '{print substr($0,start,charlimit)}'
|
||||
|
||||
# If we have shown the full string, start over
|
||||
if [ $i -eq $(($INPUT_LENGTH+$SEPERATOR_LENGTH)) ]; then
|
||||
i=0
|
||||
fi
|
||||
|
||||
|
||||
i=$(($i+1))
|
||||
fi
|
||||
|
||||
OLD_INPUT="$(echo $INPUT)"
|
||||
|
||||
# for fat bars, I add this newline so the previous output is not visible
|
||||
echo ""
|
||||
|
||||
sleep 1
|
||||
done
|
||||
|
||||
# general method to exlude fields
|
||||
# awk -v skipstart=1 -v skipend=1 '{delim = ""; for (i=skipstart+1;i<=NF-skipend;i++) {printf delim "%s", $i; delim = OFS}; printf "\n"}'
|
||||
Loading…
Add table
Add a link
Reference in a new issue