Advertisement
Guest User

Untitled

a guest
Jan 12th, 2023
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.93 KB | Source Code | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. case $ROFI_RETV in
  4.     0 )  # Initial call of script
  5.         echo -en "Google Maps\n"
  6.         echo -en "Arch Wiki\n"
  7.     ;;
  8.     1 ) # Selected an entry
  9.         if [ "$1" = "Google Maps" ]; then
  10.             echo -en "\x00data\x1fmaps\n"
  11.             echo -en "\x00prompt\x1fGoogle Maps\n"
  12.             echo -en " \0nonselectable\x1ftrue\n"
  13.            
  14.         elif [ "$1" = "Arch Wiki" ]; then
  15.             echo -en "\x00data\x1farchwiki\n"
  16.             echo -en "\x00prompt\x1fGoogle Maps\n"
  17.             echo -en " \0nonselectable\x1ftrue\n"
  18.         fi
  19.     ;;
  20.     2 ) # Selected a custom entry
  21.         if [ "$ROFI_DATA" = "maps" ]; then
  22.             coproc ( xdg-open "https://www.google.com/maps/search/${1// /\+}" > /dev/null  2>1 )
  23.         elif [ "$ROFI_DATA" = "archwiki" ]; then
  24.             coproc ( xdg-open "https://wiki.archlinux.org/index.php?search=${1// /\+}" > /dev/null  2>1 )
  25.         fi
  26.     ;;
  27. esac
Tags: rofi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement