+ Tweak mcpelauncher-rpc, and added vimsence
This commit is contained in:
parent
27836b911b
commit
ef10f5098f
3 changed files with 81 additions and 17 deletions
|
@ -3,8 +3,12 @@
|
||||||
" VIM-Plug - Plugin Manager
|
" VIM-Plug - Plugin Manager
|
||||||
" ==============================
|
" ==============================
|
||||||
|
|
||||||
|
" ----- Vim Plugin Directory (Change required)
|
||||||
|
let $vimplug_bundle='~/.local/share/vim/bundle'
|
||||||
|
" let $vimplug_bundle='c:\_local\share\vim\bundle'
|
||||||
|
|
||||||
" ----- List of used plugins
|
" ----- List of used plugins
|
||||||
call plug#begin('~/.local/share/vim/bundle')
|
call plug#begin($vimplug_bundle)
|
||||||
|
|
||||||
Plug 'deoplete-plugins/deoplete-jedi'
|
Plug 'deoplete-plugins/deoplete-jedi'
|
||||||
Plug 'kovetskiy/sxhkd-vim'
|
Plug 'kovetskiy/sxhkd-vim'
|
||||||
|
@ -35,6 +39,10 @@ else
|
||||||
Plug 'rbgrouleff/bclose.vim'
|
Plug 'rbgrouleff/bclose.vim'
|
||||||
endif
|
endif
|
||||||
Plug 'tpope/vim-commentary'
|
Plug 'tpope/vim-commentary'
|
||||||
|
" Plug '~/vim-rpc', {'dir': '~/.local/share/vim/bundle/vim-rpc'}
|
||||||
|
Plug 'hugolgst/vimsence'
|
||||||
|
" Plug 'vbe0201/vimdiscord'
|
||||||
|
" Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
||||||
|
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
|
@ -43,9 +51,31 @@ call plug#end()
|
||||||
let g:deoplete#enable_at_startup = 1
|
let g:deoplete#enable_at_startup = 1
|
||||||
inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
|
inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
|
||||||
|
|
||||||
|
" - coc.nvim
|
||||||
|
|
||||||
|
" " TextEdit might fail if hidden is not set.
|
||||||
|
" set hidden
|
||||||
|
|
||||||
|
" " Some servers have issues with backup files, see #649.
|
||||||
|
" set nobackup
|
||||||
|
" set nowritebackup
|
||||||
|
|
||||||
|
" " Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
|
||||||
|
" " delays and poor user experience.
|
||||||
|
" set updatetime=300
|
||||||
|
|
||||||
|
" " Don't pass messages to |ins-completion-menu|.
|
||||||
|
" set shortmess+=c
|
||||||
|
|
||||||
|
" inoremap <silent><expr> <TAB>
|
||||||
|
" \ pumvisible() ? "\<C-n>" :
|
||||||
|
" \ <SID>check_back_space() ? "\<TAB>" :
|
||||||
|
" \ coc#refresh()
|
||||||
|
" inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
|
||||||
|
|
||||||
" - Lf
|
" - Lf
|
||||||
let g:lf_map_keys = 0
|
" let g:lf_map_keys = 0
|
||||||
map <C-n> :Lf<CR>
|
" map <C-n> :Lf<CR>
|
||||||
|
|
||||||
" - YouCompleteMe
|
" - YouCompleteMe
|
||||||
" let g:ycm_autoclose_preview_window_after_completion = 1
|
" let g:ycm_autoclose_preview_window_after_completion = 1
|
||||||
|
@ -62,4 +92,3 @@ let g:UltiSnipsExpandTrigger="<C-Tab>"
|
||||||
let g:UltiSnipsJumpForwardTrigger="<C-Tab>"
|
let g:UltiSnipsJumpForwardTrigger="<C-Tab>"
|
||||||
let g:UltiSnipsJumpBackwardTrigger="<S-Tab>"
|
let g:UltiSnipsJumpBackwardTrigger="<S-Tab>"
|
||||||
let g:UltiSnipsEditSplit="vertical"
|
let g:UltiSnipsEditSplit="vertical"
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ set smartcase
|
||||||
set mouse=a
|
set mouse=a
|
||||||
syntax on
|
syntax on
|
||||||
filetype indent plugin on
|
filetype indent plugin on
|
||||||
" map <C-n> :NERDTreeToggle<CR>
|
map <C-n> :NERDTreeToggle<CR>
|
||||||
|
|
||||||
" ----- Mapping
|
" ----- Mapping
|
||||||
" Norm but in shortcut
|
" Norm but in shortcut
|
||||||
|
@ -56,3 +56,13 @@ augroup myvimrc
|
||||||
au BufWritePost vim_uni so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif
|
au BufWritePost vim_uni so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif
|
||||||
au BufWritePost vim_win so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif
|
au BufWritePost vim_win so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
|
" ----- Discord Rich Presences API
|
||||||
|
let g:vimsence_client_id = '733622032901603388'
|
||||||
|
let g:vimsence_small_text = 'Neovim'
|
||||||
|
let g:vimsence_small_image = 'nvim'
|
||||||
|
" let g:vimsence_large_image = 'ts'
|
||||||
|
let g:vimsence_editing_details = 'Editing {}'
|
||||||
|
let g:vimsence_editing_state = 'Workspace: {}'
|
||||||
|
let g:vimsence_file_explorer_text = 'In NERDTree'
|
||||||
|
let g:vimsence_file_explorer_details = 'Looking for files'
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import sys, getopt, pypresence, time, psutil
|
import sys, getopt, pypresence, time, psutil
|
||||||
|
from subprocess import check_output
|
||||||
|
|
||||||
# ----- RPC Client ID
|
# ----- RPC Client ID
|
||||||
RPC = pypresence.Presence("731745989039489036")
|
RPC = pypresence.Presence("731745989039489036")
|
||||||
|
|
||||||
# ----- Functions
|
# ----- Functions
|
||||||
|
def get_pid(name):
|
||||||
|
return map(int,check_output(["pidof","-s",name]).split())
|
||||||
|
|
||||||
def connect_rpc():
|
def connect_rpc():
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
|
@ -18,28 +22,49 @@ def connect_rpc():
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
|
|
||||||
def check_mcbe():
|
def check_mcbe():
|
||||||
|
# get_pid("mcpelauncher-client")
|
||||||
return 'MINECRAFT MAIN ' in (p.name() for p in psutil.process_iter())
|
return 'MINECRAFT MAIN ' in (p.name() for p in psutil.process_iter())
|
||||||
|
|
||||||
# ----- Command-Line Arguments
|
def update_rpc():
|
||||||
mcbe_game=str(sys.argv[1])
|
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 to RPC
|
||||||
connect_rpc()
|
connect_rpc()
|
||||||
|
|
||||||
# ----- Config
|
|
||||||
local_time=time.localtime()
|
|
||||||
start_time=time.mktime(local_time)
|
|
||||||
|
|
||||||
# ----- Loops
|
# ----- Loops
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
if check_mcbe() == True:
|
if check_mcbe() == True or debug == True:
|
||||||
RPC.update(details=mcbe_game, large_image='minecraft', start=start_time)
|
update_rpc()
|
||||||
print('RPC has been updated.')
|
|
||||||
time.sleep(5)
|
|
||||||
else:
|
else:
|
||||||
print('Minecraft is not running')
|
print(color.BOLD + '[ ' + color.END + color.RED + 'ERROR' + color.END + color.BOLD + ' ] ' + color.END + 'Minecraft is not running')
|
||||||
|
RPC.close
|
||||||
break
|
break
|
||||||
except KeyboardInterrupt as kb:
|
except KeyboardInterrupt as kb:
|
||||||
print('RPC interrupted')
|
print('\n' + color.BOLD + '[ ' + color.END + color.RED + 'ERROR' + color.END + color.BOLD + ' ] ' + color.END + 'RPC interrupted, closing...')
|
||||||
|
RPC.close
|
||||||
break
|
break
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue