Update to Latest
This commit is contained in:
parent
d1bbbcbb15
commit
71d6a8ab3b
157 changed files with 3467 additions and 5151 deletions
75
rofi/search/search.sh
Normal file
75
rofi/search/search.sh
Normal file
|
@ -0,0 +1,75 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Define the directory where Rofi themes are stored
|
||||
dir="$HOME/.config/rofi/search/"
|
||||
theme='style'
|
||||
|
||||
# Prompt user for search input using Rofi dmenu mode
|
||||
SEARCH_STRING=$(rofi -dmenu -p "Search" -theme "${dir}/${theme}.rasi")
|
||||
|
||||
# Check if search string is empty, if so, exit
|
||||
if [[ -z "$SEARCH_STRING" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if the input is a command to change directories
|
||||
if [[ "$SEARCH_STRING" == cd* ]]; then
|
||||
# Extract the directory path
|
||||
DIR_PATH=$(echo "$SEARCH_STRING" | awk '{print $2}')
|
||||
|
||||
# If no path is specified, default to the home directory
|
||||
if [[ -z "$DIR_PATH" ]]; then
|
||||
DIR_PATH="$HOME"
|
||||
fi
|
||||
|
||||
# Open Kitty and navigate to the specified directory
|
||||
kitty --directory="$DIR_PATH" &
|
||||
exit
|
||||
fi
|
||||
|
||||
# Extract the first word as ENGINE and the rest as QUERY
|
||||
ENGINE=$(echo "$SEARCH_STRING" | awk '{print $1}')
|
||||
QUERY=$(echo "$SEARCH_STRING" | awk '{$1=""; print $0}' | sed 's/^ *//g')
|
||||
|
||||
# Handle search engine cases
|
||||
case "$ENGINE" in
|
||||
yt)
|
||||
# If the engine is 'yt' and no query, go to YouTube homepage
|
||||
if [[ -z "$QUERY" ]]; then
|
||||
xdg-open "https://www.youtube.com"
|
||||
else
|
||||
# Search YouTube for the query
|
||||
ENCODED_QUERY=$(echo "$QUERY" | sed 's/ /+/g')
|
||||
xdg-open "https://www.youtube.com/results?search_query=$ENCODED_QUERY"
|
||||
fi
|
||||
exit
|
||||
;;
|
||||
arch)
|
||||
# Search Arch Wiki
|
||||
ENCODED_QUERY=$(echo "$QUERY" | sed 's/ /+/g')
|
||||
xdg-open "https://wiki.archlinux.org/index.php?search=$ENCODED_QUERY"
|
||||
exit
|
||||
;;
|
||||
hypr)
|
||||
# Search Hyprland documentation or relevant page
|
||||
ENCODED_QUERY=$(echo "$QUERY" | sed 's/ /+/g')
|
||||
xdg-open "https://wiki.hyprland.org/Getting-Started/$ENCODED_QUERY"
|
||||
exit
|
||||
;;
|
||||
man)
|
||||
# If the engine is 'man', open the manual page for the command in Kitty
|
||||
MAN_COMMAND=$(echo "$QUERY" | sed 's/^ *//g') # Trim leading whitespace
|
||||
if [[ -z "$MAN_COMMAND" ]]; then
|
||||
echo "No command specified for man. Please provide a command."
|
||||
exit 1
|
||||
else
|
||||
kitty -e man "$MAN_COMMAND" & # Open the man page in Kitty
|
||||
exit
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
# If no known engine, search Google for the whole input
|
||||
ENCODED_QUERY=$(echo "$SEARCH_STRING" | sed 's/ /+/g')
|
||||
xdg-open "https://www.google.com/search?q=$ENCODED_QUERY"
|
||||
;;
|
||||
esac
|
80
rofi/search/style.rasi
Normal file
80
rofi/search/style.rasi
Normal file
|
@ -0,0 +1,80 @@
|
|||
/*****----- Configuration -----*****/
|
||||
configuration {
|
||||
show-icons: false;
|
||||
}
|
||||
|
||||
/*****----- Global Properties -----*****/
|
||||
* {
|
||||
font: "JetBrains Mono Nerd Font 12";
|
||||
background: #11111b;
|
||||
background-alt: #313244;
|
||||
foreground: #eff1f5;
|
||||
selected: #cba6f7;
|
||||
active: #6E77FF;
|
||||
urgent: #8E3596;
|
||||
}
|
||||
|
||||
/*****----- Main Window -----*****/
|
||||
window {
|
||||
transparency: "real";
|
||||
location: center;
|
||||
anchor: center;
|
||||
fullscreen: false;
|
||||
width: 400px;
|
||||
x-offset: 0px;
|
||||
y-offset: 0px;
|
||||
|
||||
/* properties for all widgets */
|
||||
enabled: true;
|
||||
border-radius: 8px;
|
||||
cursor: "default";
|
||||
background-color: @background;
|
||||
}
|
||||
|
||||
/*****----- Main Box -----*****/
|
||||
mainbox {
|
||||
enabled: true;
|
||||
spacing: 0px;
|
||||
background-color: transparent;
|
||||
orientation: vertical;
|
||||
children: [ "inputbar" ];
|
||||
}
|
||||
|
||||
/*****----- Inputbar -----*****/
|
||||
inputbar {
|
||||
enabled: true;
|
||||
spacing: 0px;
|
||||
padding: 28px 24px 24px 24px;
|
||||
background-color: transparent;
|
||||
text-color: @foreground;
|
||||
orientation: horizontal;
|
||||
children: [ "textbox-prompt-colon", "dummy", "entry" ];
|
||||
}
|
||||
|
||||
dummy {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
entry {
|
||||
enabled: true;
|
||||
expand: false;
|
||||
width: 280px;
|
||||
padding: 12px 16px 8px 16px;
|
||||
border-radius: 8px;
|
||||
background-color: @background-alt;
|
||||
text-color: inherit;
|
||||
cursor: text;
|
||||
placeholder: "Search";
|
||||
placeholder-color: inherit;
|
||||
}
|
||||
|
||||
// icon
|
||||
textbox-prompt-colon {
|
||||
enabled: true;
|
||||
expand: false;
|
||||
str: "";
|
||||
padding: 12px 24px 12px 14px;
|
||||
border-radius: 100%;
|
||||
background-color: #a6e3a1;
|
||||
text-color: @background;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue