refactor
This commit is contained in:
-48
@@ -1,48 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
Green='\033[0;32m'
|
||||
Color_off='\033[0m'
|
||||
Red='\033[0;31m'
|
||||
Yellow='\033[1;33m'
|
||||
|
||||
batteries=$(ls /sys/class/power_supply/ | grep BAT)
|
||||
|
||||
case "$1" in
|
||||
"-c")
|
||||
if [[ "$batteries" == "" ]]; then
|
||||
printf "$Yellow**$Red error:$Color_off no battery found\n"
|
||||
exit 1;
|
||||
fi
|
||||
for i in $batteries; do
|
||||
batfull=$(cat /sys/class/power_supply/$i/charge_full)
|
||||
batnow=$(cat /sys/class/power_supply/$i/charge_now)
|
||||
batperc=$((($batnow/($batfull/100))))
|
||||
|
||||
if [[ "$batperc" -le "20" ]]; then
|
||||
printf "$Yellow**$Color_off $i: $Red$batperc$Color_off\n"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ "$batperc" -le "70" ]]; then
|
||||
printf "$Yellow**$Color_off $i: $Yellow$batperc$Color_off\n"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
printf "$Yellow**$Color_off $i: $Green$batperc$Color_off\n"
|
||||
done
|
||||
;;
|
||||
"-j")
|
||||
if [[ "$batteries" == "" ]]; then
|
||||
echo no
|
||||
exit 1;
|
||||
fi
|
||||
for i in $batteries; do
|
||||
batfull=$(cat /sys/class/power_supply/$i/charge_full)
|
||||
batnow=$(cat /sys/class/power_supply/$i/charge_now)
|
||||
batperc=$((($batnow/($batfull/100))))
|
||||
|
||||
printf "$batperc \n"
|
||||
done
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
batperc=$(~/dotfiles/bin/batperc -j)
|
||||
|
||||
echo $batperc
|
||||
|
||||
if [[ "$batperc" != "no" ]]; then
|
||||
while true; do
|
||||
for i in $batperc; do
|
||||
if [[ "$i" -le "20" ]]; then
|
||||
notify-send "Battery low: $i%" -u critical
|
||||
sleep 60
|
||||
fi
|
||||
done
|
||||
done
|
||||
fi
|
||||
@@ -1,11 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
while true; do
|
||||
BAT=$(acpi -S | cut -d' ' -f4 | sed 's/.$//')
|
||||
|
||||
if [ $BAT -le 9 ]; then
|
||||
notify-send "Низкий заряд батареи!!!" -u critical
|
||||
sleep 60s
|
||||
fi
|
||||
sleep 5s
|
||||
done &
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
xset -dpms
|
||||
xset s off
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
#!/bin/sh
|
||||
xrandr --output eDP1 --primary --mode 1366x768 --pos 1440x0 --rotate normal --output DP1 --off --output DP2 --off --output HDMI1 --off --output HDMI2 --mode 1440x900 --pos 0x0 --rotate normal --output VIRTUAL1 --off
|
||||
+35
-43
@@ -1,64 +1,56 @@
|
||||
#!/bin/sh
|
||||
#------ cli variables -------------------------------------------------------------------------------------------------------------------------------
|
||||
PATH=$1 # path for new root
|
||||
SHELL=$2 # shell to use in chroot
|
||||
#----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
#------- Check root func ----------------------------------------------------------------------------------------------------------------------------
|
||||
PATH=$1
|
||||
SHELL=$2
|
||||
|
||||
check_root() {
|
||||
if [ $(/usr/bin/id -u) -ne 0 ]; then # cheking root priveleges
|
||||
if [ $(/usr/bin/id -u) -ne 0 ]; then
|
||||
printf "** You must be root\n"
|
||||
exit 1 # exit with exit code 1 error
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
#----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
#----------- checking or create dirs ----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
check_or_mkdir() {
|
||||
[ ! -d $PATH/dev ] && mkdir -pv $PATH/dev # if directory not exists then mkdir
|
||||
[ ! -d $PATH/proc ] && mkdir -pv $PATH/proc # if directory not exists then mkdir
|
||||
[ ! -d $PATH/sys ] && mkdir -pv $PATH/sys # if directory not exists then mkdir
|
||||
[ ! -d $PATH/run ] && mkdir -pv $PATH/run # if directory not exists then mkdir
|
||||
[ ! -d $PATH/dev ] && mkdir -pv $PATH/dev
|
||||
[ ! -d $PATH/proc ] && mkdir -pv $PATH/proc
|
||||
[ ! -d $PATH/sys ] && mkdir -pv $PATH/sys
|
||||
[ ! -d $PATH/run ] && mkdir -pv $PATH/run
|
||||
}
|
||||
#----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
#-------- mount virtual filesystems -----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
mount_virtual() {
|
||||
/usr/bin/mount -v --bind /dev $PATH/dev # mount bind devtmpfs to /dev
|
||||
/usr/bin/mount -vt devpts devpts -o gid=5,mode=0620 $PATH/dev/pts # mount devpts to /dev/pts
|
||||
/usr/bin/mount -vt proc proc $PATH/proc # mount procfs to /proc
|
||||
/usr/bin/mount -vt sysfs sysfs $PATH/sys # mount sysfs to /sys
|
||||
/usr/bin/mount -vt tmpfs tmpfs $PATH/run # mount tmpfs to /run
|
||||
if [ -h $PATH/dev/shm ]; then # check
|
||||
/usr/bin/install -v -d -m 1777 $PATH$(/usr/bin/realpath /dev/shm) # install directories
|
||||
/usr/bin/mount -v --bind /dev $PATH/dev
|
||||
/usr/bin/mount -vt devpts devpts -o gid=5,mode=0620 $PATH/dev/pts
|
||||
/usr/bin/mount -vt proc proc $PATH/proc
|
||||
/usr/bin/mount -vt sysfs sysfs $PATH/sys
|
||||
/usr/bin/mount -vt tmpfs tmpfs $PATH/run
|
||||
if [ -h $PATH/dev/shm ]; then
|
||||
/usr/bin/install -v -d -m 1777 $PATH$(/usr/bin/realpath /dev/shm)
|
||||
else
|
||||
/usr/bin/mount -vt tmpfs -o nosuid,nodev tmpfs $PATH/dev/shm # mount tmpfs to /dev/shm
|
||||
/usr/bin/mount -vt tmpfs -o nosuid,nodev tmpfs $PATH/dev/shm
|
||||
fi
|
||||
/usr/bin/cp -v /etc/resolv.conf $PATH/etc/resolv.conf # copy resolv.conf file to chroot
|
||||
/usr/bin/cp -v /etc/resolv.conf $PATH/etc/resolv.conf
|
||||
}
|
||||
#----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
#------ umount virtual filesystems ------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
umount_virtual() {
|
||||
/usr/bin/mountpoint -q $PATH/dev/shm && /usr/bin/umount $PATH/dev/shm # umount /dev/shm
|
||||
/usr/bin/umount $PATH/dev/pts # umount /dev/pts
|
||||
/usr/bin/umount $PATH/{sys,proc,run,dev} # umount /sys,/proc,/run,/dev
|
||||
/usr/bin/mountpoint -q $PATH/dev/shm && /usr/bin/umount $PATH/dev/shm
|
||||
/usr/bin/umount $PATH/dev/pts
|
||||
/usr/bin/umount $PATH/{sys,proc,run,dev}
|
||||
}
|
||||
#----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
#------ get shell path func -------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
get_shell() {
|
||||
if [[ "$SHELL" != "" ]]; then # if shell is not empty
|
||||
echo $SHELL # return shell
|
||||
if [[ "$SHELL" != "" ]]; then
|
||||
echo $SHELL
|
||||
fi
|
||||
echo "/bin/sh" # if shell is empty return /bin/sh
|
||||
echo "/bin/sh"
|
||||
}
|
||||
#----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
#------- main ---------------------------------------------------------------------------------------------------------------------------------------
|
||||
check_root # check root priveleges
|
||||
check_or_mkdir # check directories for mount virtual filesystems in chroot
|
||||
mount_virtual # mount virtual filesystems to chroot
|
||||
#---- do chroot in chroot path using shell ----------------------------------------------------------------------------------------------------------
|
||||
|
||||
check_root
|
||||
check_or_mkdir
|
||||
mount_virtual
|
||||
|
||||
/usr/bin/chroot \
|
||||
$PATH \
|
||||
/usr/bin/env -i \
|
||||
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin \
|
||||
$(get_shell)
|
||||
#----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
umount_virtual # umount virtual filesystems from chroot
|
||||
#----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
umount_virtual
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
xrandr --output HDMI-0 --mode 1680x1050
|
||||
|
||||
cvt 1920 1200 60
|
||||
xrandr --newmode "1920x1200_60.00" 193.25 1920 2056 2256 2592 1200 1203 1209 1245 -hsync +vsync
|
||||
|
||||
xrandr --addmode DVI-0 1920x1200_60.00
|
||||
xrandr --output DVI-0 --mode 1920x1200_60.00
|
||||
|
||||
~/dotfiles/bin/lisascreenslayout.sh
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
#!/bin/sh
|
||||
xrandr --output DisplayPort-0 --off --output HDMI-0 --mode 1680x1050 --pos 0x0 --rotate normal --output DVI-0 --mode 1920x1200_60.00 --pos 1680x0 --rotate normal --output DVI-1 --off
|
||||
@@ -1,22 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
directory=~/Pictures/hyprpaper
|
||||
monitors=`hyprctl monitors | grep Monitor | awk '{print $2}'`
|
||||
|
||||
while [ true ]; do
|
||||
if [ -d "$directory" ]; then
|
||||
for monitor in $monitors; do
|
||||
random_background=$(ls $directory/* | shuf -n 1)
|
||||
|
||||
extention="${random_background##*.}"
|
||||
echo $extention
|
||||
if [[ "$extention" == "jpg" ]]; then
|
||||
swww img -o $monitor $random_background --transition-type random
|
||||
elif [[ "$extention" == "mp4" ]]; then
|
||||
mpvpaper $monitor $random_background
|
||||
fi
|
||||
done
|
||||
fi
|
||||
sleep 30
|
||||
done
|
||||
|
||||
#swww img -o VGA-1 /home/tola/Pictures/hyprpaper/calder-moore-aliencrack-01-copy.jpg --transition-type wipe
|
||||
+56
-80
@@ -1,82 +1,58 @@
|
||||
#!/bin/sh
|
||||
|
||||
#--- reset colors ---
|
||||
RESET="\033[0m"
|
||||
#--------------------
|
||||
|
||||
#--------- regularcolrs ---------
|
||||
GREEN="\033[0;32m" #GREEN
|
||||
BLUE="\033[0;34m" #BLUE
|
||||
YELLOW="\033[1;33m" #YELLOW
|
||||
RED="\033[0;31m" #RED
|
||||
BLACK="\033[0;30m" #BLACK
|
||||
PURPLE="\033[0;35m" #PURPLE
|
||||
CYAN="\033[0;36m" #CYAN
|
||||
WHITE="\033[0;37m" #WHITE
|
||||
#--------------------------------
|
||||
|
||||
#-------- bold ------------------
|
||||
BBLACK="\033[1;30m" #BLACK
|
||||
BRED="\033[1;31m" #RED
|
||||
BGREEN="\033[1;32m" #GREEN
|
||||
BYELLOW="\033[1;33m" #YELLOW
|
||||
BBLUE="\033[1;34m" #BLUE
|
||||
BPURPLE="\033[1;35m" #PURPLE
|
||||
BCYAN="\033[1;36m" #CYAN
|
||||
BWHITE="\033[1;37m" #WHITE
|
||||
#--------------------------------
|
||||
|
||||
#-------- Underline -------------
|
||||
UBLACK="\033[4;30m" #BLACK
|
||||
URED="\033[4;31m" #RED
|
||||
UGREEN="\033[4;32m" #GREEN
|
||||
UYELLOW="\033[4;33m" #YELLOW
|
||||
UBLUE="\033[4;34m" #BLUE
|
||||
UPURPLE="\033[4;35m" #PURPLE
|
||||
UCYAN="\033[4;36m" #CYAN
|
||||
UWHITE="\033[4;37m" #WHITE
|
||||
#--------------------------------
|
||||
|
||||
#--------- Background -----------
|
||||
ON_BLACK="\033[40m" #BLACK
|
||||
ON_RED="\033[41m" #RED
|
||||
ON_GREEN="\033[42m" #GREEN
|
||||
ON_YELLOW="\033[43m" #YELLOW
|
||||
ON_BLUE="\033[44m" #BLUE
|
||||
ON_PURPLE="\033[45m" #PURPLE
|
||||
ON_CYAN="\033[46m" #CYAN
|
||||
ON_WHITE="\033[47m" #WHITE
|
||||
#--------------------------------
|
||||
|
||||
#------ HighIntensity -----------
|
||||
IBLACK="\033[0;90m" #BLACK
|
||||
IRED="\033[0;91m" #RED
|
||||
IGREEN="\033[0;92m" #GREEN
|
||||
IYELLOW="\033[0;93m" #YELLOW
|
||||
IBLUE="\033[0;94m" #BLUE
|
||||
IPURPLE="\033[0;95m" #PURPLE
|
||||
ICYAN="\033[0;96m" #CYAN
|
||||
IWHITE="\033[0;97m" #WHITE
|
||||
#--------------------------------
|
||||
|
||||
#------ BoldHighIntensity -------
|
||||
BIBLACK="\033[1;90m" #BLACK
|
||||
BIRED="\033[1;91m" #RED
|
||||
BIGREEN="\033[1;92m" #GREEN
|
||||
BIYELLOW="\033[1;93m" #YELLOW
|
||||
BIBLUE="\033[1;94m" #BLUE
|
||||
BIPURPLE="\033[1;95m" #PURPLE
|
||||
BICYAN="\033[1;96m" #CYAN
|
||||
BIWHITE="\033[1;97m" #WHITE
|
||||
#--------------------------------
|
||||
|
||||
#--- HighIntensitybackgrounds ---
|
||||
ON_IBLACK="\033[0;100m" #BLACK
|
||||
ON_IRED="\033[0;101m" #RED
|
||||
ON_IGREEN="\033[0;102m" #GREEN
|
||||
ON_IYELLOW="\033[0;103m" #YELLOW
|
||||
ON_IBLUE="\033[0;104m" #BLUE
|
||||
ON_IPURPLE="\033[0;105m" #PURPLE
|
||||
ON_ICYAN="\033[0;106m" #CYAN
|
||||
ON_IWHITE="\033[0;107m" #WHITE
|
||||
#--------------------------------
|
||||
GREEN="\033[0;32m"
|
||||
BLUE="\033[0;34m"
|
||||
YELLOW="\033[1;33m"
|
||||
RED="\033[0;31m"
|
||||
BLACK="\033[0;30m"
|
||||
PURPLE="\033[0;35m"
|
||||
CYAN="\033[0;36m"
|
||||
WHITE="\033[0;37m"
|
||||
BBLACK="\033[1;30m"
|
||||
BRED="\033[1;31m"
|
||||
BGREEN="\033[1;32m"
|
||||
BYELLOW="\033[1;33m"
|
||||
BBLUE="\033[1;34m"
|
||||
BPURPLE="\033[1;35m"
|
||||
BCYAN="\033[1;36m"
|
||||
BWHITE="\033[1;37m"
|
||||
UBLACK="\033[4;30m"
|
||||
URED="\033[4;31m"
|
||||
UGREEN="\033[4;32m"
|
||||
UYELLOW="\033[4;33m"
|
||||
UBLUE="\033[4;34m"
|
||||
UPURPLE="\033[4;35m"
|
||||
UCYAN="\033[4;36m"
|
||||
UWHITE="\033[4;37m"
|
||||
ON_BLACK="\033[40m"
|
||||
ON_RED="\033[41m"
|
||||
ON_GREEN="\033[42m"
|
||||
ON_YELLOW="\033[43m"
|
||||
ON_BLUE="\033[44m"
|
||||
ON_PURPLE="\033[45m"
|
||||
ON_CYAN="\033[46m"
|
||||
ON_WHITE="\033[47m"
|
||||
IBLACK="\033[0;90m"
|
||||
IRED="\033[0;91m"
|
||||
IGREEN="\033[0;92m"
|
||||
IYELLOW="\033[0;93m"
|
||||
IBLUE="\033[0;94m"
|
||||
IPURPLE="\033[0;95m"
|
||||
ICYAN="\033[0;96m"
|
||||
IWHITE="\033[0;97m"
|
||||
BIBLACK="\033[1;90m"
|
||||
BIRED="\033[1;91m"
|
||||
BIGREEN="\033[1;92m"
|
||||
BIYELLOW="\033[1;93m"
|
||||
BIBLUE="\033[1;94m"
|
||||
BIPURPLE="\033[1;95m"
|
||||
BICYAN="\033[1;96m"
|
||||
BIWHITE="\033[1;97m"
|
||||
ON_IBLACK="\033[0;100m"
|
||||
ON_IRED="\033[0;101m"
|
||||
ON_IGREEN="\033[0;102m"
|
||||
ON_IYELLOW="\033[0;103m"
|
||||
ON_IBLUE="\033[0;104m"
|
||||
ON_IPURPLE="\033[0;105m"
|
||||
ON_ICYAN="\033[0;106m"
|
||||
ON_IWHITE="\033[0;107m"
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ ! -f ~/.ags_weather ]; then
|
||||
ags --bus-name weather -c ~/dotfiles/ags/weather/config.js &
|
||||
touch ~/.ags_weather
|
||||
else
|
||||
ags --bus-name weather -c ~/dotfiles/ags/weather/config.js --quit
|
||||
rm ~/.ags_weather
|
||||
fi
|
||||
@@ -1,69 +0,0 @@
|
||||
{
|
||||
"bar.customModules.updates.pollingInterval": 1440000,
|
||||
"theme.bar.scaling": 75,
|
||||
"theme.bar.floating": true,
|
||||
"theme.osd.location": "bottom",
|
||||
"theme.osd.orientation": "horizontal",
|
||||
"theme.osd.margins": "0px 5px 15px 0px",
|
||||
"bar.layouts": {
|
||||
"*": {
|
||||
"left": [
|
||||
"dashboard",
|
||||
"cpu",
|
||||
"ram",
|
||||
"weather",
|
||||
"storage",
|
||||
"updates",
|
||||
"windowtitle"
|
||||
],
|
||||
"middle": [
|
||||
"workspaces"
|
||||
],
|
||||
"right": [
|
||||
"media",
|
||||
"volume",
|
||||
"network",
|
||||
"bluetooth",
|
||||
"battery",
|
||||
"systray",
|
||||
"clock",
|
||||
"notifications",
|
||||
"power"
|
||||
]
|
||||
}
|
||||
},
|
||||
"theme.font.name": "JetBrainsMonoNL Nerd Font Propo",
|
||||
"scalingPriority": "hyprland",
|
||||
"theme.font.weight": 400,
|
||||
"menus.dashboard.powermenu.avatar.image": "/home/tola/dotfiles/hypr/pictures/user.jpeg",
|
||||
"menus.dashboard.stats.enable_gpu": true,
|
||||
"theme.bar.menus.menu.dashboard.scaling": 85,
|
||||
"theme.notification.scaling": 75,
|
||||
"theme.bar.border_radius": "0.9em",
|
||||
"theme.bar.margin_sides": "0.5em",
|
||||
"theme.bar.buttons.radius": "0.9em",
|
||||
"theme.bar.buttons.padding_x": "0.7rem",
|
||||
"theme.bar.buttons.spacing": "0.2em",
|
||||
"theme.bar.outer_spacing": "0.5em",
|
||||
"menus.clock.weather.location": "Tomsk",
|
||||
"menus.clock.weather.unit": "metric",
|
||||
"menus.clock.weather.key": "c594dc0d97cc470485474811240409",
|
||||
"bar.customModules.weather.unit": "metric",
|
||||
"bar.customModules.updates.leftClick": "~/dotfiles/hypr/bin/startupdate.sh",
|
||||
"wallpaper.pywal": true,
|
||||
"theme.bar.menus.monochrome": false,
|
||||
"theme.bar.transparent": false,
|
||||
"theme.bar.opacity": 80,
|
||||
"theme.bar.buttons.opacity": 100,
|
||||
"theme.bar.buttons.monochrome": false,
|
||||
"theme.matugen": true,
|
||||
"wallpaper.image": "/home/tola/Pictures/wallpaper/astronaut_jellyfish.jpg",
|
||||
"theme.matugen_settings.mode": "dark",
|
||||
"theme.matugen_settings.scheme_type": "monochrome",
|
||||
"menus.dashboard.directories.left.directory1.command": "bash -c \"thunar $HOME/Downloads/\"",
|
||||
"menus.dashboard.directories.left.directory2.command": "bash -c \"thunar $HOME/Videos/\"",
|
||||
"menus.dashboard.directories.left.directory3.command": "bash -c \"thunar $HOME/Projects/\"",
|
||||
"menus.dashboard.directories.right.directory1.command": "bash -c \"thunar $HOME/Documents/\"",
|
||||
"menus.dashboard.directories.right.directory2.command": "bash -c \"thunar $HOME/Pictures/\"",
|
||||
"menus.dashboard.directories.right.directory3.command": "bash -c \"thunar $HOME/\""
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"theme.bar.buttons.style": "default",
|
||||
"theme.bar.menus.menu.media.card.color": "#303030"
|
||||
}
|
||||
@@ -1,19 +1,7 @@
|
||||
|
||||
#------------- font -------------
|
||||
font_family JetBrainsMono
|
||||
bold_font JetBrainsMono
|
||||
italic_font JetBrainsMono
|
||||
bold_italic_font JetBrainsMono
|
||||
#--------------------------------
|
||||
|
||||
#----- padding --------
|
||||
window_padding_width 5
|
||||
#----------------------
|
||||
|
||||
#----- opacity --------
|
||||
background_opacity 0.8
|
||||
#----------------------
|
||||
|
||||
#---- back blur ---
|
||||
background_blur 10
|
||||
#------------------
|
||||
|
||||
Reference in New Issue
Block a user