Last active
November 21, 2024 19:04
-
-
Save cirrusUK/0eae026a298e918f23d16f381f628bbd to your computer and use it in GitHub Desktop.
rofi scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# author: unknown | |
# | |
# ▓▓▓▓▓▓▓▓▓▓ | |
# ░▓ author ▓ cirrus <[email protected]> | |
# ░▓ code ▓ https://gist.github.com/cirrusUK | |
# ░▓ mirror ▓ http://cirrus.turtil.net | |
# ░▓▓▓▓▓▓▓▓▓▓ | |
# ░░░░░░░░░░ | |
# | |
declare -A LABELS | |
declare -A COMMANDS | |
### | |
# List of defined 'bangs' | |
# launch programs | |
COMMANDS["teiler"]="teiler" | |
LABELS["teiler"]="" | |
# launch programs | |
COMMANDS["apps"]="rofi -show run" | |
LABELS["apps"]="" | |
# open bookmarks | |
COMMANDS["bookmarks"]="~/scripts/rofi-surfraw-bookmarks.sh" | |
LABELS["bookmarks"]="" | |
# search local files | |
COMMANDS["locate"]="~/scripts/rofi-locate.sh" | |
LABELS["locate"]="" | |
# playlist | |
COMMANDS["playlist"]="~/scripts/playlist.sh" | |
LABELS["playlist"]="" | |
# open custom web searches | |
COMMANDS["websearch"]="~/scripts/rofi-surfraw-websearch.sh" | |
LABELS["websearch"]="" | |
# show football scores | |
COMMANDS["scores"]="w2m http://www.livescores.com/soccer/live/ \" \${input}\"" | |
LABELS["scores"]="" | |
# COMMANDS[".bin"]="spacefm -r '/home/dkm/bin'" | |
# LABELS[".bin"]=".bin" | |
# COMMANDS["#screenshot"]='/home/dka/bin/screenshot-scripts/myscreenshot.sh' | |
# LABELS["#screenshot"]="screenshot" | |
################################################################################ | |
# 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 | rofi -dmenu -mesg ">>> launch your custom rofi scripts" -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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
action=$(echo close | rofi -dmenu -p "Google: ") | |
search () { | |
query=$1 | |
index=$2 | |
sel=$(printf "$(googler -n 15 -s $2 --json $1 | jq '.[].url' | sed -e 's/^"//' -e 's/"$//')\nMore\n" | rofi -dmenu) | |
case $sel in | |
"") exit ;; | |
"More") search $query $(expr $index + 15) ;; | |
*) firefox --new-tab $sel ;; | |
esac | |
} | |
search $action 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# ▓▓▓▓▓▓▓▓▓▓ | |
# ░▓ author ▓ cirrus <[email protected]> | |
# ░▓ code ▓ https://gist.github.com/cirrusUK | |
# ░▓ mirror ▓ http://cirrus.turtil.net | |
# ░▓▓▓▓▓▓▓▓▓▓ | |
# ░░░░░░░░░░ | |
# | |
#█▓▒░ | |
open "$(locate / home | rofi -threads 3 -width 50 -dmenu -i -p "locate:")" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# author: unknown | |
# | |
# ▓▓▓▓▓▓▓▓▓▓ | |
# ░▓ author ▓ cirrus <[email protected]> | |
# ░▓ code ▓ https://gist.github.com/cirrusUK | |
# ░▓ mirror ▓ http://cirrus.turtil.net | |
# ░▓▓▓▓▓▓▓▓▓▓ | |
# ░░░░░░░░░░ | |
# | |
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-surfraw-bookmarks.sh" | |
#LABELS["bookmarks"]="" | |
# search local files | |
#COMMANDS["locate"]="~/scripts/rofi-locate.sh" | |
#LABELS["locate"]="" | |
# open custom web searches | |
#COMMANDS["websearch"]="~/scripts/rofi-surfraw-websearch.sh" | |
#LABELS["websearch"]="" | |
# playlist | |
#COMMANDS["playlist"]="/home/cirrus/.config/rofi/playlist" | |
#LABELS["playlist"]="" | |
# Discovery_I.D | |
COMMANDS["Discovery_I.D"]="sopcast-launcher sop://broker.sopcast.com:3912/256244 --player mpv" | |
LABELS["Discovery_I.D"]="" | |
# BBC_Earth | |
COMMANDS["BBC_Earth"]="sopcast-launcher sop://broker.sopcast.com:3912/148257 --player mpv" | |
LABELS["BBC_Earth"]="" | |
# Paramount | |
COMMANDS["Paramount"]="sopcast-launcher sop://broker.sopcast.com:3912/253033 --player mpv" | |
LABELS["Paramount"]="" | |
# Sky_Sports1 | |
COMMANDS["Sky_Sports1 "]="acestream-launcher acestream://e061202217ea02d1c62e03688eaa3a60ee7b6829 --player mpv" | |
LABELS["Sky_Sports1 "]="" | |
# Sky_Sports2 | |
COMMANDS["Sky_Sports2 "]="acestream://e524f1380a0f1549895f6727368c8ddffb3a8c37 --player mpv" | |
LABELS["Sky_Sports2 "]="" | |
# Sky_Sports3 | |
COMMANDS["Sky_Sports3 "]="acestream://c4ff54b834532047fc0aa1779d17281f193d6938 --player mpv" | |
LABELS["Sky_Sports3 "]="" | |
# Sky_Sports4 | |
COMMANDS["Sky_Sports4 "]="acestream://2d90f57b2c8a5e12b30fed41b6b5ac7a122f68ca --player mpv" | |
LABELS["Sky_Sports4 "]="" | |
# Sky_Sports5 | |
COMMANDS["Sky_Sports5 "]="acestream://bd90b972fafedec4211b18b6c34a5c2253ae94de --player mpv" | |
LABELS["Sky_Sports5 "]="" | |
# TLC | |
COMMANDS["TLC"]="sopcast-launcher sop://broker.sopcast.com:3912/148256 --player mpv" | |
LABELS["TLC"]="" | |
# History | |
COMMANDS["History"]="sopcast-launcher sop://broker.sopcast.com:3912/253032 --player mpv" | |
LABELS["History"]="" | |
# NatGeo | |
COMMANDS["NatGeo"]="sopcast-launcher sop://broker.sopcast.com:3912/148248 --player mpv" | |
LABELS["NatGeo"]="" | |
# Discovery | |
COMMANDS["Discovery"]="sopcast-launcher sop://broker.sopcast.com:3912/256241 --player mpv" | |
LABELS["Discovery"]="" | |
# Crime1 | |
COMMANDS["Crime1"]="mpv http://www.dailymotion.com/crimetime-tv" | |
LABELS["Crime1"]="" | |
# Cops | |
COMMANDS["Cops"]='streamlink -p mpv "https://www.arconai.tv/stream.php?id=33" live' | |
LABELS["Cops"]="" | |
# Big_Bang_Theory | |
COMMANDS["Big_Bang_Theory"]='streamlink -p mpv "https://www.arconai.tv/stream.php?id=91" live' | |
LABELS["Big_Bang_Theory"]="" | |
# Family_Guy | |
COMMANDS["Family_Guy"]='streamlink -p mpv "https://www.arconai.tv/stream.php?id=41" live' | |
LABELS["Family_Guy"]="" | |
# Southpark | |
COMMANDS["Southpark"]='streamlink -p mpv "https://www.arconai.tv/stream.php?id=84" live' | |
LABELS["Southpark"]="" | |
# Friends | |
COMMANDS["Friends"]='streamlink -p mpv "https://www.arconai.tv/stream.php?id=47" live' | |
LABELS["Friends"]="" | |
# NatGeoWild | |
COMMANDS["NatGeoWild"]='streamlink -p mpv "https://vaughnlive.tv/lmshows_ngbbc" live' | |
LABELS["NatGeoWild"]="" | |
# World_At_War | |
COMMANDS["World_At_War"]='streamlink -p mpv "https://vaughnlive.tv/world_at_war" live' | |
LABELS["World_At_War"]="" | |
# Westerns | |
COMMANDS["Westerns"]='streamlink -p mpv "https://vaughnlive.tv/the_old_west" live' | |
LABELS["Westerns"]="" | |
# BoB_2012 | |
COMMANDS["BoB_2012"]='streamlink -p mpv "https://vaughnlive.tv/bob__2012" live' | |
LABELS["BoB_2012"]="" | |
# Southpark1 | |
COMMANDS["Southpark1"]='streamlink -p mpv "https://vaughnlive.tv/southparktv2" live' | |
LABELS["Southpark1"]="" | |
# CBS | |
COMMANDS["CBS"]='streamlink -p mpv "https://www.filmon.com/tv/cbs-reality" low' | |
LABELS["CBS"]="" | |
# CBS1 | |
COMMANDS["CBS1"]='streamlink -p mpv "https://www.filmon.com/tv/cbs-reality1" low' | |
LABELS["CBS1"]="" | |
# CBS1 | |
COMMANDS["NATGEOWILD_HD"]="mpv 'http://185.19.191.94:8090/NATGEOWILD/index.m3u8'" | |
LABELS["NATGEOWILD_HD"]="" | |
# BBC1_Scotland | |
COMMANDS["BBC1_Scotland"]='streamlink -p mpv "https://www.filmon.com/tv/bbc-1-scotland" low' | |
LABELS["BBC1_Scotland"]="" | |
# BBC2 | |
COMMANDS["BBC2"]='streamlink -p mpv "https://www.filmon.com/tv/bbc-two" low' | |
LABELS["BBC2"]="" | |
# ITV1 | |
COMMANDS["ITV1"]='streamlink -p mpv "https://www.filmon.com/tv/itv1" low' | |
LABELS["ITV1"]="" | |
# TRUTV | |
COMMANDS["TRUTV"]='streamlink -p mpv "https://www.filmon.com/tv/tru-tv" low' | |
LABELS["TRUTV"]="" | |
# CBS_Drama | |
COMMANDS["CBS_Drama"]='streamlink -p mpv "https://www.filmon.com/tv/cbs-drama" low' | |
LABELS["CBS_Drama"]="" | |
# BTSports1 | |
COMMANDS["BTSports1"]='streamlink -p mpv "https://brittv.co.uk/watch/?channel=395" worst' | |
LABELS["BTSports1"]="" | |
# BTSports2 | |
COMMANDS["BTSports2"]='streamlink -p mpv "https://brittv.co.uk/watch/?channel=398" worst' | |
LABELS["BTSports2"]="" | |
# BTSports3 | |
COMMANDS["BTSports3"]='streamlink -p mpv "https://brittv.co.uk/watch/?channel=399" worst' | |
LABELS["BTSports3"]="" | |
# 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"]="firefox wikipedia.org/search-redirect.php?search=\" \${input}\"" | |
# LABELS["sr2"]="" | |
# COMMANDS["piratebay"]="firefox --disk-cache-dir=/tmp/cache https://thepiratebay-proxy.com/search/\" \${input}\"" | |
# LABELS["piratebay"]="" | |
# COMMANDS[".bin"]="spacefm -r '/home/dkm/bin'" | |
# LABELS[".bin"]=".bin" | |
# COMMANDS["Screenshot"]='/usr/local/bin/rofiscrot' | |
# LABELS["Screenshot"]="screenshot" | |
################################################################################ | |
# 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 | rofi -dmenu -mesg ">>>" -i -p " 🎬 📺 Rofi Video Streams 📺 🎬 " | |
} | |
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment