Use Rofi for workspace management, simplify config

This commit is contained in:
Adam Goldsmith 2016-02-01 14:40:21 -05:00
parent 2648a30f42
commit 0ff8f3030e
5 changed files with 23 additions and 23 deletions

View File

@ -34,11 +34,7 @@ bindsym $mod+Shift+e exec thunderbird
bindsym Mod1+Mod4+s exec /home/adam/.bin/lock.sh suspend # suspend
bindsym Mod1+Control+l exec /home/adam/.bin/lock.sh lock # lock screen
bindsym Mod1+Control+Delete exec /home/adam/.bin/lock.sh pick # power menu
set $rofiOptions -i -bg '#222222' -fg '#cccccc' -fg-active '#ffffff'
bindsym $mod+p exec --no-startup-id ~/.bin/killPanel.sh
bindsym $mod+space exec --no-startup-id "rofi $rofiOptions -modi 'drun,run,workspace:/home/adam/.bin/i3_switch_workspace.sh,window' -sidebar-mode -show drun"
mode "launch" {
bindsym e exec /home/adam/.bin/emacsclient-tmpFix; mode "default"
@ -50,9 +46,11 @@ mode "launch" {
}
bindsym $mod+x mode "launch"
# Workspace Mangement
bindsym $mod+t exec ~/.config/i3/get_workspace_options.py | dmenu -i -dim 0.7 | ~/.config/i3/go_to_workspace.py
bindsym $mod+Shift+t exec ~/.config/i3/get_workspace_options.py | dmenu -i -dim 0.7 | ~/.config/i3/move_to_workspace.py
# Rofi
set $rofiOptions -i -bg '#222222' -fg '#cccccc' -fg-active '#ffffff' -modi 'drun,run,sworkspace:/home/adam/.config/i3/switch_workspace.sh,mworkspace:/home/adam/.config/i3/move_to_workspace.sh,window' -sidebar-mode
bindsym $mod+space exec --no-startup-id "rofi $rofiOptions -show drun"
bindsym $mod+t exec --no-startup-id "rofi $rofiOptions -show sworkspace"
bindsym $mod+Shift+t exec --no-startup-id "rofi $rofiOptions -show mworkspace"
bindsym $mod+n exec ~/.config/i3/rename_workspace.sh
# Brighness Control

View File

@ -1,10 +0,0 @@
#!/usr/bin/python3
import subprocess
import json
test = subprocess.Popen(["i3-msg","-t","get_workspaces"], stdout=subprocess.PIPE)
output = test.communicate()[0]
data = json.loads(output.decode())
data = sorted(data, key=lambda k: k['name'])
for i in data:
print(i['name'])

View File

@ -1,6 +0,0 @@
#!/usr/bin/python3
import subprocess
import sys
data = sys.stdin.readlines()[0]
test = subprocess.Popen(["i3-msg","workspace "+data], stdout=subprocess.PIPE)

View File

@ -0,0 +1,9 @@
#!/bin/bash
if [ -z "$1" ]
then
i3-msg -t get_workspaces | tr ',' '\n' | grep "name" | sed 's/"name":"\(.*\)"/\1/g' | sort -n
else
i3-msg move to workspace "$1" 1>2
fi

9
.config/i3/switch_workspace.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
if [ -z "$1" ]
then
i3-msg -t get_workspaces | tr ',' '\n' | grep "name" | sed 's/"name":"\(.*\)"/\1/g' | sort -n
else
i3-msg workspace "$1" 1>2
fi