mirror of
https://github.com/Melon-Bread/gnu-slash-dot-files
synced 2024-11-24 16:28:23 -05:00
updated scripts
This commit is contained in:
parent
a6fa4fc336
commit
83d5339170
0
.bin/Pipgrade.sh
Normal file → Executable file
0
.bin/Pipgrade.sh
Normal file → Executable file
@ -6,7 +6,7 @@ yay -S retroarch-git --noconfirm
|
||||
echo 'Updating Cores....'
|
||||
python ~/Documents/Projects/RetroUFO/RetroUFO.py
|
||||
|
||||
echo 'Updating Thumbnails'
|
||||
cd "~/.config/retroarch/thumbnails/"
|
||||
git pull --recurse-submodules
|
||||
git submodule update --remote --recursive
|
||||
#echo 'Updating Thumbnails'
|
||||
#cd "~/.config/retroarch/thumbnails/"
|
||||
#git pull --recurse-submodules
|
||||
#git submodule update --remote --recursive
|
||||
|
1241
.bin/activate
Executable file
1241
.bin/activate
Executable file
File diff suppressed because it is too large
Load Diff
34
.bin/ff2mpv.py
Executable file
34
.bin/ff2mpv.py
Executable file
@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys, struct, json
|
||||
from subprocess import Popen, DEVNULL
|
||||
|
||||
def main():
|
||||
message = get_message()
|
||||
url = message.get('url')
|
||||
args = ['mpv', '--no-terminal', '--', url]
|
||||
Popen(args, stdin=DEVNULL, stdout=DEVNULL, stderr=DEVNULL)
|
||||
# Need to respond something to avoid "Error: An unexpected error occurred"
|
||||
# in Browser Console.
|
||||
send_message('ok')
|
||||
|
||||
|
||||
# https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Native_messaging#App_side
|
||||
def get_message():
|
||||
raw_length = sys.stdin.buffer.read(4)
|
||||
if not raw_length:
|
||||
return {}
|
||||
length = struct.unpack('@I', raw_length)[0]
|
||||
message = sys.stdin.buffer.read(length).decode('utf-8')
|
||||
return json.loads(message)
|
||||
|
||||
|
||||
def send_message(message):
|
||||
content = json.dumps(message).encode('utf-8')
|
||||
length = struct.pack('@I', len(content))
|
||||
sys.stdout.buffer.write(length)
|
||||
sys.stdout.buffer.write(content)
|
||||
sys.stdout.buffer.flush()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
BIN
.bin/hacbrewpack
Executable file
BIN
.bin/hacbrewpack
Executable file
Binary file not shown.
Loading…
Reference in New Issue
Block a user