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-selectoption-screenshot.sh
Created October 21, 2023 09:31
rofi launcher feature to show screenshot option
#!/bin/bash
options=("Full Screen" "Selected Area" "Active Window")
selected_option=$(printf '%s\n' "${options[@]}" | rofi -dmenu -p "Screenshot Mode:")
case "$selected_option" in
"Full Screen")
notify-send "Taking full-screen screenshot..."
maim ~/Pictures/screenshot-$(date +"%Y-%m-%d_%H-%M-%S").png
#/bin/bash
sudo apt remove --purge libreoffice*
sudo apt autoremove
#!/bin/bash
# Removes old revisions of snaps
# CLOSE ALL SNAPS BEFORE RUNNING THIS
set -eu
LANG=C snap list --all | awk '/disabled/{print $1, $3}' |
while read snapname revision; do
snap remove "$snapname" --revision="$revision"
done
@naranyala
naranyala / rofi-launcher-script-runner.sh
Last active November 13, 2023 09:22
global menu with rofi
#!/bin/bash
declare -A opt
opt["001"]="key-for-system-auth"
opt["002"]="key-for-system-run"
opt["003"]="key-for-system-apps"
opt["004"]="key-for-direct-websearch"
opt["005"]="key-for-emoji-selector"
opt["006"]="key-for-color-picker"
opt["007"]="key-for-handle-wifi"
#!/bin/bash
# Declare an associative array of dir_path
declare -A dir_path
dir_path["AUD-adrenaline"]="/media/naranyala/DiskD/Collections/AUD adrenaline/"
dir_path["AUD-modern-songs"]="/media/naranyala/DiskD/Collections/AUD modern-songs/"
dir_path["AUD-new-all"]="/media/naranyala/DiskD/Collections/AUD new-all/"
# Use Rofi to select a custom directory
selected_path=$(printf '%s\n' "${!dir_path[@]}" | rofi -dmenu -i -p "Goto DIR with VLC: ")
#!/bin/bash
# Declare a custom array of dir_path
declare -A dir_path
dir_path["Downloads"]="$HOME/Downloads/"
dir_path["Pictures"]="$HOME/Pictures/"
dir_path["repos"]="$HOME/repos"
dir_path["dotfiles"]="$HOME/dotfiles"
# Use Rofi to select a custom website
#!/bin/bash
# Get a list of available resolutions using xrandr and sort them in reverse order
resolutions=$(xrandr | awk '/[0-9]x[0-9]/ {print $1}' | sort -n -r)
# Function to display resolution options using Rofi
select_resolution() {
selected_resolution=$(echo -e "$resolutions" | rofi -dmenu -p "Select a resolution:")
if [ -n "$selected_resolution" ]; then
#!/bin/bash
# Detect the laptop display (assuming it contains "eDP" in the name)
laptop_display=""
connected_displays=$(xrandr | grep " connected" | awk '{print $1}')
for display in $connected_displays; do
if [[ $display == *eDP* ]]; then
laptop_display="$display"
break
fi
#!/bin/bash
# redshift-selector.sh
# Generates a list of color temperature labels for selection
generate_menu() {
echo "Very High"
echo "High"
echo "Medium"
echo "Low"
#!/bin/bash
DEFAULT_TERMINAL="kitty"
# Function to display error messages
display_error() {
notify-send "Error" "$1" --icon=dialog-error
}
search_query=$(rofi -dmenu -p "MAN Search: ")