Clean up, update configs to be actually useful now...

This commit is contained in:
Adriel Sand
2024-01-04 18:49:24 -08:00
parent 68d016d03e
commit c93f5d7caa
412 changed files with 4462 additions and 63004 deletions

View File

@@ -1,3 +0,0 @@
#!/bin/bash
sleep 2
albert

View File

@@ -1,135 +0,0 @@
#!/bin/bash
# ---Clearing Variables to Default---
var_wheel=""
# ---Questions---
read -p 'Hostname: ' var_hostname
read -p 'Root password: ' var_password
read -p 'User name: ' var_user_name
read -p "User ($var_user_name) password: " var_user_password
read -p "Would you like the user \"$var_user_name\" to be a super user? (type \'wheel\' to say yes) " var_user_wheel
if [[ $var_user_wheel = "wheel" ]]
then
var_wheel="-aG wheel"
else
var_wheel=" "
fi
echo
echo
echo 'Starting to install...'
echo
echo
echo
sleep 1
# ---Execution---
ln -sf /usr/share/zoneinfo/America/Buenos_Aires /etc/localtime
hwclock --systohc
timedatectl set-ntp true
sed -i 's/#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
echo 'LANG=en_US.UTF-8' >> /etc/locale.conf
echo "$var_hostname" >> /etc/hostname
echo '127.0.0.1 localhost' >> /etc/hosts
echo '::1 localhost' >> /etc/hosts
echo "127.0.0.1 $var_hostname.localdomain $var_hostname" >> /etc/hosts
echo
echo
echo 'Doing btrfs stuff and encryption...'
echo
echo
echo
sleep 1
# ---[Btrfs and encryption]---
sed -i 's/MODULES=(/MODULES=(btrfs/' /etc/mkinitcpio.conf
var_hooks_line="$(grep 'HOOKS=(' /etc/mkinitcpio.conf | grep -v '# HOOKS')"
var_hooks_replace="$(grep 'HOOKS=(' /etc/mkinitcpio.conf | grep -v '# HOOKS' | sed 's/filesystems/encrypt filesystems/')"
sed -i "s/$var_hooks_line/$var_hooks_replace/" /etc/mkinitcpio.conf
mkinitcpio -p linux
echo
echo
echo 'Doing user stuff...'
echo
echo
echo
sleep 1
# ---[Users]---
useradd -m "$var_user_name"
echo "$var_user_name:$var_user_password" | chpasswd
echo "root:$var_password" | chpasswd
sed -i 's/# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/' /etc/sudoers
if [[ $var_wheel = "-aG wheel" ]]
then
usermod $var_wheel $var_user_name
fi
echo
echo
echo 'Installing packages...'
echo
echo
echo
sleep 1
# ---[Packages]---
pacman -S networkmanager gnome gdm gnome-tweaks alacritty fish exa vlc git base-devel adobe-source-sans-fonts
mkdir /root/arch-custom-install
cd /root/arch-custom-install
git clone https://gitlab.com/thebiblelover7/prebuilt-packages
cd prebuilt-packages
for i in $(ls -1)
do
pacman -U $i
done
paru -S brave-bin logseq-desktop-bin slack-desktop schildichat-desktop-bin whitesur-icon-theme whitesur-gtk-theme gnome-shell-extension-pop-shell-git cursor-theme-macos-big-sur
echo
echo
echo 'Installing configs...'
echo
echo
echo
sleep 1
# ---[Configs]---
cd /home/$var_user_name
git clone https://gitlab.com/thebiblelover7/dotfiles
cd dotfiles
./install.sh
chown -R $var_user_name:$var_user_name /home/$var_user_name
chsh -s /bin/fish $var_user_name
cd
# pacman color and parallel downloads
# change dotfiles to have the plain background, and to have the right theme
# albert
echo
echo
echo 'Enabling services to start on boot...'
echo
echo
echo
sleep 1
# ---[Services]
systemctl enable NetworkManager
systemctl enable bluetooth
systemctl enable gdm
#systemctl enable cups.service

View File

@@ -1,74 +0,0 @@
#!/bin/bash
# |||||- Pre-Configurations -|||||
diselect() {
PS3='Please enter your choice: '
select opt in "${options[@]}"
do
case $opt in
1|"${options[0]}")
${option_c[0]}
break
;;
2|"${options[1]}")
${option_c[1]}
break
;;
3|"${options[2]}")
${option_c[2]}
break
;;
4|"${options[3]}")
${option_c[3]}
break
;;
5|"${options[4]}")
${option_c[4]}
break
;;
*) echo "invalid option, try again" ;;
esac
done
}
# |||||- Functions -|||||
check_internet() {
ping -c 2 archlinux.org && check_intenet_state=true || check_intenet_state=false
if [[ $check_intenet_state = false ]]
then
echo "No internet.. Exiting..."
exit 2
fi
}
update_time() {
timedatectl set-ntp true
}
dialog_partition_disks() {
options=("cfdisk" "fdisk" "I already partitioned my disks")
option_c=("fun_cfdisk" "fun_fdisk" "echo")
diselect
}
dialog_drive_list() {
echo "Please enter your drive to be partitioned in the format '/dev/sda'"
read -p "-> " var_drive
}
fun_cfdisk() {
dialog_drive_list
cfdisk $var_drive
}
# |||||- Execution -|||||
check_internet
dialog_partition_disks

View File

@@ -1,4 +0,0 @@
#!/bin/bash
nvim $HOME/scripts/npad
cp $HOME/scripts/npad $HOME/clonenbuild/npad/npad

View File

@@ -1,8 +0,0 @@
#/bin/bash
if [[ $(gsettings get org.gnome.settings-daemon.plugins.color night-light-enabled) = "true" ]]
then
gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled false
else
gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled true
fi

View File

@@ -1,4 +0,0 @@
#!/bin/bash
sleep 0.05
/home/adriel/scripts/npad

View File

@@ -1,23 +0,0 @@
#!/bin/bash
project_dir=$HOME/Videos/Projects
proj_name=$1
mkproj(){
mkdir -p $project_dir/$proj_name
}
openproj(){
cd $project_dir/$proj_name
tmux
}
case $1 in
'--help' | '-h' | 'help')
echo "HELP!"
;;
* )
echo $proj_name
mkproj
openproj
;;
esac

View File

@@ -1,21 +0,0 @@
#!/bin/bash
choice=$(echo "Schildichat
Element
Signal
Telegram" | rofi -dmenu -i)
case $choice in
'Schildichat')
schildichat-desktop
;;
'Element')
element-desktop
;;
'Signal')
signal-desktop
;;
'Telegram')
telegram-desktop
;;
esac

View File

@@ -1,3 +0,0 @@
#!/bin/bash
ssher=$(wofi --dmenu -i < $HOME/.config/ssh-into); terminator -e "ssh $ssher"

View File

@@ -1,200 +0,0 @@
#!/bin/bash
sleep 0.2
write_config_dir=$HOME/.config/write
write_config_file_path=$write_config_dir/write.conf
write_config_exists_out=$(cat $write_config_file_path &> /dev/null)
write_config_exists=$?
write_default_notes_dir=$HOME/Write-Write
write_default_note_num=1
write_default_editor=$EDITOR
write_default_note_extension=".md"
logseq_page_path="$HOME/Nextcloud/Notes/Logseq/pages/write-write.md"
note_num=$write_default_note_num
bold_on="setterm --bold on"
bold_off="setterm --bold off"
make_default_config() {
mkdir -p $write_config_dir || exit 2
echo "write_notes_dir=$write_default_notes_dir" > $write_config_file_path
echo "note_num=$write_default_note_num" >> $write_config_file_path
echo "write_note_extension=$write_default_note_extension" >> $write_config_file_path
echo "write_editor=$write_default_editor" >> $write_config_file_path
mkdir -p $write_default_notes_dir || exit 2
}
make_config_file() {
mkdir -p $write_config_dir || exit 2
echo "write_notes_dir=$write_notes_dir" > $write_config_file_path
echo "note_num=$note_num" >> $write_config_file_path
echo "write_note_extension=$write_note_extension" >> $write_config_file_path
echo "write_editor=$write_editor" >> $write_config_file_path
mkdir -p $write_notes_dir || exit 2
}
make_config_dialog() {
$bold_on && echo "Would you like to change the default notes directory? $write_default_notes_dir"
echo "[y,N]" && $bold_off
read change_notes_dir
if [[ $change_notes_dir = "y" || $change_notes_dir = "Y" ]]
then
$bold_on && echo "Enter absolute directory of stored files e.g. /home/$(whoami)/notes" && $bold_off
read write_notes_dir_input
write_notes_dir=$write_notes_dir_input
make_config_file
else
write_notes_dir=$write_default_notes_dir
make_config_file
fi
mkdir -p $write_notes_dir || exit 2
$bold_on && echo "Would you like to change the current editor ($EDITOR)?"
echo "[y,N]" && $bold_off
read change_editor
if [[ $change_editor = "y" || $change_editor = "Y" ]]
then
$bold_on && echo "Enter the command used to run the editor (e.g. 'nano', 'vi', 'micro')" && $bold_off
read write_editor_input
write_editor=$write_editor_input
make_config_file
else
write_editor=$write_default_editor
make_config_file
fi
$bold_on && echo "Would you like to change the current file extension for the notes ($write_default_note_extension)?"
echo "[y,N]" && $bold_off
read change_note_extension
if [[ $change_note_extension = "y" || $change_note_extension = "Y" ]]
then
$bold_on && echo "Enter the file extension desired (e.g. '.md', '.txt')" && $bold_off
read write_note_extension_input
write_note_extension="$write_note_extension_input"
make_config_file
else
write_note_extension=$write_default_note_extension
make_config_file
fi
source $write_config_file_path
}
append_note_logseq() {
echo "" >> $logseq_page_path
echo "# $note_num$write_note_extension" >> $logseq_page_path
# echo " -" >> $logseq_page_path
cat $write_notes_dir/$note_num$write_note_extension >> $logseq_page_path
echo "" >> $logseq_page_path
}
check_note_diff() {
diff_state=$(diff $write_notes_dir/$note_num$write_note_extension $write_notes_dir/$note_num$write_note_extension.previous &> /dev/null && echo $?)
}
update_note_num() {
note_exists=$(cat $write_notes_dir/$note_num$write_note_extension &> /dev/null && echo $?)
if [[ $note_exists = 0 ]]
then
note_num=$(($note_num + 1))
fi
make_config_file
}
new_note() {
$write_editor $write_notes_dir/$note_num$write_note_extension
note_exists=$(cat $write_notes_dir/$note_num$write_note_extension &> /dev/null && echo $?)
if [[ $note_exists = 0 ]]
then
append_note_logseq
fi
update_note_num
}
open_note(){
cp $write_notes_dir/$note_num$write_note_extension $write_notes_dir/$note_num$write_note_extension.previous
$write_editor $write_notes_dir/$note_num$write_note_extension
check_note_diff
if [[ $diff_state = 1 ]]
then
replace_note_logseq
fi
}
get_entries() {
ls -1 $write_notes_dir | while read note
do
$bold_on && echo "$note" && $bold_off
cat -n $write_notes_dir/$note | while read line
do
line_num=$(echo $line | cut -d ' ' -f1)
new_line=$(echo $line | sed "s/$line_num //g")
# line_num=$(echo "$line" | cut --delimiter=' ' -f1)
if [[ $line_num -lt 5 ]]
then
# echo $line_num
echo "$new_line"
# echo $line | sed "s/$line_num //"
fi
done
echo
echo
done
# for i in $notes_list
# do
# echo "$i"
# sleep 2
# for line in $(cat -n $write_notes_dir/$i)
# do
# if [[ $(echo $line | cut --delimiter=' ' -f1) < 5 ]]
# then
# echo $line
# fi
# done
# done
}
if [[ $write_config_exists = 1 ]] # 1 means not true in this case (exit code)
then
make_default_config
echo "write-write Copyright (C) 2021 Adriel Sand
This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. See https://gitlab.com/thebiblelover7/npad for more details."
$bold_on
echo "Would you like to change the defaults?"
echo "[y,N]" && $bold_off
read change_defaults
if [[ $change_defaults = "y" || $change_defaults = "Y" ]]
then
make_config_dialog
else
make_default_config
fi
source $write_config_file_path || exit 2
else
source $write_config_file_path || exit 2
fi
case $1 in
'list' | '-l' | '--list')
get_entries
;;
*)
note_num=$1
note_exists=$(cat $write_notes_dir/$note_num$write_note_extension &> /dev/null && echo $?)
if [[ $note_exists = 0 ]]
then
open_note
else
source $write_config_file_path || exit 2
new_note
fi
;;
esac