Skip to content

Instantly share code, notes, and snippets.

View naranyala's full-sized avatar
🎯
F11 - back to the context

FMH (@gema_naranyala) naranyala

🎯
F11 - back to the context
View GitHub Profile
@naranyala
naranyala / rofi-set-nightmode-inrange.sh
Created May 18, 2024 10:28
setup redshift in-range using rofi
#!/bin/bash
# Parses command-line arguments and executes the appropriate action
parse_args() {
case $1 in
-r | --reset)
reset_temperature
;;
-t | --temperature)
if [ -n "$2" ]; then
@naranyala
naranyala / rofi-set-brightness-inrange.sh
Created May 18, 2024 10:15
fix your brightness controls
#!/bin/bash
# Define the options for brightness levels
options="0%\n5%\n10%\n15%\n20%\n25%\n30%\n35%\n40%\n45%\n50%\n55%\n60%\n65%\n70%\n75%\n80%\n85%\n90%\n95%\n100%"
# Use rofi to select a brightness level
chosen=$(echo -e "$options" | rofi -dmenu -p "Set Brightness Level")
# If the user made a selection, set the brightness
if [ -n "$chosen" ]; then
@naranyala
naranyala / rofi-set-volume-inrange.sh
Created May 18, 2024 10:11
fix your volume controls
#!/bin/bash
# Define the options for volume levels
options="0%\n5%\n10%\n15%\n20%\n25%\n30%\n35%\n40%\n45%\n50%\n55%\n60%\n65%\n70%\n75%\n80%\n85%\n90%\n95%\n100%"
# Use rofi to select a volume level
chosen=$(echo -e "$options" | rofi -dmenu -p "Set Volume Level")
# If the user made a selection, set the volume
if [ -n "$chosen" ]; then
#!/bin/bash
# Bash script to initiate a new Lua project
# Check if the user wants to create a new directory
read -p "Do you want to create a new directory for your Lua project? (y/n): " create_new_directory
if [ "$create_new_directory" == "y" ]; then
# Get project name from user input
read -p "Enter your Lua project name: " project_name
#!/bin/bash
getGoVersion() {
versionInfo=$(go version 2>&1)
if [ $? -ne 0 ]; then
echo "Error executing 'go version' command: $versionInfo" >&2
return 1
fi
version=$(echo $versionInfo | awk '{print $3}')
#!/bin/bash
# Bash script to initiate a new Python project
# Check if the user wants to create a new directory
read -p "Do you want to create a new directory for your project? (y/n): " create_new_directory
if [ "$create_new_directory" == "y" ]; then
# Get project name from user input
read -p "Enter your project name: " project_name
#!/bin/bash
# Check if a GitHub URL is provided
if [ -z "$1" ]; then
echo "Usage: $0 <GitHub Repo URL>"
exit 1
fi
# Remove "http://" or "https://"
url_no_protocol=$(echo $1 | sed 's/https\?:\/\///')
#!/bin/bash
DEFAULT_BROWSER="brave"
# Declare a custom array of websites
declare -A websites
websites["google"]="https://google.com/"
websites["youtube"]="https://youtube.com/"
websites["x-twitter"]="https://x.com"
#!/bin/bash
PATH_MEDIA="/media"
PATH_HOME="/home"
# Declare a custom array of dirs
declare -A dirs
dirs["dir:category:subcategory"]="$PATH_MEDIA/public-repos"
dirs["dir:category:subcategory"]="$PATH_MEDIA/private-repos"
#!/bin/bash
# Rofi prompt for website URL
website_url=$(rofi -dmenu -p "Enter the website URL:")
# Extract the website name
website_name=$(echo "$website_url" | awk -F[/:] '{print $4}')
# Rofi prompt for folder name
folder_name=$(rofi -dmenu -p "Enter folder name for $website_name:")