rofi consul menu
This commit is contained in:
@ -27,6 +27,8 @@ bindsym $mod+Shift+q kill
|
|||||||
# start dmenu (a program launcher)
|
# start dmenu (a program launcher)
|
||||||
bindsym $mod+d exec --no-startup-id rofi -show drun -theme themes/app-launcher
|
bindsym $mod+d exec --no-startup-id rofi -show drun -theme themes/app-launcher
|
||||||
bindsym $mod+i exec --no-startup-id rofi -show window -theme themes/app-launcher
|
bindsym $mod+i exec --no-startup-id rofi -show window -theme themes/app-launcher
|
||||||
|
bindsym $mod+s exec --no-startup-id rofi -show consul -modi consul:~/.config/rofi/scripts/services -theme themes/app-launcher
|
||||||
|
bindsym $mod+c exec --no-startup-id rofi -show ssh -theme themes/app-launcher
|
||||||
|
|
||||||
set $workspacer ~/.config/i3/i3-workspacer.py
|
set $workspacer ~/.config/i3/i3-workspacer.py
|
||||||
|
|
||||||
|
28
.config/rofi/scripts/services
Executable file
28
.config/rofi/scripts/services
Executable file
@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import re
|
||||||
|
import consul
|
||||||
|
import docker
|
||||||
|
import sys
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
running = {}
|
||||||
|
|
||||||
|
c = consul.Consul()
|
||||||
|
client = docker.from_env()
|
||||||
|
|
||||||
|
for services in c.catalog.services():
|
||||||
|
for service in services:
|
||||||
|
|
||||||
|
idx, details = c.catalog.service(service)
|
||||||
|
if len(details) == 0:
|
||||||
|
continue
|
||||||
|
|
||||||
|
for item in details:
|
||||||
|
link = item['ServiceName']+".service."+item['Datacenter']+".consul:"+str(item['ServicePort'])
|
||||||
|
print("http://"+link)
|
||||||
|
|
||||||
|
|
||||||
|
if sys.argv[1]:
|
||||||
|
subprocess.Popen(['xdg-open', sys.argv[1]])
|
||||||
|
sys.exit(1)
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -18,3 +18,4 @@ nbproject
|
|||||||
docker/etc/php/
|
docker/etc/php/
|
||||||
.jira
|
.jira
|
||||||
bin/__pycache__/
|
bin/__pycache__/
|
||||||
|
.config/rofi/scripts/__pycache__/
|
||||||
|
@ -29,7 +29,7 @@ Plug 'terryma/vim-expand-region'
|
|||||||
Plug 'terryma/vim-multiple-cursors'
|
Plug 'terryma/vim-multiple-cursors'
|
||||||
Plug 'editorconfig/editorconfig-vim'
|
Plug 'editorconfig/editorconfig-vim'
|
||||||
|
|
||||||
Plug 'dylanaraps/wal'
|
Plug 'dylanaraps/wal.vim'
|
||||||
|
|
||||||
Plug 'kristijanhusak/vim-carbon-now-sh'
|
Plug 'kristijanhusak/vim-carbon-now-sh'
|
||||||
|
|
||||||
@ -183,6 +183,9 @@ filetype plugin indent on
|
|||||||
|
|
||||||
"autocmd VimEnter * colorscheme farout
|
"autocmd VimEnter * colorscheme farout
|
||||||
autocmd VimEnter * colorscheme fahrenheit
|
autocmd VimEnter * colorscheme fahrenheit
|
||||||
|
colorscheme fahrenheit
|
||||||
|
" autocmd VimEnter * colorscheme wal
|
||||||
|
|
||||||
set bg=light
|
set bg=light
|
||||||
hi Normal guibg=NONE ctermbg=NONE
|
hi Normal guibg=NONE ctermbg=NONE
|
||||||
"autocmd VimEnter *
|
"autocmd VimEnter *
|
||||||
|
Reference in New Issue
Block a user