init
This commit is contained in:
@@ -0,0 +1,291 @@
|
||||
/**
|
||||
*
|
||||
* Author : Aditya Shakya (adi1090x)
|
||||
* Github : @adi1090x
|
||||
*
|
||||
* Rofi Theme File
|
||||
* Rofi Version: 1.7.3
|
||||
**/
|
||||
|
||||
/*****----- Configuration -----*****/
|
||||
configuration {
|
||||
modi: "drun,run,filebrowser,window";
|
||||
show-icons: true;
|
||||
drun-display-format: "{name}";
|
||||
}
|
||||
|
||||
/*****----- Global Properties -----*****/
|
||||
@import "../config.rasi"
|
||||
@import "../colors.rasi"
|
||||
@import "../fonts.rasi"
|
||||
|
||||
* {
|
||||
border-colour: var(border);
|
||||
handle-colour: var(selected);
|
||||
background-colour: var(background);
|
||||
foreground-colour: var(foreground);
|
||||
alternate-background: var(background-alt);
|
||||
normal-background: var(background);
|
||||
normal-foreground: var(foreground);
|
||||
urgent-background: var(urgent);
|
||||
urgent-foreground: var(background);
|
||||
active-background: var(active);
|
||||
active-foreground: var(background);
|
||||
selected-normal-background: var(selected);
|
||||
selected-normal-foreground: var(background);
|
||||
selected-urgent-background: var(active);
|
||||
selected-urgent-foreground: var(background);
|
||||
selected-active-background: var(urgent);
|
||||
selected-active-foreground: var(background);
|
||||
alternate-normal-background: var(background);
|
||||
alternate-normal-foreground: var(foreground);
|
||||
alternate-urgent-background: var(urgent);
|
||||
alternate-urgent-foreground: var(background);
|
||||
alternate-active-background: var(active);
|
||||
alternate-active-foreground: var(background);
|
||||
}
|
||||
|
||||
/*****----- Main Window -----*****/
|
||||
window {
|
||||
/* properties for window widget */
|
||||
transparency: "real";
|
||||
location: center;
|
||||
anchor: center;
|
||||
fullscreen: false;
|
||||
width: 600px;
|
||||
x-offset: 0px;
|
||||
y-offset: 0px;
|
||||
|
||||
/* properties for all widgets */
|
||||
enabled: true;
|
||||
|
||||
cursor: "default";
|
||||
/* Backgroud Colors */
|
||||
background-color: @background-colour;
|
||||
/* Backgroud Image */
|
||||
//background-image: url("/path/to/image.png", none);
|
||||
/* Simple Linear Gradient */
|
||||
//background-image: linear-gradient(red, orange, pink, purple);
|
||||
/* Directional Linear Gradient */
|
||||
//background-image: linear-gradient(to bottom, pink, yellow, magenta);
|
||||
/* Angle Linear Gradient */
|
||||
//background-image: linear-gradient(45, cyan, purple, indigo);
|
||||
}
|
||||
|
||||
/*****----- Main Box -----*****/
|
||||
mainbox {
|
||||
enabled: true;
|
||||
spacing: 10px;
|
||||
margin: 0px;
|
||||
padding: 30px;
|
||||
border: 0px solid;
|
||||
border-radius: 0px 0px 0px 0px;
|
||||
border-color: @border-colour;
|
||||
background-color: transparent;
|
||||
children: [ "message", "listview", "inputbar" ];
|
||||
}
|
||||
|
||||
/*****----- Inputbar -----*****/
|
||||
inputbar {
|
||||
enabled: true;
|
||||
spacing: 10px;
|
||||
margin: 0;
|
||||
padding: 20px 0px 0;
|
||||
border: 0px solid;
|
||||
border-radius: 0px;
|
||||
border-color: @border-colour;
|
||||
background-color: transparent;
|
||||
text-color: @foreground-colour;
|
||||
children: [ "textbox-prompt-colon", "entry", "mode-switcher" ];
|
||||
}
|
||||
|
||||
prompt {
|
||||
enabled: true;
|
||||
background-color: inherit;
|
||||
text-color: inherit;
|
||||
}
|
||||
textbox-prompt-colon {
|
||||
enabled: true;
|
||||
padding: 5px 0px 0px 15px;
|
||||
expand: false;
|
||||
font: "MonarchOS 14";
|
||||
str: "";
|
||||
background-color: inherit;
|
||||
text-color: inherit;
|
||||
}
|
||||
entry {
|
||||
enabled: true;
|
||||
padding: 5px 0px;
|
||||
background-color: inherit;
|
||||
text-color: inherit;
|
||||
cursor: text;
|
||||
placeholder: "...";
|
||||
placeholder-color: inherit;
|
||||
}
|
||||
num-filtered-rows {
|
||||
enabled: true;
|
||||
expand: false;
|
||||
background-color: inherit;
|
||||
text-color: inherit;
|
||||
}
|
||||
textbox-num-sep {
|
||||
enabled: true;
|
||||
expand: false;
|
||||
str: "/";
|
||||
background-color: inherit;
|
||||
text-color: inherit;
|
||||
}
|
||||
num-rows {
|
||||
enabled: true;
|
||||
expand: false;
|
||||
background-color: inherit;
|
||||
text-color: inherit;
|
||||
}
|
||||
case-indicator {
|
||||
enabled: true;
|
||||
background-color: inherit;
|
||||
text-color: inherit;
|
||||
}
|
||||
|
||||
/*****----- Listview -----*****/
|
||||
listview {
|
||||
enabled: true;
|
||||
columns: 2;
|
||||
lines: 8;
|
||||
cycle: true;
|
||||
dynamic: true;
|
||||
scrollbar: false;
|
||||
layout: vertical;
|
||||
reverse: false;
|
||||
fixed-height: true;
|
||||
fixed-columns: true;
|
||||
|
||||
spacing: 5px;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
border: 0px solid;
|
||||
border-radius: 0px;
|
||||
border-color: @border-colour;
|
||||
background-color: transparent;
|
||||
text-color: @foreground-colour;
|
||||
cursor: "default";
|
||||
}
|
||||
scrollbar {
|
||||
handle-width: 5px;
|
||||
handle-color: @handle-colour;
|
||||
border-radius: 10px;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
/*****----- Elements -----*****/
|
||||
element {
|
||||
enabled: true;
|
||||
spacing: 0;
|
||||
margin: 0px;
|
||||
padding: 5px 10px;
|
||||
border: 0px solid;
|
||||
border-radius: 10px;
|
||||
border-color: @border-colour;
|
||||
background-color: transparent;
|
||||
text-color: @foreground-colour;
|
||||
cursor: pointer;
|
||||
}
|
||||
element normal.normal {
|
||||
background-color: transparent;
|
||||
text-color: var(normal-foreground);
|
||||
}
|
||||
element normal.urgent {
|
||||
background-color: var(urgent-background);
|
||||
text-color: var(urgent-foreground);
|
||||
}
|
||||
element normal.active {
|
||||
background-color: var(normal-foreground);
|
||||
text-color: var(normal-background);
|
||||
}
|
||||
element selected.normal {
|
||||
background-color: var(selected-normal-background);
|
||||
text-color: var(normal-foreground);
|
||||
}
|
||||
element selected.urgent {
|
||||
background-color: var(selected-urgent-background);
|
||||
text-color: var(normal-background);
|
||||
}
|
||||
element selected.active {
|
||||
background-color: var(selected-active-background);
|
||||
text-color: var(normal-background);
|
||||
}
|
||||
|
||||
element-icon {
|
||||
background-color: transparent;
|
||||
text-color: inherit;
|
||||
size: 0;
|
||||
cursor: inherit;
|
||||
}
|
||||
element-text {
|
||||
background-color: transparent;
|
||||
text-color: inherit;
|
||||
highlight: inherit;
|
||||
cursor: inherit;
|
||||
vertical-align: 0.5;
|
||||
horizontal-align: 0.0;
|
||||
}
|
||||
|
||||
/*****----- Mode Switcher -----*****/
|
||||
mode-switcher{
|
||||
enabled: true;
|
||||
spacing: 10px;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
border: 0px solid;
|
||||
border-radius: 0px;
|
||||
border-color: @border-colour;
|
||||
background-color: transparent;
|
||||
text-color: @foreground-colour;
|
||||
}
|
||||
button {
|
||||
padding: 7px 15px 7px 10px;
|
||||
border: 0px solid;
|
||||
border-radius: 100%;
|
||||
border-color: @border-colour;
|
||||
background-color: @alternate-background;
|
||||
text-color: inherit;
|
||||
cursor: pointer;
|
||||
}
|
||||
button selected {
|
||||
background-color: var(selected-normal-background);
|
||||
text-color: var(selected-normal-foreground);
|
||||
}
|
||||
|
||||
/*****----- Message -----*****/
|
||||
message {
|
||||
enabled: true;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
border: 0px solid;
|
||||
border-radius: 0px 0px 0px 0px;
|
||||
border-color: @border-colour;
|
||||
background-color: transparent;
|
||||
text-color: @foreground-colour;
|
||||
}
|
||||
textbox {
|
||||
padding: 8px 10px;
|
||||
border: 0px solid;
|
||||
border-radius: 10px;
|
||||
border-color: @border-colour;
|
||||
background-color: @alternate-background;
|
||||
text-color: @foreground-colour;
|
||||
vertical-align: 0.5;
|
||||
horizontal-align: 0.0;
|
||||
highlight: none;
|
||||
placeholder-color: @foreground-colour;
|
||||
blink: true;
|
||||
markup: true;
|
||||
}
|
||||
error-message {
|
||||
padding: 10px;
|
||||
border: 2px solid;
|
||||
border-radius: 10px;
|
||||
border-color: @border-colour;
|
||||
background-color: @background-colour;
|
||||
text-color: @foreground-colour;
|
||||
}
|
||||
Executable
+151
@@ -0,0 +1,151 @@
|
||||
#!/usr/bin/env bash
|
||||
# author: unknown
|
||||
# sentby: MoreChannelNoise (https://www.youtube.com/user/MoreChannelNoise)
|
||||
# editby: gotbletu (https://www.youtube.com/user/gotbletu)
|
||||
|
||||
# demo: https://www.youtube.com/watch?v=kxJClZIXSnM
|
||||
# info: this is a script to launch other rofi scripts,
|
||||
# saves us the trouble of binding multiple hotkeys for each script,
|
||||
# when we can just use one hotkey for everything.
|
||||
|
||||
declare -A LABELS
|
||||
declare -A COMMANDS
|
||||
|
||||
###
|
||||
# List of defined 'bangs'
|
||||
|
||||
# launch programs
|
||||
# COMMANDS["apps"]="rofi -combi-modi window,drun -show combi"
|
||||
# LABELS["apps"]=""
|
||||
|
||||
# open bookmarks
|
||||
# COMMANDS["bookmarks"]="~/.scripts/rofi-scripts-collection/rofi-surfraw-bookmarks.sh"
|
||||
# LABELS["bookmarks"]=""
|
||||
|
||||
# search local files
|
||||
COMMANDS[""]="~/.config/rofi/locate/rofi-locate.sh"
|
||||
LABELS[""]="Locate"
|
||||
|
||||
# open custom web searches
|
||||
# COMMANDS["websearch"]="~/.scripts/rofi-scripts-collection/rofi-surfraw-websearch.sh"
|
||||
# LABELS["websearch"]=""
|
||||
|
||||
# show clipboard history
|
||||
# source: https://bitbucket.org/pandozer/rofi-clipboard-manager/overview
|
||||
# COMMANDS["clipboard"]='rofi -modi "clipboard:~/.bin/rofi-clipboard-manager/mclip.py menu" -show clipboard && ~/.bin/rofi-clipboard-manager/mclip.py paste'
|
||||
# LABELS["clipboard"]=""
|
||||
|
||||
# references --------------------------
|
||||
# COMMANDS[";sr2"]="chromium 'wikipedia.org/search-redirect.php?search=\" \${input}\""
|
||||
# LABELS[";sr2"]=""
|
||||
|
||||
# COMMANDS[";piratebay"]="chromium --disk-cache-dir=/tmp/cache http://thepiratebay.org/search/\" \${input}\""
|
||||
# LABELS[";piratebay"]=""
|
||||
|
||||
# COMMANDS[".bin"]="spacefm -r '/home/dka/bin'"
|
||||
# LABELS[".bin"]=".bin"
|
||||
|
||||
# COMMANDS["#screenshot"]='/home/dka/bin/screenshot-scripts/myscreenshot.sh'
|
||||
# LABELS["#screenshot"]="screenshot"
|
||||
|
||||
# greenclip clipboard history
|
||||
# source: https://github.com/erebe/greenclip
|
||||
COMMANDS[""]='rofi -modi "clipboard:greenclip print" -show Clipboard'
|
||||
LABELS[""]="Clipboard"
|
||||
|
||||
COMMANDS[""]='~/.config/rofi/nm-vpn/nm-vpn.sh'
|
||||
LABELS[""]='VPN Connection Manager'
|
||||
|
||||
COMMANDS[""]='~/.config/rofi/volume/volume.sh'
|
||||
LABELS[""]='Sound Manager'
|
||||
|
||||
COMMANDS[""]='~/.config/rofi/shortcuts/shortcuts.sh'
|
||||
LABELS[""]='Hotkey List'
|
||||
|
||||
COMMANDS[""]='wlogout'
|
||||
LABELS[""]='Session Menu'
|
||||
|
||||
COMMANDS[""]='wdisplays'
|
||||
LABELS[""]='Display Setup'
|
||||
|
||||
COMMANDS[""]='nwg-look'
|
||||
LABELS[""]='Appearance Settings'
|
||||
|
||||
COMMANDS[""]='noisetorch'
|
||||
LABELS[""]='Audio Noise Reduction'
|
||||
|
||||
COMMANDS[""]='/home/dom/.local/share/headset-charge-indicator/headset-charge-indicator.py &'
|
||||
LABELS[""]='Headset Control'
|
||||
|
||||
COMMANDS[""]='~/.config/rofi/bluetooth/bluetooth.sh'
|
||||
LABELS[""]='Bluetooth Control'
|
||||
|
||||
COMMANDS[""]='nm-applet --indicator &'
|
||||
LABELS[""]='Networker Manager'
|
||||
|
||||
COMMANDS[""]='hyprpicker -f hex -a'
|
||||
LABELS[""]='Color Picker'
|
||||
|
||||
COMMANDS[""]='font-manager'
|
||||
LABELS[""]='Font Manager'
|
||||
|
||||
COMMANDS[""]='gufw'
|
||||
LABELS[""]='Firewall Settings'
|
||||
|
||||
COMMANDS[""]='stacer'
|
||||
LABELS[" "]='System Maintenance'
|
||||
|
||||
|
||||
################################################################################
|
||||
# do not edit below
|
||||
################################################################################
|
||||
##
|
||||
# Generate menu
|
||||
##
|
||||
function print_menu()
|
||||
{
|
||||
for key in ${!LABELS[@]}
|
||||
do
|
||||
# echo "$key ${LABELS}"
|
||||
echo "$key ${LABELS[$key]}"
|
||||
# my top version just shows the first field in labels row, not two words side by side
|
||||
done
|
||||
}
|
||||
##
|
||||
# Show rofi.
|
||||
##
|
||||
function start()
|
||||
{
|
||||
# print_menu | rofi -dmenu -p "?=>"
|
||||
print_menu | sort | rofi -show "Tools" -dmenu -mesg " Tools" -i -p "rofi-bangs: "
|
||||
}
|
||||
|
||||
|
||||
# Run it
|
||||
value="$(start)"
|
||||
|
||||
# Split input.
|
||||
# grab upto first space.
|
||||
choice=${value%%\ *}
|
||||
# graph remainder, minus space.
|
||||
input=${value:$((${#choice}+1))}
|
||||
|
||||
##
|
||||
# Cancelled? bail out
|
||||
##
|
||||
if test -z ${choice}
|
||||
then
|
||||
exit
|
||||
fi
|
||||
|
||||
# check if choice exists
|
||||
if test ${COMMANDS[$choice]+isset}
|
||||
then
|
||||
# Execute the choice
|
||||
eval echo "Executing: ${COMMANDS[$choice]}"
|
||||
eval ${COMMANDS[$choice]}
|
||||
else
|
||||
eval $choice | rofi
|
||||
# prefer my above so I can use this same script to also launch apps like geany or leafpad etc (DK)
|
||||
# echo "Unknown command: ${choice}" | rofi -dmenu -p "error"
|
||||
fi
|
||||
Executable
+50
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
#https://github.com/luiscrjunior/rofi-json
|
||||
|
||||
user_file="$(eval echo ${1})"
|
||||
|
||||
if [[ "$user_file" = /* ]]
|
||||
then
|
||||
config_file="$user_file"
|
||||
else
|
||||
cwd=$(dirname $0)
|
||||
config_file="${cwd}/${user_file}"
|
||||
fi
|
||||
|
||||
json=$(cat ${config_file})
|
||||
|
||||
if [ $# -eq 1 ]; then
|
||||
echo $json | jq -cr '.[] | "\(.name)|\(.command)|\(.icon)"' |
|
||||
while IFS="|" read -r name command icon
|
||||
do
|
||||
if [[ $name == "null" ]]; then
|
||||
continue
|
||||
fi
|
||||
if [[ $icon == "null" ]]; then
|
||||
icon="system-run"
|
||||
fi
|
||||
echo -en "${name}\0icon\x1f${icon}\n"
|
||||
done
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -eq 2 ]; then
|
||||
|
||||
selected=$2
|
||||
task=$(echo $json | jq ".[] | select(.name == \"$selected\")")
|
||||
|
||||
if [[ $task == "" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
command=$(echo $task | jq -j ".command")
|
||||
|
||||
if [[ $command == "null" ]]; then
|
||||
command=$(echo $task | jq -j ".name")
|
||||
fi
|
||||
|
||||
coproc bash -c "$command"
|
||||
exit
|
||||
|
||||
fi
|
||||
Reference in New Issue
Block a user