summaryrefslogtreecommitdiff
path: root/.i3
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2013-06-07 13:48:38 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2013-06-07 13:48:39 +0200
commit5f19288099c4fcf595ff5ef14b3abe85ef5f1890 (patch)
treeb571b3dfed344386f5b9135bc597417239a25a96 /.i3
parentc227b89f947eb1a85fcfef78326c486d41a05773 (diff)
downloaddotfiles-5f19288099c4fcf595ff5ef14b3abe85ef5f1890.tar.gz
dotfiles-5f19288099c4fcf595ff5ef14b3abe85ef5f1890.tar.bz2
dotfiles-5f19288099c4fcf595ff5ef14b3abe85ef5f1890.zip
i3: better rename
Diffstat (limited to '.i3')
-rw-r--r--.i3/config7
-rwxr-xr-x.i3/scripts/workspaces.py13
2 files changed, 17 insertions, 3 deletions
diff --git a/.i3/config b/.i3/config
index 52b8ec3..3e127eb 100644
--- a/.i3/config
+++ b/.i3/config
@@ -46,9 +46,9 @@ bindsym $alt+Control+l exec $nsi $script/xlock.sh
bindsym $mod+Shift+w kill
bindsym $alt+F4 kill
# reload the configuration file
-bindsym $mod+Shift+r reload
+bindsym $mod+backslash reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
-bindsym $mod+Control+r restart
+bindsym $mod+Shift+bar restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
@@ -153,7 +153,8 @@ bindsym $mod+g exec $nsi $script/workspaces.py switch
bindsym $mod+Shift+g exec $nsi $script/workspaces.py move
# rename «3
-bindsym $mod+r exec $nsi i3-input -F 'rename workspace to "%s"' -P 'Rename workspace: '
+bindsym $mod+Shift+r exec $nsi $script/workspaces.py rename
+bindsym $mod+r exec $nsi $script/workspaces.py rename_num
# new temp workspace «3
bindsym $mod+n exec $nsi $script/workspaces.py new
diff --git a/.i3/scripts/workspaces.py b/.i3/scripts/workspaces.py
index 44de01f..498587b 100755
--- a/.i3/scripts/workspaces.py
+++ b/.i3/scripts/workspaces.py
@@ -46,6 +46,15 @@ def to_ws(cmd, prompt):
if sel is not None:
cmd(sel)
+def rename(keep = False):
+ cur_ws = i3.filter(i3.get_workspaces(), focused = True)[0]
+ input = partial(sh.i3_input, P = "Rename workspace: ")
+
+ if keep and cur_ws["num"]:
+ input(F = ('rename workspace to "%d: %%s"' % cur_ws["num"]))
+ else:
+ input(F = 'rename workspace to "%s"')
+
if __name__ == "__main__":
try:
arg = sys.argv[1]
@@ -60,6 +69,10 @@ if __name__ == "__main__":
new_ws(switch)
elif arg == "move_new":
new_ws(move)
+ elif arg == "rename":
+ rename(False)
+ elif arg == "rename_num":
+ rename(True)
else:
print("Unknown arg: %s" % arg)
sys.exit(1)