+ [2 files changed]
* Removed mcpelauncher scripts (mcpe on linux is ded, thx mojang) * Re-added EDITOR env (still used by other command) * Migration from NCM2 to DDC+nvimlsp
This commit is contained in:
parent
eed95afc24
commit
98395e5ad5
4 changed files with 105 additions and 180 deletions
|
@ -1,7 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
version=$(find ~/.local/share/mcpelauncher/versions -maxdepth 1 | sort -r | awk '!/ns$/ && !/.ini/' | sed "s/^.*s\///" | dmenu -l 10 -i -p "MCPE Versions")
|
||||
[ -z $version ] && exit 1
|
||||
|
||||
gamemoderun mcpelauncher-client -ww 1366 -wh 740 -dg ~/.local/share/mcpelauncher/versions/$version &
|
||||
sleep 5s && mcpelauncher-rpc "$version"
|
|
@ -1,70 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
import sys, getopt, pypresence, time, psutil
|
||||
from subprocess import check_output
|
||||
|
||||
# ----- RPC Client ID
|
||||
RPC = pypresence.Presence("731745989039489036")
|
||||
|
||||
# ----- Functions
|
||||
def get_pid(name):
|
||||
return map(int,check_output(["pidof","-s",name]).split())
|
||||
|
||||
def connect_rpc():
|
||||
while True:
|
||||
try:
|
||||
RPC.connect()
|
||||
break
|
||||
except ConnectionRefusedError as e:
|
||||
print("Failed to connect to RPC! Trying again in 10 seconds...")
|
||||
time.sleep(10)
|
||||
except (FileNotFoundError, AttributeError) as e:
|
||||
print("RPC failed to connect due to Discord not being opened yet.")
|
||||
time.sleep(10)
|
||||
|
||||
def check_mcbe():
|
||||
# get_pid("mcpelauncher-client")
|
||||
return 'MINECRAFT MAIN ' in (p.name() for p in psutil.process_iter())
|
||||
|
||||
def update_rpc():
|
||||
RPC.update(details=mcbe_game, large_image='minecraft', large_text=mcbe_ltext, small_image='world', small_text=mcbe_stext, start=start_time)
|
||||
if debug is True:
|
||||
print(color.BOLD + '[ ' + color.END + color.GREEN + 'OK' + color.END + color.BOLD + ' ] ' + color.END + 'RPC has been updated.')
|
||||
time.sleep(5)
|
||||
|
||||
class color:
|
||||
PURPLE = '\033[95m'
|
||||
CYAN = '\033[96m'
|
||||
DARKCYAN = '\033[36m'
|
||||
BLUE = '\033[94m'
|
||||
GREEN = '\033[92m'
|
||||
YELLOW = '\033[93m'
|
||||
RED = '\033[91m'
|
||||
BOLD = '\033[1m'
|
||||
UNDERLINE = '\033[4m'
|
||||
END = '\033[0m'
|
||||
|
||||
# ----- Command-Line Arguments + Config
|
||||
debug=False
|
||||
mcbe_version=str(sys.argv[1])
|
||||
mcbe_game=str("v" + mcbe_version)
|
||||
mcbe_ltext=str("Using Linux MCPE Launcher")
|
||||
mcbe_ign="Zerogame1432"
|
||||
mcbe_stext="IGN: " + mcbe_ign
|
||||
start_time=int(time.time())
|
||||
|
||||
# ----- Connect to RPC
|
||||
connect_rpc()
|
||||
|
||||
# ----- Loops
|
||||
while True:
|
||||
try:
|
||||
if check_mcbe() == True or debug == True:
|
||||
update_rpc()
|
||||
else:
|
||||
print(color.BOLD + '[ ' + color.END + color.RED + 'ERROR' + color.END + color.BOLD + ' ] ' + color.END + 'Minecraft is not running')
|
||||
RPC.close
|
||||
break
|
||||
except KeyboardInterrupt as kb:
|
||||
print('\n' + color.BOLD + '[ ' + color.END + color.RED + 'ERROR' + color.END + color.BOLD + ' ] ' + color.END + 'RPC interrupted, closing...')
|
||||
RPC.close
|
||||
break
|
Loading…
Add table
Add a link
Reference in a new issue