diff options
Diffstat (limited to '.scripts')
-rwxr-xr-x | .scripts/4chget | 4 | ||||
-rwxr-xr-x | .scripts/4chgettofi | 3 | ||||
-rwxr-xr-x | .scripts/bts | 3 | ||||
-rwxr-xr-x | .scripts/toggle-keyboard-hypr | 11 | ||||
-rwxr-xr-x | .scripts/toggle-touchpad-hypr | 11 | ||||
-rwxr-xr-x | .scripts/work | 5 | ||||
-rwxr-xr-x | .scripts/ws | 45 | ||||
-rwxr-xr-x | .scripts/ws-tofi | 67 |
8 files changed, 143 insertions, 6 deletions
diff --git a/.scripts/4chget b/.scripts/4chget index b4a7446..43e4f7c 100755 --- a/.scripts/4chget +++ b/.scripts/4chget @@ -34,10 +34,10 @@ read thread case "$option" in "wg") - wget -P "$parentdir/$dir" -nd -r -l 1 -H -D i.4cdn.org,is2.4chan.org -A png,jpg,jpeg -R '*s.*' https://boards.4chan.org/wg/thread/"$thread" ;; + wget -P "$parentdir/$dir" -nd -r -l 1 -H -D i.4cdn.org,is2.4chan.org,is2.4channel.org -A png,jpg,jpeg -R '*s.*' https://boards.4chan.org/wg/thread/"$thread" ;; "w") - wget -P "$parentdir/$dir" -nd -r -l 1 -H -D i.4cdn.org,is2.4chan.org -A png,jpg,jpeg -R '*s.*' https://boards.4channel.org/w/thread/"$thread" ;; + wget -P "$parentdir/$dir" -nd -r -l 1 -H -D i.4cdn.org,is2.4chan.org,is2.4channel.org -A png,jpg,jpeg -R '*s.*' https://boards.4chan.org/w/thread/"$thread" ;; esac echo "Wallpapers downloaded successfully." diff --git a/.scripts/4chgettofi b/.scripts/4chgettofi index ee88553..a820059 100755 --- a/.scripts/4chgettofi +++ b/.scripts/4chgettofi @@ -5,7 +5,8 @@ while [[ "$option" != "w" && "$option" != "wg" ]]; do option=$(echo -e "wg\nw" | tofi --prompt-text "Is it wallpaper/general (wg) or anime wallpaper (w)?") done -[[ $option == "w" ]] && parentdir="$rootpapesdir/w" && nel="nel" || parentdir="$rootpapesdir/wg" +#[[ $option == "w" ]] && parentdir="$rootpapesdir/w" && nel="nel" || parentdir="$rootpapesdir/wg" +[[ $option == "w" ]] && parentdir="$rootpapesdir/w" || parentdir="$rootpapesdir/wg" while true; do dir=$(tofi --prompt-text "Enter folder name: " --require-match=false </dev/null) diff --git a/.scripts/bts b/.scripts/bts index 445bdcb..b78f9b9 100755 --- a/.scripts/bts +++ b/.scripts/bts @@ -5,7 +5,8 @@ option=$(echo -e "Connect\nDisconnect\nChange profile\nReset pulseaudio"| tofi - #MAC="76:67:11:36:64:A2" #MAC="E4:59:37:44:27:7A" #MAC="2E:85:79:56:B1:D7" -MAC="28:B7:7B:AB:C9:92" +#MAC="28:B7:7B:AB:C9:92" +MAC="EF:9F:2E:52:9E:45" case $option in "Connect") status=$(systemctl is-active bluetooth) diff --git a/.scripts/toggle-keyboard-hypr b/.scripts/toggle-keyboard-hypr new file mode 100755 index 0000000..3bc046c --- /dev/null +++ b/.scripts/toggle-keyboard-hypr @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +CACHE_FILE="$XDG_CACHE_HOME/laptop-keyboard-disabled" + +if [ -f "$CACHE_FILE" ] ;then + rm "$CACHE_FILE" + hyprctl keyword -r '$KEYBOARD_ENABLED' "true" +else + touch "$CACHE_FILE" + hyprctl keyword -r '$KEYBOARD_ENABLED' "false" +fi diff --git a/.scripts/toggle-touchpad-hypr b/.scripts/toggle-touchpad-hypr new file mode 100755 index 0000000..8f65419 --- /dev/null +++ b/.scripts/toggle-touchpad-hypr @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +CACHE_FILE="$XDG_CACHE_HOME/laptop-touchpad-disabled" + +if [ -f "$CACHE_FILE" ] ;then + rm "$CACHE_FILE" + hyprctl keyword -r '$TOUCHPAD_ENABLED' "true" +else + touch "$CACHE_FILE" + hyprctl keyword -r '$TOUCHPAD_ENABLED' "false" +fi diff --git a/.scripts/work b/.scripts/work index fb3f1a5..6903842 100755 --- a/.scripts/work +++ b/.scripts/work @@ -1,6 +1,7 @@ #!/bin/sh -content="$@" +content="$*" + today=$(date +%d%m%y) -x "$today: $content" +x -t "$today: $content" diff --git a/.scripts/ws b/.scripts/ws new file mode 100755 index 0000000..b85e073 --- /dev/null +++ b/.scripts/ws @@ -0,0 +1,45 @@ +#!/bin/bash + +# Prerequisite tools check +[[ ! $(command -v brave) ]] && { echo "Error: 'brave' is not installed. Please install Brave Browser."; [[ $(command -v notify-send) ]] && notify-send "Error" "'brave' is not installed. Please install Brave Browser."; exit 1; } +[[ ! $(command -v monolith) ]] && { echo "Error: 'monolith' is not installed. Please install Monolith."; [[ $(command -v notify-send) ]] && notify-send "Error" "'monolith' is not installed. Please install Monolith."; exit 1; } +[[ ! $(command -v notify-send) ]] && echo "Warning: 'notify-send' is not installed. Notifications will not work." + +# Check if website URL is provided as an argument +if [ -z "$1" ]; then + echo "Usage: $0 <website-url>" + exit 1 +fi + +# Get the website URL from arguments +WEBSITE_URL="$1" + +# Define the output file name +OUTPUT_FILE="$(basename "$WEBSITE_URL").html" + +TOPIC="$2" + +# Add later +USER_AGENT= + +# Define the directory where the HTML files will be saved +OUTPUT_DIR="$HOME/read/"$TOPIC"" + +# Create the directory if it doesn't exist +mkdir -p "$OUTPUT_DIR" + +# Check if the output file already exists +if [ -e "$OUTPUT_DIR/$OUTPUT_FILE" ]; then + # If file exists, add a suffix + COUNTER=1 + while [ -e "${OUTPUT_FILE%.html}_$COUNTER.html" ]; do + COUNTER=$((COUNTER + 1)) + done + OUTPUT_FILE="${OUTPUT_FILE%.html}_$COUNTER.html" +fi + +# Use Brave in headless mode and pipe it to Monolith +brave --headless --window-size=1920,1080 --run-all-compositor-stages-before-draw --virtual-time-budget=9000 --incognito --dump-dom "$WEBSITE_URL" | monolith - -I -b "$WEBSITE_URL" -o "$OUTPUT_DIR/$OUTPUT_FILE" + +echo "HTML file saved as $OUTPUT_DIR/$OUTPUT_FILE" +notify-send "Website saved" "HTML file saved successfully as $OUTPUT_DIR/$OUTPUT_FILE" diff --git a/.scripts/ws-tofi b/.scripts/ws-tofi new file mode 100755 index 0000000..25f47c4 --- /dev/null +++ b/.scripts/ws-tofi @@ -0,0 +1,67 @@ +#!/bin/bash + +# Prerequisite tools check +[[ ! $(command -v brave) ]] && { echo "Error: 'brave' is not installed. Please install Brave Browser."; [[ $(command -v notify-send) ]] && notify-send "Error" "'brave' is not installed. Please install Brave Browser."; exit 1; } +[[ ! $(command -v monolith) ]] && { echo "Error: 'monolith' is not installed. Please install Monolith."; [[ $(command -v notify-send) ]] && notify-send "Error" "'monolith' is not installed. Please install Monolith."; exit 1; } +[[ ! $(command -v notify-send) ]] && echo "Warning: 'notify-send' is not installed. Notifications will not work." + +# Get the website URL from arguments +siteclip=$(echo -e "Yes\nNo" | tofi --prompt-text "Do you have the website link in your clipboard?") +[[ "$siteclip" == "Yes" ]] && WEBSITE_URL=$(wl-paste) || WEBSITE_URL=$(tofi --prompt-text "Enter website url:" --require-match false </dev/null) + + +[[ "$WEBSITE_URL" == "exit" ]] && echo "Exiting" && notify-send "Exiting" "Exiting the script" && exit 1 + +# Define the output file name +OUTPUT_FILE="$(basename "$WEBSITE_URL").html" + +while true; do + topicopt=$(echo -e "New\nPre-existing" | tofi --prompt-text "Do you wish to add a new topic or pre-existing topic?") + + if [[ "$topicopt" == "Pre-existing" ]]; then + # Pre-existing topic selection + TOPIC=$(find "$HOME/read" -maxdepth 1 -type d -exec basename {} \; cat - <(echo "none\nexit") | tofi --prompt-text "Choose the topic:") + + [[ "$TOPIC" == "exit" ]] && echo "Exiting" && notify-send "Exiting" "Exiting the script" && exit 1 \ + || [[ "$TOPIC" != "none" ]] && break + else + # New Topic Creation + TOPIC=$(tofi --prompt-text "Enter topic name: " --require-match=false </dev/null) + + if [[ "$TOPIC" == "none" ]]; then + TOPIC="" + break + elif [[ "$TOPIC" == "exit" ]]; then + echo "Exiting" && notify-send "Exiting" "Exiting the script" && exit 1 + elif [[ -z "$TOPIC" ]]; then + notify-send "Folder name cannot be empty." "Please enter a valid folder name." + else + break + fi + fi +done + +# Add later +USER_AGENT= + +# Define the directory where the HTML files will be saved +OUTPUT_DIR="$HOME/read/"$TOPIC"" + +# Create the directory if it doesn't exist +mkdir -p "$OUTPUT_DIR" + +# Check if the output file already exists +if [ -e "$OUTPUT_DIR/$OUTPUT_FILE" ]; then + # If file exists, add a suffix + COUNTER=1 + while [ -e "${OUTPUT_FILE%.html}_$COUNTER.html" ]; do + COUNTER=$((COUNTER + 1)) + done + OUTPUT_FILE="${OUTPUT_FILE%.html}_$COUNTER.html" +fi + +# Use Brave in headless mode and pipe it to Monolith +brave --headless --window-size=1920,1080 --run-all-compositor-stages-before-draw --virtual-time-budget=9000 --incognito --dump-dom "$WEBSITE_URL" | monolith - -I -b "$WEBSITE_URL" -o "$OUTPUT_DIR/$OUTPUT_FILE" + +echo "HTML file saved as $OUTPUT_DIR/$OUTPUT_FILE" +notify-send "Website saved" "HTML file saved successfully as $OUTPUT_DIR/$OUTPUT_FILE" |