Delete Scripts directory

This commit is contained in:
Dante 2024-03-27 10:31:35 -04:00 committed by GitHub
parent 709de241ce
commit 3b13e57ee4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 0 additions and 2196 deletions

View file

@ -1,45 +0,0 @@
# ------------------------------------------- // System
com.github.tchx84.Flatseal # Flatseal
# org.gnome.Boxes # Boxes
# com.usebottles.bottles # Bottles
# io.github.dimtpap.coppwr # Coppwr
# ------------------------------------------- // Browser
com.brave.Browser # Brave
# org.torproject.torbrowser-launcher # Tor
# ------------------------------------------- // Social
# io.github.spacingbat3.webcord # Webcord
# dev.vencord.Vesktop # Vesktop
com.discordapp.Discord # Discord
org.signal.Signal # Signal
# ------------------------------------------- // Productivity
# md.obsidian.Obsidian # Obsidian
# org.mozilla.Thunderbird # Thunderbird
# io.github.alainm23.planify # Planify
# ------------------------------------------- // Image/Graphics
org.inkscape.Inkscape # Inkscape
org.kde.krita # Krita
org.gimp.GIMP # Gimp
org.blender.Blender # Blender
io.gitlab.theevilskeleton.Upscaler # ImageUpscaler
# ------------------------------------------- // Photography
# org.gnome.Shotwell # Shotwell
# org.darktable.Darktable # Darktable
# org.kde.digikam # Digikam
org.gnome.eog # ImageViewer
# ------------------------------------------- // Audio/Video
# com.spotify.Client # Spotify
# org.kde.kdenlive # Kdenlive
com.obsproject.Studio # Obs
com.github.rafostar.Clapper # Clapper
com.github.unrud.VideoDownloader # VideoDownloader
# ------------------------------------------- // Gaming
# hu.kramo.Cartridges # Cartridges
# com.github.Matoking.protontricks # ProtonTricks
# net.davidotek.pupgui2 # ProtonUp

View file

@ -1,34 +0,0 @@
#!/bin/bash
#|---/ /+-----------------------------------+---/ /|#
#|--/ /-| Script to install flatpaks (user) |--/ /-|#
#|-/ /--| Prasanth Rangan |-/ /--|#
#|/ /---+-----------------------------------+/ /---|#
BaseDir=`dirname "$(realpath "$0")"`
ScrDir=`dirname "$(dirname "$(realpath "$0")")"`
source $ScrDir/global_fn.sh
if [ $? -ne 0 ] ; then
echo "Error: unable to source global_fn.sh, please execute from $(dirname "$(realpath "$0")")..."
exit 1
fi
if ! pkg_installed flatpak
then
sudo pacman -S flatpak
fi
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flats=`awk -F '#' '{print $1}' $BaseDir/custom_flat.lst | sed 's/ //g' | xargs`
flatpak install --user -y flathub ${flats}
flatpak remove --unused
GtkTheme=`gsettings get org.gnome.desktop.interface gtk-theme | sed "s/'//g"`
GtkIcon=`gsettings get org.gnome.desktop.interface icon-theme | sed "s/'//g"`
flatpak --user override --filesystem=~/.themes
flatpak --user override --filesystem=~/.icons
flatpak --user override --env=GTK_THEME=${GtkTheme}
flatpak --user override --env=ICON_THEME=${GtkIcon}

View file

@ -1,80 +0,0 @@
#!/bin/env bash
source global_fn.sh
if [ $? -ne 0 ]; then
echo "Error: unable to source global_fn.sh, please execute from $(dirname $(realpath $0))..."
exit 1
fi
hyprland_clone="$HOME/.cache/hyprdots/Hyprland-clone"
chk_aurh
if ! pkg_installed hyprland-git ; then
$aurhlpr ${use_default} -S hyprland-git || true
if ! pkg_installed hyprland-git ; then #? redunduncy
echo -e "\n\033[0;31mWARNING!!! READ ME!\033[0m"
cat << WARN
Hyprland installation failed!
Please check your internet connection and consider reporting the issue to your package manager's support.
For manual installation of Hyprland, you can proceed with this installation or follow the guide at https://wiki.hyprland.org/Getting-Started/Installation/ (Press any key to exit)
Note: This process is a work around.
Typically, it's recommended to use package managers for installations/updates as they handle the process more efficiently.
IMPORTANT: After installation with this method please be aware that you should install hyprland with your package manager if already available.
example: "$aurhlpr -Sy hyprland-git", or run ./install.sh again
The script will now attempt to:
1. Manually compile and install Hyprland.
2. Check and install any missing dependencies.
3. Clone Hyprland to $hyprland_clone
4. Execute [ make all && sudo make install ]
Please ensure you have sufficient permissions, internet connection and disk space for this operation.
WARN
echo ""
read -n 1 -s -r -p "[ENTER/SPACE:yes ANY:no] Do you want to proceed with the installation? " key
[[ -z "$key" ]] || exit 0
echo -e "\nChecking dependencies..."
dependencies=(gdb ninja gcc cmake meson libxcb xcb-proto xcb-util xcb-util-keysyms libxfixes libx11 libxcomposite xorg-xinput libxrender pixman wayland-protocols cairo pango seatd libxkbcommon xcb-util-wm xorg-xwayland libinput libliftoff libdisplay-info cpio tomlplusplus)
missing_dependencies=()
for dependency in "${dependencies[@]}"; do
if ! pkg_installed $dependency; then
missing_dependencies+=($dependency)
fi
done
if [ ${#missing_dependencies[@]} -gt 0 ]; then
echo "Missing dependencies: ${missing_dependencies[@]}"
echo "Installing missing dependencies..."
$aurhlpr ${use_default} -S ${missing_dependencies[@]}
fi
if cd "$hyprland_clone" 2>/dev/null; then
git fetch
if [ "$(git rev-parse HEAD)" != "$(git rev-parse @{u})" ]; then
echo "Changes are available in the remote repository. Pulling changes..."
git reset --hard
git clean -fd
git pull
else
if command -v Hyprland >/dev/null; then
echo -e "\033[1;33mLatest version of Hyprland is already compiled and installed!\033[0m"
exit 0
fi
fi
else
mkdir -p "$hyprland_clone"
git clone --recursive https://github.com/hyprwm/Hyprland "$hyprland_clone"
cd $hyprland_clone
fi
echo "Compiling Directory: $(pwd)"
make all && sudo make install
fi
else
echo -e "\033[0;32m[OK]\033[0m Hyprland"
fi

View file

@ -1,17 +0,0 @@
#!/bin/bash
#|---/ /+-----------------------------------------------+---/ /|#
#|--/ /-| Script to enable early loading for nvidia drm |--/ /-|#
#|-/ /--| Prasanth Rangan |-/ /--|#
#|/ /---+-----------------------------------------------+/ /---|#
if [ `lspci -k | grep -A 2 -E "(VGA|3D)" | grep -i nvidia | wc -l` -gt 0 ] ; then
if [ `grep 'MODULES=' /etc/mkinitcpio.conf | grep nvidia | wc -l` -eq 0 ] ; then
sudo sed -i "/MODULES=/ s/)$/ nvidia nvidia_modeset nvidia_uvm nvidia_drm)/" /etc/mkinitcpio.conf
sudo mkinitcpio -P
if [ `grep 'options nvidia-drm modeset=1' /etc/modprobe.d/nvidia.conf | wc -l` -eq 0 ] ; then
echo 'options nvidia-drm modeset=1' | sudo tee -a /etc/modprobe.d/nvidia.conf
fi
fi
fi

View file

@ -1,2 +0,0 @@
/dev/sdb1
/dev/nvme0n1p1

View file

@ -1,71 +0,0 @@
#!/bin/bash
#|---/ /+---------------------------+---/ /|#
#|--/ /-| Script to mount my drives |--/ /-|#
#|-/ /--| Prasanth Rangan |-/ /--|#
#|/ /---+---------------------------+/ /---|#
# function to check device parameters
chk_blk()
{
local BlkParm=$1
local MyDrive=$2
local ChkFlag=$3
BlkVal=`lsblk --noheadings --raw -o $BlkParm $MyDrive`
if [ ! -z $BlkVal ] && [ $ChkFlag == 'y' ] ; then
#echo "$MyDrive : $BlkParm is $BlkVal"
return 0
elif [ -z $BlkVal ] && [ $ChkFlag == 'n' ] ; then
#echo "$MyDrive : $BlkParm not available"
return 0
else
return 1
fi
}
ext_lab()
{
local MyMount=$1
local MyLabel=$2
local MyDrive=""
MyDrive=`findmnt --mountpoint $MyMount --noheadings -o source`
if [ `lsblk --noheadings --raw -o fstype $MyDrive` == "ext4" ] && chk_blk label $MyDrive n ; then
sudo e2label $MyDrive $MyLabel
fi
}
# main loop to mount listed partition
while read dev_part
do
if chk_blk uuid $dev_part y && chk_blk label $dev_part y && chk_blk mountpoint $dev_part n ; then
dev_label=`lsblk --noheadings --raw -o label $dev_part`
dev_uuid=`lsblk --noheadings --raw -o uuid $dev_part`
dev_fstype=`lsblk --noheadings --raw -o fstype $dev_part`
if [ ! -d /mnt/$dev_label ] ; then
sudo mkdir /mnt/$dev_label
echo "/mnt/$dev_label dir created..."
fi
if [ `grep $dev_uuid /etc/fstab | wc -l` -eq 0 ] ; then
fstEntry=`echo -e "${fstEntry}\n# $dev_part \nUUID=$dev_uuid /mnt/$dev_label \t$dev_fstype \t\tnosuid,nodev,nofail,x-gvfs-show \t 0 0\n "`
fi
sudo mount $dev_part /mnt/$dev_label
fi
done < mnt_drives.lst
echo -e "${fstEntry}\n" | sudo tee -a /etc/fstab
sudo systemctl daemon-reload
ext_lab '/home' '9S'
ext_lab '/' 'YoRHa'

View file

@ -1,84 +0,0 @@
#!/bin/bash
#|---/ /+-----------------------------+---/ /|#
#|--/ /-| Script to configure my apps |--/ /-|#
#|-/ /--| Prasanth Rangan |-/ /--|#
#|/ /---+-----------------------------+/ /---|#
ScrDir=`dirname "$(dirname "$(realpath "$0")")"`
source $ScrDir/global_fn.sh
if [ $? -ne 0 ] ; then
echo "Error: unable to source global_fn.sh, please execute from $(dirname "$(realpath "$0")")..."
exit 1
fi
CloneDir=`dirname "$(realpath $CloneDir)"`
# icons
if [ -f /usr/share/applications/rofi-theme-selector.desktop ] && [ -f /usr/share/applications/rofi.desktop ]
then
sudo rm /usr/share/applications/rofi-theme-selector.desktop
sudo rm /usr/share/applications/rofi.desktop
fi
sudo sed -i "/^Icon=/c\Icon=adjust-colors" /usr/share/applications/nwg-look.desktop
sudo sed -i "/^Icon=/c\Icon=spectacle" /usr/share/applications/swappy.desktop
# steam
#if pkg_installed steam
# then
# skinsDir="${XDG_DATA_HOME:-$HOME/.local/share}/Steam/Skins/"
# if [ ! -d "$skinsDir" ]
# then
# mkdir -p "$skinsDir"
# fi
# tar -xzf ${CloneDir}/Source/arcs/Steam_Metro.tar.gz -C "$skinsDir"
#fi
# spotify
if pkg_installed spotify && pkg_installed spicetify-cli
then
if [ ! -w /opt/spotify ] || [ ! -w /opt/spotify/Apps ]; then
sudo chmod a+wr /opt/spotify
sudo chmod a+wr /opt/spotify/Apps -R
fi
spicetify &> /dev/null
mkdir -p ~/.config/spotify
touch ~/.config/spotify/prefs
sptfyConf=$(spicetify -c)
sed -i "/^prefs_path/ s+=.*$+= $HOME/.config/spotify/prefs+g" "${sptfyConf}"
tar -xzf ${CloneDir}/Source/arcs/Spotify_Sleek.tar.gz -C ~/.config/spicetify/Themes/
spicetify backup apply
spicetify config current_theme Sleek
spicetify config color_scheme Wallbash
spicetify apply
fi
# firefox
if pkg_installed firefox
then
FoxRel=$(find ~/.mozilla/firefox -maxdepth 1 -type d -name "*.default-release" | head -1)
if [ -z "${FoxRel}" ] ; then
firefox &> /dev/null &
sleep 1
FoxRel=$(find ~/.mozilla/firefox -maxdepth 1 -type d -name "*.default-release" | head -1)
else
BkpDir="${HOME}/.config/cfg_backups/$(date +'%y%m%d_%Hh%Mm%Ss')_apps"
mkdir -p "${BkpDir}"
cp -r ~/.mozilla/firefox "${BkpDir}"
fi
tar -xzf ${CloneDir}/Source/arcs/Firefox_UserConfig.tar.gz -C "${FoxRel}"
tar -xzf ${CloneDir}/Source/arcs/Firefox_Extensions.tar.gz -C ~/.mozilla/
find ~/.mozilla/extensions -maxdepth 1 -type f -name "*.xpi" | while read fext
do
firefox -profile "${FoxRel}" "${fext}" &> /dev/null &
done
fi

View file

@ -1,16 +0,0 @@
NV50|NV50|G80|GeForce 8800 (GTS, GTX, Ultra), Quadro FX (4600 (SDI), 5600)
NV50|NV84|G84|GeForce 8600 (GT, GTS, M GT, M GS), 8700M GT, GeForce 9500M GS, 9650M GS, Quadro FX (370, 570, 570M, 1600M, 1700), NVS 320M
NV50|NV86|G86|GeForce 8300 GS, 8400 (GS, M G, M GS, M GT), 8500 GT, GeForce 9300M G, Quadro FX 360M, NVS (130M, 135M, 140M, 290)
NV50|NV92|G92|GeForce 8800 (GT, GS, GTS 512, M GTS, M GTX), GeForce 9600 GSO, 9800 (GT, GTX, GTX+, GX2, M GT, M GTX), GeForce GTS 150(M), GTS 160M, GTS 240, GTS 250, GTX (260M, 280M, 285M), GT (330, 340), Quadro FX (2800M, 3600M, 3700, 3700M, 3800M, 4700 X2), VX 200
NV50|NV94|G94|GeForce 9600 (GSO 512, GT, S), 9700M GTS, 9800M GTS, GeForce G 110M, GT 130(M), GT 140, Quadro FX (1800, 2700M)
NV50|NV96|G96|GeForce 9400 GT, 9500 (GT, M G), 9600 (M GS, M GT), 9650M GT, 9700M GT, GeForce G 102M, GT 120, Quadro FX (380, 580, 770M, 1700M)
NV50|NV98|G98|GeForce 8400 GS, GeForce 9200M GS, 9300 (GE, GS, M GS), GeForce G 100, G 105M, Quadro FX (370 LP, 370M), NVS (150M, 160M, 295, 420, 450)
NV50|NVA0|GT200|GeForce GTX (260, 275, 280, 285, 295), Quadro CX, FX (3800, 4800, 5800)
NV50|NVA3|GT215|GeForce GT (240, 320, 335M), GTS (250M, 260M, 350M, 360M), Quadro FX 1800M
NV50|NVA5|GT216|GeForce GT (220, 230M, 240M, 325M, 330M), 315, Quadro 400, FX 880M, NVS 5100M
NV50|NVA8|GT218|GeForce 8400 GS, ION 2, GeForce 205, 210, G 210M, 305M, 310(M), 405, Quadro FX (380 LP, 380M), NVS (300, 2100M, 3100M)
NV50|NVAA|MCP77|GeForce 8100, 8200, 8300 mGPU
NV50|NVAA|MCP78|nForce 700a series, 8200M G
NV50|NVAC|MCP79|ION, GeForce 9300, 9400 mGPU
NV50|NVAC|MCP7A|nForce 700i series, 8200M G, 9100M, 9400M (G)
NV50|NVAF|MCP89|GeForce 320M

View file

@ -1,9 +0,0 @@
NVC0|NVC0|GF100|GeForce GTX (465, 470, 480, 480M), Quadro 4000, 5000[M] (??), 6000
NVC0|NVC1|GF108|GeForce GT (415M, 420, 420M, 425M, 430, 435M, 520M, 525M, 530, 540M, 550M, 555M, 620, 630M, 635M, 640M LE), Quadro 600, 1000M
NVC0|NVC3|GF106|GeForce GT (440, 445M, 545, 555M, 630M, 635M), GTS 450, GTX 460M, Quadro 2000 (D), 2000M
NVC0|NVC4|GF104|GeForce GTX (460, 460 SE, 470M, 485M), Quadro 5000M (??)
NVC0|NVC8|GF110|GeForce GTX (560 Ti OEM, 570, 580, 590), Quadro 3000M, 4000M, 5010M
NVC0|NVCE|GF114|GeForce GTX (460 v2, 560, 560 Ti, 570M, 580M, 670M, 675M)
NVC0|NVCF|GF116|GeForce GTS 450 v2, GTX (550 Ti, 560M)
NVC0|NVD7|GF117|Geforce GT 620M, 625M, (some) 630M, 710M, 720M
NVC0|NVD9|GF119|GeForce 410M, 510 (?), GT (520, 520M, 520MX, 610), 610M, Quadro NVS 4200M

View file

@ -1,9 +0,0 @@
NVE0|NVE4|GK104|GeForce GTX (660 Ti, 670[M], 680[M], 690, 760, 760 Ti, 770, 775M, 780M, 860M), Quadro K3000[M], K3100M, K4000[M], K4100[M], K5000[M], K5100M, Tesla K10
NVE0|NVE7|GK107|GeForce GT (640[M], 645M, 650M, 710M, 720M, 730M, 740[M], 745M, 750M, 755M), GTX (650, 660M), Quadro 410, K500[M], K600, K1000[M], K1100M, K2000[M], NVS 510, 1000
NVE0|NVE6|GK106|GeForce GTX (645, 650 Ti, 660, 760M, 765M, 770M), Quadro K2100M, K4000
NVE0|NVF0|GK110|GeForce GTX 780, Titan, Tesla K20, Quadro K6000
NVE0|NVF1|GK110B|GeForce GTX 780 Ti, Titan Z, Tesla K40
NVE0|NV106|GK208B|GeForce GT 720
NVE0|NV108|GK208|GeForce GT 630, 635, 640, 710M, 720M, 730M, 735M, 740M, 920M, Quadro K510M, K610M
NVE0|NVEA|GK20A|Tegra K1
NVE0|NV???|GK210|Tesla K80

View file

@ -1,26 +0,0 @@
NV110|NV117|GM107|GeForce GTX (745, 750, 750 Ti, 840M, 845M, 850M, 860M, 950M, 960M) Quadro K620, K1200, K2200, M1000M, M1200M; GRID M30, M40
NV110|NV118|GM108|GeForce 830M, 840M, 930M, 940M[X]
NV110|NV120|GM200|GeForce GTX Titan X
NV110|NV124|GM204|GeForce GTX (970, 980)
NV110|NV126|GM206|GeForce GTX (950, 960)
NV110|NV12B|GM20B|Tegra X1
NV130|NV132|GP102|NVIDIA Titan (X, Xp), GeForce GTX 1080 Ti
NV130|NV134|GP104|GeForce GTX (1070, 1080)
NV130|NV136|GP106|GeForce GTX 1060
NV130|NV137|GP107|GeForce GTX (1050, 1050 Ti)
NV130|NV138|GP108|GeForce GT 1030
NV140|NV140|GV100|NVIDIA Titan V, NVIDIA Quadro GV100
NV160|NV162|TU102|NVIDIA Titan RTX, GeForce RTX 2080 Ti
NV160|NV164|TU104|GeForce RTX (2070 Super, 2080, 2080 Super)
NV160|NV166|TU106|GeForce RTX (2060, 2060 Super, 2070)
NV160|NV168|TU116|GeForce GTX (1650 Super, 1660, 1660 Ti, 1660 Super)
NV160|NV167|TU117|GeForce GTX 1650
NV170|NV172|GA102|GeForce RTX (3080, 3090)
NV170|NV174|GA104|GeForce RTX (3060 Ti, 3070, 3080 Mobile)
NV170|NV176|GA106|GeForce RTX (3050, 3060)
NV170|NV177|GA107|GeForce RTX 3050
NV190|NV192|AD102|GeForce RTX 4090
NV190|NV193|AD103|GeForce RTX 4080
NV190|NV194|AD104|GeForce RTX (4070, 4070 Ti)
NV190|NV196|AD106|GeForce RTX 4060 Ti
NV190|NV197|AD107|GeForce RTX 4060

View file

@ -1,26 +0,0 @@
#!/bin/bash -
Usage() { echo "$0 FontFile"; exit 1; }
SayError() { local error=$1; shift; echo "$0: $@"; exit "$error"; }
[ "$#" -ne 1 ] && Usage
width=70
fontfile="$1"
[ -f "$fontfile" ] || SayError 4 'File not found'
list=$(fc-query --format='%{charset}\n' "$fontfile")
for range in $list
do IFS=- read start end <<<"$range"
if [ "$end" ] ; then
start=$((16#$start))
end=$((16#$end))
for((i=start;i<=end;i++)) ; do
printf -v char '\\U%x' "$i"
printf '%b' "$char"
done
else
printf '%b' "\\U$start"
fi
done | grep -oP '.{'"$width"'}'

View file

@ -1,65 +0,0 @@
#!/bin/bash
#|---/ /+--------------------------+---/ /|#
#|--/ /-| Main installation script |--/ /-|#
#|-/ /--| Prasanth Rangan |-/ /--|#
#|/ /---+--------------------------+/ /---|#
#--------------------------------#
# import variables and functions #
#--------------------------------#
source global_fn.sh
if [ $? -ne 0 ] ; then
echo "Error: unable to source global_fn.sh, please execute from $(dirname "$(realpath "$0")")..."
exit 1
fi
#----------------------#
# prepare package list #
#----------------------#
cp custom_hypr.lst install_pkg.lst
if [ -f "$1" ] && [ ! -z "$1" ] ; then
cat $1 >> install_pkg.lst
fi
#--------------------------------#
# add nvidia drivers to the list #
#--------------------------------#
if [ `lspci -k | grep -A 2 -E "(VGA|3D)" | grep -i nvidia | wc -l` -gt 0 ] ; then
cat /usr/lib/modules/*/pkgbase | while read krnl
do
echo "${krnl}-headers" >> install_pkg.lst
done
echo -e "nvidia-dkms\nnvidia-utils" >> install_pkg.lst
sed -i "s/^hyprland-git/hyprland-nvidia-git/g" install_pkg.lst
else
echo "nvidia card not detected, skipping nvidia drivers..."
fi
#--------------------------------#
# install packages from the list #
#--------------------------------#
./install_pkg.sh install_pkg.lst
#---------------------------#
# restore my custom configs #
#---------------------------#
./restore_fnt.sh
./restore_cfg.sh
./restore_sgz.sh
#------------------------#
# enable system services #
#------------------------#
service_ctl NetworkManager
service_ctl bluetooth
service_ctl sddm

View file

@ -1,32 +0,0 @@
#!/bin/bash
#|---/ /+--------------------------------------+---/ /|#
#|--/ /-| Script to compare git and local dots |--/ /-|#
#|-/ /--| Prasanth Rangan |-/ /--|#
#|/ /---+--------------------------------------+/ /---|#
source global_fn.sh
if [ $? -ne 0 ] ; then
echo "Error: unable to source global_fn.sh, please execute from $(dirname "$(realpath "$0")")..."
exit 1
fi
CfgDir=`echo $CloneDir/Configs`
while read lst
do
pth=`echo $lst | awk -F '|' '{print $1}'`
cfg=`echo $lst | awk -F '|' '{print $2}'`
pth=`eval echo $pth`
echo "${cfg}" | xargs -n 1 | while read cfg_chk
do
tgt=`echo $pth | sed "s+^${HOME}++g"`
if [ `diff -qr --no-dereference ${pth}/$cfg_chk $CfgDir$tgt/$cfg_chk | wc -l` -gt 0 ]
then
echo "diff found ${pth}/$cfg_chk <--> $CfgDir$tgt/$cfg_chk"
fi
done
done < restore_conf.lst

View file

@ -1,105 +0,0 @@
#! /usr/bin/python3
# |---/ /+----------------------------------------+---/ /|#
# |--/ /-| Script to install pkgs from input list |--/ /-|#
# |-/ /--| Effibot |-/ /--|#
# |/ /---+----------------------------------------+/ /---|#
import argparse
# get reference to directories
# ZSH_FOLDER="/usr/share/oh-my-zsh"
import os
from os.path import exists, expanduser, isdir, join
# define folders
global ZSH_FOLDER
global ZSH_CUSTOM_PLUGINS
global WORKARAOUND
global RC_FILE
# those folders are hardcoded for now because the script is
# meant to be used with the configuration of main install script
ZSH_FOLDER = expanduser("/usr/share/oh-my-zsh")
ZSH_CUSTOM_PLUGINS = join(ZSH_FOLDER, "custom/plugins")
WORKARAOUND = False
RC_FILE = os.getenv('ZDOTDIR', default='') if os.getenv('ZDOTDIR', default='') != '' else expanduser(f"/home/{os.getlogin()}/.zshrc")
# this is a workaround string to be able to load the completion plugin manually
workaround = "fpath+=${ZSH_CUSTOM:-${ZSH:-/usr/share/oh-my-zsh}/custom}/plugins/zsh-completions/src"
def get_plugin_list(input_file):
# read the input file
with open(input_file, "r") as f:
plugin_list = [line.strip() for line in f.readlines()]
if "zsh-completions" in plugin_list:
WORKARAOUND = True
return plugin_list
def generate_plugin_block(plugin_list):
"""generate the line for the .zshrc file to load the plugins"""
line = "plugins=("
to_download = []
for plugin in plugin_list:
# checks if the plugin comes from a git repo
if plugin.startswith("http"):
# if it does, append it to the list of plugins to download
to_download.append(plugin)
# get the name of the plugin and append it to the line
plugin_name = plugin.split("/")[-1].split(".")[0]
line += f"{plugin_name} "
else:
# if not, it is assumed that the plugin is in the default plugin folder
line += f"{plugin} "
line += ")\n"
return line, to_download
def download_plugins(to_download):
"""downloads the plugins from the list of plugins"""
for plugin in to_download:
plugin_name = plugin.split("/")[-1].split(".")[0]
plugin_folder = join(ZSH_CUSTOM_PLUGINS, plugin_name)
if not exists(plugin_folder) and not isdir(plugin_folder):
# os.makedirs(plugin_folder)
print(f"Downloading plugins: {plugin_name} from {plugin}")
os.system(f"git clone {plugin} {plugin_folder}")
else:
print(f"Plugin {plugin_name} already exists")
def main(input_file) -> None:
print("\nInstalling ZSH plugins\n")
# get the list of plugins
plugin_list = get_plugin_list(input_file)
# generate the line to be added to the .zshrc file
plugin_line, to_download = generate_plugin_block(plugin_list)
print(f"Your desired plugins are: {plugin_line}")
if WORKARAOUND:
print("Workaround is needed to load the completion plugin")
plugin_line += workaround + "\n"
# download the plugins
download_plugins(to_download)
# add the line to the .zshrc file
updated_line = ""
print(f"rc file is {RC_FILE}")
try:
with open(RC_FILE, "r") as f:
# search for the line that loads the plugins
f_content = f.read()
updated_line = f_content.replace("plugins=(git)", plugin_line)
with open(RC_FILE, "w") as g:
g.write(updated_line)
print("Plugin list updated")
except FileNotFoundError:
print("File not found")
except IOError as e:
print(f"IO error -> {e}")
if __name__ == "__main__":
parser = argparse.ArgumentParser("Input file containing list of plugins")
parser.add_argument("-f", help="Input file containing list of plugins")
input_file = parser.parse_args().f
main(input_file)

View file

@ -1,62 +0,0 @@
#!/bin/bash
# Check if dotfiles directory exists
if [ ! -d ~/dotfiles ]; then
echo "Dotfiles directory not found. Please clone the repository manually."
exit 1
fi
# Copy .config folders from ~/.config to dotfiles repository
cp -r ~/.config/* ~/dotfiles/.config/
# Check if the copy was successful
if [ $? -ne 0 ]; then
echo "Failed to copy .config folders to dotfiles repository. Exiting."
exit 1
fi
echo ".config folders copied to dotfiles repository successfully."
# Copy .config folders to ~/.config
cp -r ~/dotfiles/.config/* ~/.config/
# Check if the copy was successful
if [ $? -ne 0 ]; then
echo "Failed to copy .config folders. Exiting."
exit 1
fi
echo "Dotfiles .config folders copied successfully."
# Define the directories containing the scripts
hypr_script_dir="$HOME/.config/hypr/scripts"
dotfiles_script_dir="$HOME/dotfiles/Scripts"
# Function to make scripts executable
make_executable() {
local dir=$1
# Check if the directory exists
if [ -d "$dir" ]; then
# Change directory to the specified directory
cd "$dir" || exit
# Loop through each file in the directory
for file in *; do
# Check if the file is a regular file and not a directory
if [ -f "$file" ]; then
# Make the file executable
chmod +x "$file"
echo "Made $file executable."
fi
done
else
echo "Directory $dir does not exist."
fi
}
# Make scripts in ~/.config/hypr/scripts executable
make_executable "$hypr_script_dir"
# Make scripts in ~/dotfiles/Scripts executable
make_executable "$dotfiles_script_dir"

View file

@ -1,107 +0,0 @@
#!/bin/bash
#|---/ /+------------------------------------+---/ /|#
#|--/ /-| Script to generate wallpaper cache |--/ /-|#
#|-/ /--| Kemipso |-/ /--|#
#|/ /---+------------------------------------+/ /---|#
source global_fn.sh
if [ $? -ne 0 ] ; then
echo "Error: unable to source global_fn.sh, please execute from $(dirname "$(realpath "$0")")..."
exit 1
fi
if ! pkg_installed imagemagick || ! pkg_installed parallel
then
echo "ERROR : dependency failed, imagemagick/parallel is not installed..."
exit 0
fi
# set variables
ctlLine=`grep '^1|' ${ThemeCtl}`
export cacheDir="$HOME/.cache/hyprdots"
# evaluate options
while getopts "fc:" option ; do
case $option in
f ) # force remove cache
rm -Rf ${cacheDir}
echo "Cache dir ${cacheDir} cleared...";;
c ) # use custom wallpaper
inWall="$OPTARG"
if [[ "${inWall}" == '~'* ]]; then
inWall="$HOME${inWall:1}"
fi
if [[ -f "${inWall}" ]] ; then
if [ `echo "$ctlLine" | wc -l` -eq "1" ] ; then
curTheme=$(echo "$ctlLine" | cut -d '|' -f 2)
awk -F '|' -v thm="${curTheme}" -v wal="${inWall}" '{OFS=FS} {if($2==thm)$NF=wal;print$0}' "${ThemeCtl}" > /tmp/t2 && mv /tmp/t2 "${ThemeCtl}"
else
echo "ERROR : ${ThemeCtl} Unable to fetch theme..."
exit 1
fi
else
echo "ERROR: wallpaper ${inWall} not found..."
exit 1
fi ;;
* ) # invalid option
echo "...valid options are..."
echo "./create_cache.sh -f # force create thumbnails (delete old cache)"
echo "./create_cache.sh -c /path/to/wallpaper # generate cache for custom walls"
exit 1 ;;
esac
done
shift $((OPTIND - 1))
ctlRead=$(awk -F '|' -v thm="${1}" '{if($2==thm) print$0}' "${ThemeCtl}")
[ -z "${ctlRead}" ] && ctlRead=$(cat "${ThemeCtl}")
# magick function
imagick_t2 () {
theme="$1"
wpFullName="$2"
wpBaseName=$(basename "${wpFullName}")
if [ ! -f "${cacheDir}/${theme}/${wpBaseName}" ]; then
convert "${wpFullName}"[0] -thumbnail 500x500^ -gravity center -extent 500x500 "${cacheDir}/${theme}/${wpBaseName}"
fi
if [ ! -f "${cacheDir}/${theme}/${wpBaseName}.rofi" ]; then
convert -strip -resize 2000 -gravity center -extent 2000 -quality 90 "${wpFullName}"[0] "${cacheDir}/${theme}/${wpBaseName}.rofi"
fi
if [ ! -f "${cacheDir}/${theme}/${wpBaseName}.blur" ]; then
convert -strip -scale 10% -blur 0x3 -resize 100% "${wpFullName}"[0] "${cacheDir}/${theme}/${wpBaseName}.blur"
fi
if [ ! -f "${cacheDir}/${theme}/${wpBaseName}.dcol" ] ; then
./wallbash.sh "${wpFullName}" &> /dev/null
fi
}
export -f imagick_t2
# create thumbnails for each theme > wallpapers
echo "${ctlRead}" | while read ctlLine
do
theme=$(echo $ctlLine | awk -F '|' '{print $2}')
fullPath=$(echo "$ctlLine" | awk -F '|' '{print $NF}' | sed "s+~+$HOME+")
wallPath=$(dirname "$fullPath")
mkdir -p ${cacheDir}/${theme}
mapfile -d '' wpArray < <(find "${wallPath}" -type f \( -iname "*.gif" -o -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) -print0 | sort -z)
echo "Creating thumbnails for ${theme} [${#wpArray[@]}]"
parallel --bar imagick_t2 ::: "${theme}" ::: "${wpArray[@]}"
if pkg_installed code ; then
if [ ! -z "$(echo $ctlLine | awk -F '|' '{print $3}')" ] ; then
codex=$(echo $ctlLine | awk -F '|' '{print $3}' | cut -d '~' -f 1)
if [ $(code --list-extensions | grep -iwc "${codex}") -eq 0 ] ; then
code --install-extension "${codex}" 2> /dev/null || true
fi
fi
fi
done

View file

@ -1,11 +0,0 @@
#neovim
#emote
#trash-cli-git
#downgrade
steam
gamemode
#gamescope
#mangohud
#cava
spotify
spicetify-cli

View file

@ -1,86 +0,0 @@
# --------------------------------------------------- // System
pipewire # audio/video server
pipewire-alsa # pipewire alsa client
pipewire-audio # pipewire audio client
pipewire-jack # pipewire jack client
pipewire-pulse # pipewire pulseaudio client
gst-plugin-pipewire # pipewire gstreamer client
wireplumber # pipewire session manager
pavucontrol # pulseaudio volume control
pamixer # pulseaudio cli mixer
networkmanager # network manager
network-manager-applet # network manager system tray utility
bluez # bluetooth protocol stack
bluez-utils # bluetooth utility cli
blueman # bluetooth manager gui
brightnessctl # screen brightness control
# --------------------------------------------------- // Display Manager
sddm # display manager for KDE plasma
qt5-quickcontrols # for sddm theme ui elements
qt5-quickcontrols2 # for sddm theme ui elements
qt5-graphicaleffects # for sddm theme effects
# --------------------------------------------------- // Window Manager
hyprland # wlroots-based wayland compositor
rofi-lbonn-wayland-git # application launcher
swaync # notification center
waybar # system bar
swww # wallpaper
wlogout # logout menu
hyprlock # lock screen
grimblast-git # screenshot tool
slurp # region select for screenshot/screenshare
swappy # screenshot editor
# --------------------------------------------------- // Dependencies
polkit-kde-agent # authentication agent
xdg-desktop-portal-hyprland # xdg desktop portal for hyprland
pacman-contrib # for system update check
python-pyamdgpuinfo # for amd gpu info
parallel # for parallel processing
jq # for json processing
imagemagick # for image processing
qt5-imageformats # for dolphin image thumbnails
ffmpegthumbs # for dolphin video thumbnails
kde-cli-tools # for dolphin file type defaults
kservice5
cpio
meson
cmake
# --------------------------------------------------- // Theming
nwg-look # gtk configuration tool
qt5ct # qt5 configuration tool
qt6ct # qt6 configuration tool
kvantum # svg based qt theme engine
qt5-wayland # wayland support in qt5
qt6-wayland # wayland support in qt6
# --------------------------------------------------- // Applications
firefox # browser
kitty # terminal
dolphin # kde file manager
ark # kde file archiver
vim # terminal text editor
visual-studio-code-bin # ide text editor
cava # audio visualizer
discord
# --------------------------------------------------- // Shell
eza|zsh # file lister for zsh
oh-my-zsh-git|zsh # plugin manager for zsh
zsh-theme-powerlevel10k|zsh oh-my-zsh-git # theme for zsh
lsd|fish # file lister for fish
starship|fish # customizable shell prompt
neofetch # fetch tool
otf-font-awesome
ttf-firacode-nerd
ttf-arimo-nerd noto-fonts
python-pywal
pyprland

View file

@ -1,110 +0,0 @@
#!/bin/bash
#|---/ /+------------------+---/ /|#
#|--/ /-| Global functions |--/ /-|#
#|-/ /--| Prasanth Rangan |-/ /--|#
#|/ /---+------------------+/ /---|#
set -e
CloneDir=`dirname "$(dirname "$(realpath "$0")")"`
ConfDir="${XDG_CONFIG_HOME:-$HOME/.config}"
HyprdotsDir="${ConfDir}/hyprdots"
ThemeCtl="${HyprdotsDir}/theme.ctl"
service_ctl()
{
local ServChk=$1
if [[ $(systemctl list-units --all -t service --full --no-legend "${ServChk}.service" | sed 's/^\s*//g' | cut -f1 -d' ') == "${ServChk}.service" ]]
then
echo "$ServChk service is already enabled, enjoy..."
else
echo "$ServChk service is not running, enabling..."
sudo systemctl enable ${ServChk}.service
sudo systemctl start ${ServChk}.service
echo "$ServChk service enabled, and running..."
fi
}
pkg_installed()
{
local PkgIn=$1
if pacman -Qi $PkgIn &> /dev/null
then
#echo "${PkgIn} is already installed..."
return 0
else
#echo "${PkgIn} is not installed..."
return 1
fi
}
pkg_available()
{
local PkgIn=$1
if pacman -Si $PkgIn &> /dev/null
then
#echo "${PkgIn} available in arch repo..."
return 0
else
#echo "${PkgIn} not available in arch repo..."
return 1
fi
}
chk_aurh()
{
if pkg_installed yay
then
aurhlpr="yay"
elif pkg_installed paru
then
aurhlpr="paru"
fi
}
aur_available()
{
local PkgIn=$1
chk_aurh
if $aurhlpr -Si $PkgIn &> /dev/null
then
#echo "${PkgIn} available in aur repo..."
return 0
else
#echo "aur helper is not installed..."
return 1
fi
}
nvidia_detect()
{
if [ `lspci -k | grep -A 2 -E "(VGA|3D)" | grep -i nvidia | wc -l` -gt 0 ]
then
#echo "nvidia card detected..."
return 0
else
#echo "nvidia card not detected..."
return 1
fi
}
prompt_timer()
{
set +e
local timsec=$1
local msg=$2
local pread=""
while [[ $timsec -ge 0 ]] ; do
echo -ne "\033[0K\r${msg} (${timsec}s) : "
read -t 1 -n 1 -s promptIn
[ $? -eq 0 ] && break
((timsec--))
done
export promptIn
echo ${promptIn}
set -e
}

View file

@ -1,160 +0,0 @@
#!/bin/bash
#|---/ /+--------------------------+---/ /|#
#|--/ /-| Main installation script |--/ /-|#
#|-/ /--| Prasanth Rangan |-/ /--|#
#|--/ /-| xSghetti Edit |--/ /-|#
#|/ /---+--------------------------+/ /---|#
cat <<"EOF"
------------------------------------------------------------------------------------
_____ _ _ _ _ _____ _____
_ _| __|___| |_ ___| |_| |_|_| _ _ | | |_ _ ___ ___| |___ _ _ _ _
|_'_|__ | . | | -_| _| _| | |_'_| | | | | . | _| --| _| | |_'_|
|_,_|_____|_ |_|_|___|_| |_| |_| |_,_| |__|__|_ | _|_| |_____|_| |___|_,_|
|___| |___|_|
------------------------------------------------------------------------------------
EOF
#--------------------------------#
# import variables and functions #
#--------------------------------#
source global_fn.sh
if [ $? -ne 0 ]; then
echo "Error: unable to source global_fn.sh, please execute from $(dirname "$(realpath "$0")")..."
exit 1
fi
#------------------#
# evaluate options #
#------------------#
flg_Install=0
flg_Restore=0
flg_Service=0
while getopts idrs RunStep; do
case $RunStep in
i) flg_Install=1 ;;
d) flg_Install=1
export use_default="--noconfirm" ;;
r) flg_Restore=1 ;;
s) flg_Service=1 ;;
*) echo "...valid options are..."
echo "i : [i]nstall hyprland without configs"
echo "d : install hyprland [d]efaults without configs --noconfirm"
echo "r : [r]estore config files"
echo "s : enable system [s]ervices"
exit 1 ;;
esac
done
if [ $OPTIND -eq 1 ]; then
flg_Install=1
flg_Restore=1
flg_Service=1
fi
#--------------------#
# pre-install script #
#--------------------#
if [ $flg_Install -eq 1 ] && [ $flg_Restore -eq 1 ]; then
cat <<"EOF"
_ _ _ _
___ ___ ___ |_|___ ___| |_ ___| | |
| . | _| -_| | | |_ -| _| .'| | |
| _|_| |___| |_|_|_|___|_| |__,|_|_|
|_|
EOF
./install_pre.sh
fi
#------------#
# installing #
#------------#
if [ $flg_Install -eq 1 ]; then
cat <<"EOF"
_ _ _ _ _
|_|___ ___| |_ ___| | |_|___ ___
| | |_ -| _| .'| | | | | . |
|_|_|_|___|_| |__,|_|_|_|_|_|_ |
|___|
EOF
#----------------------#
# prepare package list #
#----------------------#
shift $((OPTIND - 1))
cust_pkg=$1
cp custom_hypr.lst install_pkg.lst
if [ -f "$cust_pkg" ] && [ ! -z "$cust_pkg" ]; then
cat $cust_pkg >>install_pkg.lst
fi
#-----------------------#
# add shell to the list #
#-----------------------#
if ! pkg_installed zsh && ! pkg_installed fish ; then
echo -e "Select shell:\n1) zsh\n2) fish"
read -p "Enter option number : " gsh
case $gsh in
1) export getShell="zsh" ;;
2) export getShell="fish" ;;
*) echo -e "...Invalid option selected..."
exit 1 ;;
esac
echo "${getShell}" >>install_pkg.lst
fi
#--------------------------------#
# add nvidia drivers to the list #
#--------------------------------#
if nvidia_detect; then
cat /usr/lib/modules/*/pkgbase | while read krnl; do
echo "${krnl}-headers" >>install_pkg.lst
done
IFS=$' ' read -r -d '' -a nvga < <(lspci -k | grep -E "(VGA|3D)" | grep -i nvidia | awk -F ':' '{print $NF}' | tr -d '[]()' && printf '\0')
for nvcode in "${nvga[@]}"; do
awk -F '|' -v nvc="${nvcode}" '{if ($3 == nvc) {split(FILENAME,driver,"/"); print driver[length(driver)],"\nnvidia-utils"}}' .nvidia/nvidia*dkms >>install_pkg.lst
done
echo -e "\033[0;32m[GPU]\033[0m detected // ${nvga[@]}"
else
echo "nvidia card not detected, skipping nvidia drivers..."
fi
#--------------------------------#
# install packages from the list #
#--------------------------------#
./install_pkg.sh install_pkg.lst
rm install_pkg.lst
fi
#------------------------#
# enable system services #
#------------------------#
if [ $flg_Service -eq 1 ]; then
cat <<"EOF"
_
___ ___ ___ _ _|_|___ ___ ___
|_ -| -_| _| | | | _| -_|_ -|
|___|___|_| \_/|_|___|___|___|
EOF
while read service ; do
service_ctl $service
done < system_ctl.lst
fi

View file

@ -1,49 +0,0 @@
#!/bin/bash
#|---/ /+-----------------------------------+---/ /|#
#|--/ /-| Script to install aur helper, yay |--/ /-|#
#|-/ /--| Prasanth Rangan |-/ /--|#
#|/ /---+-----------------------------------+/ /---|#
source global_fn.sh
if [ $? -ne 0 ] ; then
echo "Error: unable to source global_fn.sh, please execute from $(dirname "$(realpath "$0")")..."
exit 1
fi
aurhlpr="${1:-yay}"
if pkg_installed yay || pkg_installed paru
then
echo "aur helper is already installed..."
exit 0
fi
if [ -d ~/Clone ]
then
echo "~/Clone directory exists..."
rm -rf ~/Clone/$aurhlpr
else
mkdir ~/Clone
echo -e "[Desktop Entry]\nIcon=default-folder-git" > ~/Clone/.directory
echo "~/Clone directory created..."
fi
if pkg_installed git
then
git clone https://aur.archlinux.org/$aurhlpr.git ~/Clone/$aurhlpr
else
echo "git dependency is not installed..."
exit 1
fi
cd ~/Clone/$aurhlpr
makepkg ${use_default} -si
if [ $? -eq 0 ]
then
echo "$aurhlpr aur helper installed..."
exit 0
else
echo "$aurhlpr installation failed..."
exit 1
fi

View file

@ -1,82 +0,0 @@
# --------------------------------------------------- // System
pipewire # audio/video server
pipewire-alsa # pipewire alsa client
pipewire-audio # pipewire audio client
pipewire-jack # pipewire jack client
pipewire-pulse # pipewire pulseaudio client
gst-plugin-pipewire # pipewire gstreamer client
wireplumber # pipewire session manager
pavucontrol # pulseaudio volume control
pamixer # pulseaudio cli mixer
networkmanager # network manager
network-manager-applet # network manager system tray utility
bluez # bluetooth protocol stack
bluez-utils # bluetooth utility cli
blueman # bluetooth manager gui
brightnessctl # screen brightness control
# --------------------------------------------------- // Display Manager
sddm # display manager for KDE plasma
qt5-quickcontrols # for sddm theme ui elements
qt5-quickcontrols2 # for sddm theme ui elements
qt5-graphicaleffects # for sddm theme effects
# --------------------------------------------------- // Window Manager
hyprland # wlroots-based wayland compositor
dunst # notification daemon
rofi-lbonn-wayland-git # application launcher
waybar # system bar
swww # wallpaper
swaylock-effects-git # lock screen
wlogout # logout menu
grimblast-git # screenshot tool
hyprpicker-git # color picker
slurp # region select for screenshot/screenshare
swappy # screenshot editor
cliphist # clipboard manager
# --------------------------------------------------- // Dependencies
polkit-kde-agent # authentication agent
xdg-desktop-portal-hyprland # xdg desktop portal for hyprland
pacman-contrib # for system update check
python-pyamdgpuinfo # for amd gpu info
parallel # for parallel processing
jq # for json processing
imagemagick # for image processing
qt5-imageformats # for dolphin image thumbnails
ffmpegthumbs # for dolphin video thumbnails
kde-cli-tools # for dolphin file type defaults
# --------------------------------------------------- // Theming
nwg-look # gtk configuration tool
qt5ct # qt5 configuration tool
qt6ct # qt6 configuration tool
kvantum # svg based qt theme engine
qt5-wayland # wayland support in qt5
qt6-wayland # wayland support in qt6
# --------------------------------------------------- // Applications
firefox # browser
kitty # terminal
dolphin # kde file manager
ark # kde file archiver
visual-studio-code-bin # ide text editor
# --------------------------------------------------- // Shell
eza|zsh # file lister for zsh
oh-my-zsh-git|zsh # plugin manager for zsh
zsh-theme-powerlevel10k|zsh oh-my-zsh-git # theme for zsh
neofetch # fetch tool
meson
cpio
cmake
zsh
linux-headers
python-pywal
pyprland

View file

@ -1,100 +0,0 @@
#!/bin/bash
#|---/ /+----------------------------------------+---/ /|#
#|--/ /-| Script to install pkgs from input list |--/ /-|#
#|-/ /--| Prasanth Rangan |-/ /--|#
#|/ /---+----------------------------------------+/ /---|#
source global_fn.sh
if [ $? -ne 0 ] ; then
echo "Error: unable to source global_fn.sh, please execute from $(dirname "$(realpath "$0")")..."
exit 1
fi
if ! pkg_installed git
then
echo "installing dependency git..."
sudo pacman -S git
fi
chk_aurh
if [ -z $aurhlpr ]
then
echo -e "Select aur helper:\n1) yay\n2) paru"
read -p "Enter option number : " aurinp
case $aurinp in
1) aurhlpr="yay" ;;
2) aurhlpr="paru" ;;
*) echo -e "...Invalid option selected..."
exit 1 ;;
esac
echo "installing dependency $aurhlpr..."
./install_aur.sh $aurhlpr 2>&1
fi
install_list="${1:-install_pkg.lst}"
ofs=$IFS
IFS='|'
while read -r pkg deps
do
pkg="${pkg// /}"
if [ -z "${pkg}" ] ; then
continue
fi
if [ ! -z "${deps}" ] ; then
deps="${deps%"${deps##*[![:space:]]}"}"
while read -r cdep
do
pass=$(cut -d '#' -f 1 ${install_list} | awk -F '|' -v chk="${cdep}" '{if($1 == chk) {print 1;exit}}')
if [ -z "${pass}" ] ; then
if pkg_installed ${cdep} ; then
pass=1
else
break
fi
fi
done < <(echo "${deps}" | xargs -n1)
if [[ ${pass} -ne 1 ]] ; then
echo -e "\033[0;33m[SKIP]\033[0m ${pkg} is missing (${deps}) dependency..."
continue
fi
fi
if pkg_installed ${pkg}
then
echo -e "\033[0;33m[SKIP]\033[0m ${pkg} is already installed..."
elif pkg_available ${pkg}
then
repo=$(pacman -Si ${pkg} | awk -F ': ' '/Repository / {print $2}')
echo -e "\033[0;32m[${repo}]\033[0m queueing ${pkg} from official arch repo..."
pkg_arch=`echo ${pkg_arch} ${pkg}`
elif aur_available ${pkg}
then
echo -e "\033[0;32m[aur]\033[0m queueing ${pkg} from arch user repo..."
pkg_aur=`echo ${pkg_aur} ${pkg}`
else
echo "error: unknown package ${pkg}..."
fi
done < <( cut -d '#' -f 1 $install_list )
IFS=${ofs}
if [ `echo $pkg_arch | wc -w` -gt 0 ]
then
echo "installing $pkg_arch from arch repo..."
sudo pacman ${use_default} -S $pkg_arch
fi
if [ `echo $pkg_aur | wc -w` -gt 0 ]
then
echo "installing $pkg_aur from aur..."
$aurhlpr ${use_default} -S $pkg_aur
fi

View file

@ -1,108 +0,0 @@
#!/bin/bash
#|---/ /+------------------------------------+---/ /|#
#|--/ /-| Script to generate wallpaper cache |--/ /-|#
#|-/ /--| Kemipso |-/ /--|#
#|/ /---+------------------------------------+/ /---|#
source global_fn.sh
if [ $? -ne 0 ] ; then
echo "Error: unable to source global_fn.sh, please execute from $(dirname "$(realpath "$0")")..."
exit 1
fi
if ! pkg_installed imagemagick || ! pkg_installed parallel
then
echo "ERROR : dependency failed, imagemagick/parallel is not installed..."
exit 0
fi
# set variables
ctlLine=`grep '^1|' ${ThemeCtl}`
export cacheDir="$HOME/.cache/hyprdots"
# evaluate options
while getopts "fc:" option ; do
case $option in
f ) # force remove cache
rm -Rf ${cacheDir}
echo "Cache dir ${cacheDir} cleared...";;
c ) # use custom wallpaper
inWall="$OPTARG"
if [[ "${inWall}" == '~'* ]]; then
inWall="$HOME${inWall:1}"
fi
if [[ -f "${inWall}" ]] ; then
if [ `echo "$ctlLine" | wc -l` -eq "1" ] ; then
curTheme=$(echo "$ctlLine" | cut -d '|' -f 2)
awk -F '|' -v thm="${curTheme}" -v wal="${inWall}" '{OFS=FS} {if($2==thm)$NF=wal;print$0}' "${ThemeCtl}" > /tmp/t2 && mv /tmp/t2 "${ThemeCtl}"
else
echo "ERROR : ${ThemeCtl} Unable to fetch theme..."
exit 1
fi
else
echo "ERROR: wallpaper ${inWall} not found..."
exit 1
fi ;;
* ) # invalid option
echo "...valid options are..."
echo "./create_cache.sh -f # force create thumbnails (delete old cache)"
echo "./create_cache.sh -c /path/to/wallpaper # generate cache for custom walls"
exit 1 ;;
esac
done
shift $((OPTIND - 1))
ctlRead=$(awk -F '|' -v thm="${1}" '{if($2==thm) print$0}' "${ThemeCtl}")
[ -z "${ctlRead}" ] && ctlRead=$(cat "${ThemeCtl}")
# magick function
imagick_t2 () {
theme="$1"
wpFullName="$2"
wpBaseName=$(basename "${wpFullName}")
if [ ! -f "${cacheDir}/${theme}/${wpBaseName}" ]; then
convert "${wpFullName}"[0] -thumbnail 500x500^ -gravity center -extent 500x500 "${cacheDir}/${theme}/${wpBaseName}"
fi
if [ ! -f "${cacheDir}/${theme}/${wpBaseName}.rofi" ]; then
convert -strip -resize 2000 -gravity center -extent 2000 -quality 90 "${wpFullName}"[0] "${cacheDir}/${theme}/${wpBaseName}.rofi"
fi
if [ ! -f "${cacheDir}/${theme}/${wpBaseName}.blur" ]; then
convert -strip -scale 10% -blur 0x3 -resize 100% "${wpFullName}"[0] "${cacheDir}/${theme}/${wpBaseName}.blur"
fi
if [ ! -f "${cacheDir}/${theme}/${wpBaseName}.dcol" ] ; then
./wallbash.sh "${wpFullName}" &> /dev/null
fi
}
export -f imagick_t2
# create thumbnails for each theme > wallpapers
echo "${ctlRead}" | while read ctlLine
do
theme=$(echo $ctlLine | awk -F '|' '{print $2}')
fullPath=$(echo "$ctlLine" | awk -F '|' '{print $NF}' | sed "s+~+$HOME+")
wallPath=$(dirname "$fullPath")
mkdir -p ${cacheDir}/${theme}
mapfile -d '' wpArray < <(find "${wallPath}" -type f \( -iname "*.gif" -o -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) -print0 | sort -z)
echo "Creating thumbnails for ${theme} [${#wpArray[@]}]"
parallel --bar imagick_t2 ::: "${theme}" ::: "${wpArray[@]}"
if pkg_installed code ; then
if [ ! -z "$(echo $ctlLine | awk -F '|' '{print $3}')" ] ; then
codex=$(echo $ctlLine | awk -F '|' '{print $3}' | cut -d '~' -f 1)
if [ $(code --list-extensions | grep -iwc "${codex}") -eq 0 ] ; then
code --install-extension "${codex}" 2> /dev/null || true
fi
fi
fi
done

View file

@ -1,54 +0,0 @@
#!/bin/bash
#|---/ /+--------------------------------------+---/ /|#
#|--/ /-| Script to apply post install configs |--/ /-|#
#|-/ /--| Prasanth Rangan |-/ /--|#
#|/ /---+--------------------------------------+/ /---|#
source global_fn.sh
if [ $? -ne 0 ] ; then
echo "Error: unable to source global_fn.sh, please execute from $(dirname "$(realpath "$0")")..."
exit 1
fi
# dolphin
if pkg_installed dolphin && pkg_installed xdg-utils
then
echo -e "\033[0;32m[FILEMANAGER]\033[0m detected // dolphin"
xdg-mime default org.kde.dolphin.desktop inode/directory
echo -e "\033[0;32m[FILEMANAGER]\033[0m setting" `xdg-mime query default "inode/directory"` "as default file explorer..."
kmenuPath="$HOME/.local/share/kio/servicemenus"
mkdir -p "${kmenuPath}"
echo -e "[Desktop Entry]\nType=Service\nMimeType=image/png;image/jpeg;image/jpg;image/gif\nActions=Menu-Refresh\nX-KDE-Submenu=Set As Wallpaper..." > "${kmenuPath}/hydewallpaper.desktop"
echo -e "\n[Desktop Action Menu-Refresh]\nName=.: Refresh List :.\nExec=${HyprdotsDir}/scripts/swwwallkon.sh" >> "${kmenuPath}/hydewallpaper.desktop"
chmod +x "${kmenuPath}/hydewallpaper.desktop"
else
echo -e "\033[0;33m[WARNING]\033[0m dolphin is not installed..."
fi
# shell
./restore_shl.sh ${getShell}
# flatpak
if ! pkg_installed flatpak
then
echo -e "\033[0;32m[FLATPAK]\033[0m flatpak application list..."
awk -F '#' '$1 != "" {print "["++count"]", $1}' .extra/custom_flat.lst
prompt_timer 10 "Install these flatpaks? [Y/n]"
fpkopt=${promptIn,,}
if [ "${fpkopt}" = "y" ] ; then
echo -e "\033[0;32m[FLATPAK]\033[0m intalling flatpaks..."
.extra/install_fpk.sh
else
echo -e "\033[0;33m[SKIP]\033[0m intalling flatpaks..."
fi
else
echo -e "\033[0;33m[SKIP]\033[0m flatpak is already installed..."
fi

View file

@ -1,26 +0,0 @@
N|Y|${HOME}|.zshrc .p10k.zsh|zsh oh-my-zsh-git zsh-theme-powerlevel10k pokemon-colorscripts-git
Y|Y|${HOME}/.config/Code/User|settings.json|visual-studio-code-bin
Y|Y|${HOME}/.config|dunst|dunst
Y|Y|${HOME}/.config|fish|fish
Y|Y|${HOME}/.config/hypr|animations.conf hyprland.conf windowrules.conf themes|hyprland
N|Y|${HOME}/.config/hypr|keybindings.conf monitors.conf userprefs.conf|hyprland
N|Y|${HOME}/.config/hypr|nvidia.conf|hyprland nvidia-utils
Y|Y|${HOME}/.config/hyprdots|theme.ctl scripts wallbash|hyprland
Y|Y|${HOME}/.config|kitty|kitty
Y|Y|${HOME}/.config|Kvantum|kvantum
Y|Y|${HOME}/.config|lsd|lsd
Y|Y|${HOME}/.config|MangoHud|mangohud
Y|Y|${HOME}/.config|neofetch|neofetch
Y|Y|${HOME}/.config|qt5ct|qt5ct
Y|Y|${HOME}/.config|qt6ct|qt6ct
Y|Y|${HOME}/.config|rofi|rofi
Y|Y|${HOME}/.config|swaylock|swaylock-effects
Y|N|${HOME}/.config|swww|swww
Y|Y|${HOME}/.config|waybar|waybar
Y|Y|${HOME}/.config|wlogout|wlogout
Y|Y|${HOME}/.config|xsettingsd nwg-look gtk-3.0|nwg-look
Y|Y|${HOME}/.icons|default|nwg-look
Y|Y|${HOME}|.gtkrc-2.0|nwg-look
Y|Y|${HOME}/.config|dolphinrc kdeglobals|dolphin
Y|Y|${HOME}/.local/share|dolphin|dolphin
Y|Y|${HOME}/.local/share/kxmlgui5|dolphin|dolphin

View file

@ -1,88 +0,0 @@
#!/bin/bash
#|---/ /+------------------------------------+---/ /|#
#|--/ /-| Script to restore personal configs |--/ /-|#
#|-/ /--| Prasanth Rangan |-/ /--|#
#|/ /---+------------------------------------+/ /---|#
source global_fn.sh
if [ $? -ne 0 ] ; then
echo "Error: unable to source global_fn.sh, please execute from $(dirname "$(realpath "$0")")..."
exit 1
fi
ThemeOverride="${1:-}" #override default config list with custom theme list [param 1]
CfgDir="${2:-${CloneDir}/Configs}" #override default config path with custom theme path [param 2]
if [ ! -f "${ThemeOverride}restore_cfg.lst" ] || [ ! -d "${CfgDir}" ] ; then
echo "ERROR : '${ThemeOverride}restore_cfg.lst' or '${CfgDir}' does not exist..."
exit 1
fi
BkpDir="${HOME}/.config/cfg_backups/$(date +'%y%m%d_%Hh%Mm%Ss')"
if [ -d "${BkpDir}" ] ; then
echo "ERROR : ${BkpDir} exists!"
exit 1
else
mkdir -p "${BkpDir}"
fi
cat "${ThemeOverride}restore_cfg.lst" | while read lst
do
ovrWrte=`echo "${lst}" | awk -F '|' '{print $1}'`
bkpFlag=`echo "${lst}" | awk -F '|' '{print $2}'`
pth=`echo "${lst}" | awk -F '|' '{print $3}'`
pth=`eval echo "${pth}"`
cfg=`echo "${lst}" | awk -F '|' '{print $4}'`
pkg=`echo "${lst}" | awk -F '|' '{print $5}'`
while read -r pkg_chk
do
if ! pkg_installed ${pkg_chk}
then
echo "skipping ${pth}/${cfg} as dependency ${pkg_chk} is not installed..."
continue 2
fi
done < <( echo "${pkg}" | xargs -n 1 )
echo "${cfg}" | xargs -n 1 | while read -r cfg_chk
do
if [[ -z "${pth}" ]]; then continue; fi
tgt=`echo "${pth}" | sed "s+^${HOME}++g"`
if ( [ -d "${pth}/${cfg_chk}" ] || [ -f "${pth}/${cfg_chk}" ] ) && [ "${bkpFlag}" == "Y" ]
then
if [ ! -d "${BkpDir}${tgt}" ] ; then
mkdir -p "${BkpDir}${tgt}"
fi
[ "${ovrWrte}" == "Y" ] && mv "${pth}/${cfg_chk}" "${BkpDir}${tgt}" || cp -r "${pth}/${cfg_chk}" "${BkpDir}${tgt}"
echo "config backed up ${pth}/${cfg_chk} --> ${BkpDir}${tgt}..."
fi
if [ ! -d "${pth}" ] ; then
mkdir -p "${pth}"
fi
if [ ! -f "${pth}/${cfg_chk}" ] ; then
cp -r "${CfgDir}${tgt}/${cfg_chk}" "${pth}"
echo "config restored ${pth} <-- ${CfgDir}${tgt}/${cfg_chk}..."
elif [ "${ovrWrte}" == "Y" ] ; then
cp -r "${CfgDir}$tgt/${cfg_chk}" "${pth}"
echo "warning: config overwritten without backup ${pth} <-- ${CfgDir}${tgt}/${cfg_chk}..."
else
echo "Skipping ${pth}/${cfg_chk} to preserve user setting..."
fi
done
done
if nvidia_detect && [ $(grep '^source = ~/.config/hypr/nvidia.conf' ${HOME}/.config/hypr/hyprland.conf | wc -l) -eq 0 ] ; then
echo -e 'source = ~/.config/hypr/nvidia.conf # auto sourced vars for nvidia\n' >> ${HOME}/.config/hypr/hyprland.conf
fi
./create_cache.sh "${ThemeOverride}"
[ -z "${ThemeOverride}" ] && ./restore_lnk.sh

View file

@ -1,48 +0,0 @@
Font_CascadiaCove|$HOME/.local/share/fonts
Font_MaterialDesign|$HOME/.local/share/fonts
Font_JetBrainsMono|$HOME/.local/share/fonts
Font_MapleNerd|$HOME/.local/share/fonts
Font_MononokiNerd|$HOME/.local/share/fonts
Font_NotoSansCJK|/usr/share/fonts
Gtk_CatppuccinMocha|/usr/share/themes
Gtk_CatppuccinMocha|$HOME/.themes
Gtk_CatppuccinLatte|/usr/share/themes
Gtk_CatppuccinLatte|$HOME/.themes
Gtk_DecayGreen|/usr/share/themes
Gtk_DecayGreen|$HOME/.themes
Gtk_FrostedGlass|/usr/share/themes
Gtk_FrostedGlass|$HOME/.themes
Gtk_GruvboxRetro|/usr/share/themes
Gtk_GruvboxRetro|$HOME/.themes
Gtk_RosePine|/usr/share/themes
Gtk_RosePine|$HOME/.themes
Gtk_TokyoNight|/usr/share/themes
Gtk_TokyoNight|$HOME/.themes
Gtk_MaterialSakura|/usr/share/themes
Gtk_MaterialSakura|$HOME/.themes
Gtk_GraphiteMono|/usr/share/themes
Gtk_GraphiteMono|$HOME/.themes
Gtk_CyberpunkEdge|/usr/share/themes
Gtk_CyberpunkEdge|$HOME/.themes
Icon_TelaBlack|/usr/share/icons
Icon_TelaBlack|$HOME/.icons
Icon_TelaDracula|/usr/share/icons
Icon_TelaDracula|$HOME/.icons
Icon_TelaGreen|/usr/share/icons
Icon_TelaGreen|$HOME/.icons
Icon_TelaGrey|/usr/share/icons
Icon_TelaGrey|$HOME/.icons
Icon_TelaPink|/usr/share/icons
Icon_TelaPink|$HOME/.icons
Icon_TelaPurple|/usr/share/icons
Icon_TelaPurple|$HOME/.icons
Icon_TelaYellow|/usr/share/icons
Icon_TelaYellow|$HOME/.icons
Icon_TelaBlue|/usr/share/icons
Icon_TelaBlue|$HOME/.icons
Icon_Gruvbox|/usr/share/icons
Icon_Gruvbox|$HOME/.icons
Cursor_Gruvbox|/usr/share/icons
Cursor_Gruvbox|$HOME/.icons
Cursor_BibataIce|/usr/share/icons
Cursor_BibataIce|$HOME/.icons

View file

@ -1,33 +0,0 @@
#!/bin/bash
#|---/ /+----------------------------------+---/ /|#
#|--/ /-| Script to extract fonts & themes |--/ /-|#
#|-/ /--| Prasanth Rangan |-/ /--|#
#|/ /---+----------------------------------+/ /---|#
source global_fn.sh
if [ $? -ne 0 ] ; then
echo "Error: unable to source global_fn.sh, please execute from $(dirname "$(realpath "$0")")..."
exit 1
fi
cat restore_fnt.lst | while read lst
do
fnt=`echo $lst | awk -F '|' '{print $1}'`
tgt=`echo $lst | awk -F '|' '{print $2}'`
tgt=`eval "echo $tgt"`
if [ ! -d "${tgt}" ]
then
mkdir -p ${tgt} || echo "creating the directory as root instead..." && sudo mkdir -p ${tgt}
echo "${tgt} directory created..."
fi
sudo tar -xzf ${CloneDir}/Source/arcs/${fnt}.tar.gz -C ${tgt}/
echo "uncompressing ${fnt}.tar.gz --> ${tgt}..."
done
echo "rebuilding font cache..."
fc-cache -f

View file

@ -1,31 +0,0 @@
#!/bin/bash
#|---/ /+---------------------------------+---/ /|#
#|--/ /-| Script to fix slinks in .config |--/ /-|#
#|-/ /--| Prasanth Rangan |-/ /--|#
#|/ /---+---------------------------------+/ /---|#
source global_fn.sh
if [ $? -ne 0 ] ; then
echo "Error: unable to source global_fn.sh, please execute from $(dirname "$(realpath "$0")")..."
exit 1
fi
find $CloneDir -type l | while read slink
do
fixd_slink=$(readlink $slink | cut -d '/' -f 4-)
linkd_file=$(echo $slink | awk -F "${CloneDir}/Configs/" '{print $NF}')
echo "linking $HOME/$linkd_file --> $HOME/$fixd_slink..."
ln -fs $HOME/$fixd_slink $HOME/$linkd_file
done
if [ -f $HOME/.config/hyprdots/scripts/globalcontrol.sh ] ; then
sed -i "/^CloneDir=/c\CloneDir=\"$CloneDir\"" $HOME/.config/hyprdots/scripts/globalcontrol.sh
echo "Clone directory globalcontrol updated..."
fi
if printenv HYPRLAND_INSTANCE_SIGNATURE &> /dev/null
then
echo "reloading hyprland..."
hyprctl reload
fi

View file

@ -1,62 +0,0 @@
#!/bin/bash
#|---/ /+---------------------------+---/ /|#
#|--/ /-| Script to configure shell |--/ /-|#
#|-/ /--| Prasanth Rangan |-/ /--|#
#|/ /---+---------------------------+/ /---|#
source global_fn.sh
if [ $? -ne 0 ] ; then
echo "Error: unable to source global_fn.sh, please execute from $(dirname "$(realpath "$0")")..."
exit 1
fi
myShell="${1}"
if [ -z "${myShell}" ] ; then
if pkg_installed zsh ; then
myShell="zsh"
elif pkg_installed fish ; then
myShell="fish"
else
echo -e "\033[0;33m[WARNING]\033[0m no shell detected..."
exit 0
fi
fi
echo -e "\033[0;32m[SHELL]\033[0m detected // ${myShell}"
# add zsh plugins
if pkg_installed zsh && pkg_installed oh-my-zsh-git ; then
# set variables
Zsh_rc="${ZDOTDIR:-$HOME}/.zshrc"
Zsh_Path="/usr/share/oh-my-zsh"
Zsh_Plugins="$Zsh_Path/custom/plugins"
Fix_Completion=""
# generate plugins from list
while read r_plugin
do
z_plugin=$(echo $r_plugin | awk -F '/' '{print $NF}')
if [ "${r_plugin:0:4}" == "http" ] && [ ! -d $Zsh_Plugins/$z_plugin ] ; then
sudo git clone $r_plugin $Zsh_Plugins/$z_plugin
fi
if [ "$z_plugin" == "zsh-completions" ] && [ `grep 'fpath+=.*plugins/zsh-completions/src' $Zsh_rc | wc -l` -eq 0 ]; then
Fix_Completion='\nfpath+=${ZSH_CUSTOM:-${ZSH:-/usr/share/oh-my-zsh}/custom}/plugins/zsh-completions/src'
else
w_plugin=$(echo ${w_plugin} ${z_plugin})
fi
done < <(cut -d '#' -f 1 restore_zsh.lst | sed 's/ //g')
# update plugin array in zshrc
echo "intalling zsh plugins (${w_plugin})"
sed -i "/^plugins=/c\plugins=($w_plugin)$Fix_Completion" $Zsh_rc
fi
# set shell
if [[ "$(grep "/${USER}:" /etc/passwd | awk -F '/' '{print $NF}')" != "${myShell}" ]] ; then
echo -e "\033[0;32m[SHELL]\033[0m changing shell to ${myShell}..."
chsh -s "$(which ${myShell})"
else
echo -e "\033[0;33m[SKIP]\033[0m ${myShell} is already configured..."
fi

View file

@ -1,8 +0,0 @@
git # alias and functions for git commands
sudo # press ESC key twice to execute command with sudo prefix
#python # alias for python
#zsh-interactive-cd # press tab to change dir with fzf
https://github.com/chrissicool/zsh-256color # enhance terminal environment with 256 colors
#https://github.com/zsh-users/zsh-completions # press tab to complete command
https://github.com/zsh-users/zsh-autosuggestions # suggests commands as you type based on history
https://github.com/zsh-users/zsh-syntax-highlighting # highlights commands as you type

View file

@ -1,3 +0,0 @@
NetworkManager
bluetooth
sddm

View file

@ -1,3 +0,0 @@
"One-Dark" "https://github.com/RAprogramm/hyprdots-theme/tree/One-Dark" "mskelton.one-dark-theme~One Dark"
"Synth-Wave" "https://github.com/prasanthrangan/hyprdots-mod/tree/Synth-Wave" "robbowen.synthwave-vscode~SynthWave '84"
"Nordic-Blue" "https://github.com/prasanthrangan/hyprdots-mod/tree/Nordic-Blue" "arcticicestudio.nord-visual-studio-code~Nord"

View file

@ -1,157 +0,0 @@
#!/bin/bash
#|---/ /+------------------------------+---/ /|#
#|--/ /-| Script to patch custom theme |--/ /-|#
#|-/ /--| kRHYME7 |-/ /--|#
#|/ /---+------------------------------+/ /---|#
source global_fn.sh
if [ $? -ne 0 ] ; then
echo "Error: unable to source global_fn.sh, please execute from $(dirname "$(realpath "$0")")..."
exit 1
fi
set +e
# error function
ask_help(){
cat << HELP
...Usage...
$0 "Theme-Name" "/Path/to/Configs"
$0 "Theme-Name" "https://github.com/User/Repository"
$0 "Theme-Name" "https://github.com/User/Repository/tree/branch"
HELP
}
if [[ -z $1 || -z $2 ]]; then ask_help ; exit 1 ; fi
# set parameters
Fav_Theme="$1"
if [ -d "$2" ]; then
Theme_Dir="$2"
else Git_Repo=${2%/}
if echo "$Git_Repo" | grep -q "/tree/"; then
branch=${Git_Repo#*tree/} Git_Repo=${Git_Repo%/tree/*}
else branches=$(curl -s "https://api.github.com/repos/${Git_Repo#*://*/}/branches" | jq -r '.[].name') ; branches=($branches)
if [[ ${#branches[@]} -le 1 ]]; then
branch=${branches[0]}
else echo "Select a Branch"
select branch in "${branches[@]}"; do [[ -n $branch ]] && break || echo "Invalid selection. Please try again." ; done
fi
fi
Git_Path=${Git_Repo#*://*/} Git_Owner=${Git_Path%/*} branch_dir=${branch//\//_}
Theme_Dir="$HOME/Clone/HyprdotsPatch-$branch_dir"
if [ -d "$Theme_Dir" ]; then
echo "Directory $Theme_Dir already exists. Using existing directory."
if cd "$Theme_Dir"; then
git stash 2> /dev/null ; git pull ; git stash pop 2> /dev/null ; cd -
else
echo -e "\033[0;31mCould not navigate to $Theme_Dir. Skipping git pull.\033[0m"
fi
else
echo "Directory $Theme_Dir does not exist. Cloning repository into new directory."
git clone -b "$branch" --depth 1 "$Git_Repo" "$Theme_Dir"
if [ $? -ne 0 ]; then echo "Git clone failed" ; exit 1 ; fi
fi
fi
echo -e "\nPatching \033[0;32m--//${Fav_Theme}//--\033[0m from \033[0;34m${Theme_Dir}\033[0m\n"
# required theme files
config=( #!Hard Coded here to atleast Strictly meet requirements.
".config/hypr/themes/$Fav_Theme.conf"
".config/kitty/themes/$Fav_Theme.conf"
".config/Kvantum/$Fav_Theme/$Fav_Theme.kvconfig"
".config/Kvantum/$Fav_Theme/$Fav_Theme.svg"
".config/qt5ct/colors/$Fav_Theme.conf"
".config/qt6ct/colors/$Fav_Theme.conf"
".config/rofi/themes/$Fav_Theme.rasi"
".config/swww/$Fav_Theme/"
".config/waybar/themes/$Fav_Theme.css"
)
# Loop through the config and check if these exist
for fchk in "${config[@]}"; do
if [[ -e "${Theme_Dir}/Configs/${fchk}" ]]; then
echo -e "\033[0;32m[OK]\033[0m ${fchk}"
else
echo -e "\033[0;31m[ERROR]\033[0m ${fchk} --> does not exist in ${Theme_Dir}/Configs/"
exit 1
fi
done
mapfile -d '' Wallist < <(find ${Theme_Dir}/Configs/.config/swww/"${Fav_Theme}"/ -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) -print0 | sort -z)
if [ "${#Wallist[@]}" -eq 0 ] ; then
echo -e "\033[0;31m[ERROR]\033[0m No wallpaper found in ${Theme_Dir}/Configs/.config/swww/"
exit 1
else
WallSet=$(basename "${Wallist[0]}")
echo -e "\nDefault wallpaper selected : \"${WallSet}\"\n"
fi
# extract arcs
prefix=("Gtk" "Font" "Icon" "Cursor")
declare -A TrgtDir
TrgtDir["Gtk"]="$HOME/.themes" #mandatory
TrgtDir["Font"]="${XDG_DATA_HOME:-$HOME/.local/share}/fonts" #optional
TrgtDir["Icon"]="$HOME/.icons" #optional
TrgtDir["Cursor"]="$HOME/.icons" #optional
postfx=("tar.xz" "tar.gz")
GtkFlag=0
# Loop over the themes and extensions
for pre in "${prefix[@]}"; do
for ext in "${postfx[@]}"; do
if [ -f "${Theme_Dir}/Source/arcs/${pre}_${Fav_Theme}.${ext}" ] ; then
echo -e "\033[0;32m[Extacting]\033[0m ${Theme_Dir}/Source/arcs/${pre}_${Fav_Theme}.${ext} --> ${TrgtDir[$pre]}"
tar -xf "${Theme_Dir}/Source/arcs/${pre}_${Fav_Theme}.${ext}" -C "${TrgtDir[$pre]}"
if [ ${pre} == "Gtk" ] ; then
GtkFlag=1
fi
fi
done
done
if [ ${GtkFlag} -eq 0 ] ; then
echo -e "\033[0;31m[ERROR]\033[0m Gtk pack not found --> ${Theme_Dir}/Source/arcs/${pre}_${Fav_Theme}.${ext}"
exit 1
fi
fc-cache -f
# generate restore_cfg control
cat << THEME > "${Fav_Theme}restore_cfg.lst"
Y|Y|${HOME}/.config/hypr/themes|${Fav_Theme}.conf|hyprland
Y|Y|${HOME}/.config/kitty/themes|${Fav_Theme}.conf|kitty
Y|Y|${HOME}/.config/Kvantum|${Fav_Theme}|kvantum
Y|Y|${HOME}/.config/qt5ct/colors|${Fav_Theme}.conf|qt5ct
Y|Y|${HOME}/.config/qt6ct/colors|${Fav_Theme}.conf|qt6ct
Y|Y|${HOME}/.config/rofi/themes|${Fav_Theme}.rasi|rofi
Y|N|${HOME}/.config/swww|${Fav_Theme}|swww
Y|Y|${HOME}/.config/waybar/themes|${Fav_Theme}.css|waybar
THEME
if grep -q "^.|${Fav_Theme}|" "${ThemeCtl}" ; then
awk -F '|' -v thm="${Fav_Theme}" -v cde="$3" '{OFS=FS} $2 == thm {$3 = cde} {print}' "${ThemeCtl}" > tmp && mv tmp "${ThemeCtl}"
else
echo "0|${Fav_Theme}|${3}|~/.config/swww/${Fav_Theme}/${WallSet}" >> "${ThemeCtl}"
fi
# restore configs with theme override
echo -e "\033[0;32m[Restoring]\033[0m restore_cfg.sh \"${Fav_Theme}\" \"${Theme_Dir}/Configs\"\n"
./restore_cfg.sh "$Fav_Theme" "$Theme_Dir/Configs"
rm "${Fav_Theme}restore_cfg.lst"

View file

@ -1,187 +0,0 @@
#!/bin/bash
#|---/ /+---------------------------------------------+---/ /|#
#|--/ /-| Script to generate color palette from image |--/ /-|#
#|-/ /--| Prasanth Rangan |-/ /--|#
#|/ /---+---------------------------------------------+/ /---|#
#// accent color profile
colorProfile="default"
wallbashCurve="32 50\n42 46\n49 40\n56 39\n64 38\n76 37\n90 33\n94 29\n100 20"
while [ $# -gt 0 ] ; do
case "$1" in
-v|--vibrant) colorProfile="vibrant"
wallbashCurve="18 99\n32 97\n48 95\n55 90\n70 80\n80 70\n88 60\n94 40\n99 24"
;;
-p|--pastel) colorProfile="pastel"
wallbashCurve="10 99\n17 66\n24 49\n39 41\n51 37\n58 34\n72 30\n84 26\n99 22"
;;
-m|--mono) colorProfile="mono"
wallbashCurve="10 0\n17 0\n24 0\n39 0\n51 0\n58 0\n72 0\n84 0\n99 0"
;;
*) break
;;
esac
shift
done
#// set variables
cacheDir="$HOME/.cache/hyprdots"
wallbashImg="${1}"
wallbashColors=4
wallbashFuzz=70
cacheImg=$(basename "${wallbashImg}")
cacheThm=$(dirname "${wallbashImg}" | awk -F '/' '{print $NF}')
wallbashRaw="${cacheDir}/${cacheThm}/${cacheImg}.mpc"
wallbashOut="${cacheDir}/${cacheThm}/${cacheImg}.dcol"
wallbashCache="${cacheDir}/${cacheThm}/${cacheImg}.cache"
#// color modulations
pryDarkBri=116
pryDarkSat=110
pryDarkHue=88
pryLightBri=100
pryLightSat=100
pryLightHue=114
txtDarkBri=188
txtLightBri=16
#// input image validation
if [ -z "${wallbashImg}" ] || [ ! -f "${wallbashImg}" ] ; then
echo "Error: Input file not found!"
exit 1
fi
magick -ping "${wallbashImg}" -format "%t" info: &> /dev/null
if [ $? -ne 0 ] ; then
echo "Error: Unsuppoted image format ${wallbashImg}"
exit 1
fi
echo "wallbash ${colorProfile} profile :: Colors ${wallbashColors} :: Fuzzy ${wallbashFuzz} :: \"${wallbashOut}\""
mkdir -p "${cacheDir}/${cacheThm}"
> "${wallbashOut}"
#// define functions
rgb_negative() {
local inCol=$1
local r=${inCol:0:2}
local g=${inCol:2:2}
local b=${inCol:4:2}
local r16=$((16#$r))
local g16=$((16#$g))
local b16=$((16#$b))
r=$(printf "%02X" $((255 - $r16)))
g=$(printf "%02X" $((255 - $g16)))
b=$(printf "%02X" $((255 - $b16)))
echo "${r}${g}${b}"
}
fx_brightness() {
local inCol="${1}"
local fxb=$(magick "${inCol}" -colorspace gray -format "%[fx:mean]" info:)
if awk -v fxb="${fxb}" 'BEGIN {exit !(fxb < 0.5)}' ; then
return 0 #// echo ":: ${fxb} :: dark :: ${inCol}"
else
return 1 #// echo ":: ${fxb} :: light :: ${inCol}"
fi
}
#// quantize raw primary colors
magick -quiet -regard-warnings "${wallbashImg}"[0] -alpha off +repage "${wallbashRaw}"
readarray -t dcolRaw <<< $(magick "${wallbashRaw}" -depth 8 -fuzz ${wallbashFuzz}% +dither -kmeans ${wallbashColors} -depth 8 -format "%c" histogram:info: | sed -n 's/^[ ]*\(.*\):.*[#]\([0-9a-fA-F]*\) .*$/\1,#\2/p' | sort -r -n -k 1 -t "," | awk -F '#' 'length($NF) == 6 {print $NF}')
if [ ${#dcolRaw[*]} -lt ${wallbashColors} ] ; then
echo -e "RETRYING :: distinct colors ${#dcolRaw[*]} is less than ${wallbashColors} palette color..."
readarray -t dcolRaw <<< $(magick "${wallbashRaw}" -depth 8 -fuzz ${wallbashFuzz}% +dither -colors $((wallbashColors + 2)) -depth 8 -format "%c" histogram:info: | sed -n 's/^[ ]*\(.*\):.*[#]\([0-9a-fA-F]*\) .*$/\1,#\2/p' | sort -r -n -k 1 -t "," | awk -F '#' 'length($NF) == 6 {print $NF}')
fi
#// sort colors based on image brightness
if fx_brightness "${wallbashRaw}" ; then
colSort=""
else
colSort="-r"
fi
dcol=($(echo -e "${dcolRaw[@]:0:$wallbashColors}" | tr ' ' '\n' | sort ${colSort}))
greyCheck=$(convert "${wallbashRaw}" -colorspace HSL -channel g -separate +channel -format "%[fx:mean]" info:)
if (( $(awk 'BEGIN {print ('"$greyCheck"' < 0.12)}') )); then
wallbashCurve="10 0\n17 0\n24 0\n39 0\n51 0\n58 0\n72 0\n84 0\n99 0"
fi
#// loop for derived colors
for (( i=0; i<${wallbashColors}; i++ )) ; do
#// generate missing primary colors
if [ -z "${dcol[i]}" ] ; then
if fx_brightness "xc:#${dcol[i - 1]}" ; then
modBri=$pryDarkBri
modSat=$pryDarkSat
modHue=$pryDarkHue
else
modBri=$pryLightBri
modSat=$pryLightSat
modHue=$pryLightHue
fi
echo -e "dcol_pry$((i + 1)) :: regen missing color"
dcol[i]=$(magick xc:"#${dcol[i - 1]}" -depth 8 -normalize -modulate ${modBri},${modSat},${modHue} -depth 8 -format "%c" histogram:info: | sed -n 's/^[ ]*\(.*\):.*[#]\([0-9a-fA-F]*\) .*$/\1,#\2/p' | sort -r -n -k 1 -t "," | awk -F '#' 'length($NF) == 6 {print $NF}')
fi
echo "dcol_pry$((i + 1))=\"${dcol[i]}\"" >> "${wallbashOut}"
#// generate primary text colors
nTxt=$(rgb_negative ${dcol[i]})
if fx_brightness "xc:#${dcol[i]}" ; then
modBri=$txtDarkBri
else
modBri=$txtLightBri
fi
tcol=$(magick xc:"#${nTxt}" -depth 8 -normalize -modulate ${modBri},10,100 -depth 8 -format "%c" histogram:info: | sed -n 's/^[ ]*\(.*\):.*[#]\([0-9a-fA-F]*\) .*$/\1,#\2/p' | sort -r -n -k 1 -t "," | awk -F '#' 'length($NF) == 6 {print $NF}')
echo "dcol_txt$((i + 1))=\"${tcol}\"" >> "${wallbashOut}"
#// generate accent colors
xHue=$(magick xc:"#${dcol[i]}" -colorspace HSB -format "%c" histogram:info: | awk -F '[hsb(,]' '{print $2}')
acnt=1
echo -e "${wallbashCurve}" | sort -n ${colSort} | while read -r xBri xSat
do
acol=$(magick xc:"hsb(${xHue},${xSat}%,${xBri}%)" -depth 8 -format "%c" histogram:info: | sed -n 's/^[ ]*\(.*\):.*[#]\([0-9a-fA-F]*\) .*$/\1,#\2/p' | sort -r -n -k 1 -t "," | awk -F '#' 'length($NF) == 6 {print $NF}')
echo "dcol_$((i + 1))xa${acnt}=\"${acol}\"" >> "${wallbashOut}"
((acnt++))
done
done
#// cleanup temp cache
rm -f "${wallbashRaw}" "${wallbashCache}"