加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
.autostart.sh 2.89 KB
一键复制 编辑 原始数据 按行查看 历史
Astro-Lee 提交于 2020-10-08 20:37 . 优化了ip地址匹配
#!/bin/bash
#cd ~/Wallpaper
#file=`ls -1 ~/Wallpaper | sort --random-sort | head -1`
feh --bg-fill ~/Wallpaper/desktop.jpg
# ~/.config/polybar/launch.sh &
###################################################
Max_Brightness=$(cat /sys/class/backlight/intel_backlight/max_brightness)
while true;do
#IP地址
Ip_Address=$(ip addr | grep 'scope global dynamic noprefixroute wlp3s0' | sed -r 's/.*inet\s(.*)\/.*/\1/')
#系统时间
# Time_Now=$(date +"%Y年%m月%d日 %H:%M")
Time_Now=$(date +"%b-%d %H:%M")
#用电状态
if [ $(cat /sys/class/power_supply/BAT*/status) = "Discharging" ];then
Battery_Status="🔋"
else
Battery_Status="🔌"
fi
Battery_Now=$(cat /sys/class/power_supply/BAT*/capacity)
#音量
if [ $(amixer get Master | tail -n1 | sed -r 's/.*\[(.*)\].*/\1/') = "on" ];then
Volume_Status="🔊"
Volume_Now=$(amixer get Master | tail -n1 | sed -r 's/.*\[(.*)%\].*/\1/')
else
Volume_Status="🔇"
Volume_Now="0"
fi
#屏幕亮度
Actual_Brightness=$(cat /sys/class/backlight/intel_backlight/actual_brightness)
Brightness_Now=$(bc <<< "scale=2;($Actual_Brightness/$Max_Brightness)*100" | sed -r 's/^(.*)\..*/\1/')
xsetroot -name " 🌐 ${Ip_Address} | ☀ ${Brightness_Now}% | ${Volume_Status} ${Volume_Now}% | ${Battery_Status} ${Battery_Now}% | ${Time_Now} "
sleep 30
done &
###################################################
compton -b & #渲染
numlockx& #小键盘
##################################################
fcitx &
###################################################
#需要安装字体🌐☀ 🔇🔈🔉🔊🔌🔋
#sudo pacman -S noto-fonts-emoji ttf-joypixels unicode-emoji ttf-symbola
###################################################
#sleep 2
#while true;do
# autoStartXset
# sleep 240
#done &
#while true;do
# sleep 7200
# cd ~/Wallpaper
# file=`ls -1 ~/Wallpaper | sort --random-sort | head -1`
# feh --bg-fill $file
#done &
# IpAddress=`ip addr | grep "inet" | awk '{ print $2 }' | awk "NR==3"`
# b1=80;b2=60;b3=40;b4=20
# while true;do
# enp_state=`cat /sys/class/net/enp5s0/operstate`
# wlp_state=`cat /sys/class/net/wlp9s0/operstate`
# if [ $enp_state = "up" ];then
# net_state="\ufbf1 ${IpAddress%/*}"
# elif [ $wlp_state = "up" ];then
# net_state="\ufaa8 ${IpAddress%/*}"
# else
# net_state="\ufaa9"
# fi
#
# mydate="\uf5ef $(date +"%b-%d %a %H:%M") "
# mybattery=`expr $(cat /sys/class/power_supply/BAT0/capacity)`
# if [ $mybattery -ge $b1 ];then
# mybatterycoin="\uf240"
# elif [ $mybattery -ge $b2 ];then
# mybatterycoin="\uf241"
# elif [ $mybattery -ge $b3 ];then
# mybatterycoin="\uf242"
# elif [ $mybattery -ge $b4 ];then
# mybatterycoin="\uf243"
# else
# mybatterycoin="'\uf244"
# fi
# xsetroot -name " $net_state $mybatterycoin $mybattery $mydate "
# sleep 30
# done &
# dwmblocks &
# nm-applet &
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化