mirror of
https://github.com/ksyasuda/dotfiles.git
synced 2025-12-06 02:53:38 -08:00
update
This commit is contained in:
21
.config/rofi/scripts/rofi-youtube.py
Executable file
21
.config/rofi/scripts/rofi-youtube.py
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Sends the search query to a new tab in the browser"""
|
||||
|
||||
from subprocess import Popen
|
||||
from sys import exit as sysexit
|
||||
|
||||
from rofi import Rofi
|
||||
|
||||
BROWSER = "google-chrome-stable"
|
||||
|
||||
if __name__ == "__main__":
|
||||
rofi = Rofi(
|
||||
config_file="~/Projects/Scripts/aniwrapper/themes/aniwrapper-nord2.rasi",
|
||||
theme_str="configuration {dpi: 144;} window {width: 45%;} listview {columns: 1; lines: 1;}",
|
||||
)
|
||||
query = rofi.text_entry("Search Youtube", rofi_args=["-i"])
|
||||
if query is None or query == "":
|
||||
sysexit(1)
|
||||
url = "https://www.youtube.com/results?search_query={}".format(query)
|
||||
with Popen([BROWSER, url]) as proc:
|
||||
proc.wait()
|
||||
Reference in New Issue
Block a user