From 03893d39d5adaf3372f77e9ca22f988d79f113c5 Mon Sep 17 00:00:00 2001 From: calvin Date: Mon, 9 Feb 2015 09:52:19 -0500 Subject: initial commit --- README | 1 + config | 40 ++++++++++++++++++++++++++++++++++++++++ rename_workspace | 6 ++++++ 3 files changed, 47 insertions(+) create mode 100644 README create mode 100644 config create mode 100755 rename_workspace diff --git a/README b/README new file mode 100644 index 0000000..d578d43 --- /dev/null +++ b/README @@ -0,0 +1 @@ +copy this script into your path, and update your i3config too look like this. then you shall have a working renamer diff --git a/config b/config new file mode 100644 index 0000000..0a5253e --- /dev/null +++ b/config @@ -0,0 +1,40 @@ +set $mod Mod1 + +# use whatever bindings you want +bindsym $mod+Shift+P exec /home/calvin/bin/rename_workspace + +set $ws1 "1" +set $ws2 "2" +set $ws3 "3" +set $ws4 "4" +set $ws5 "5" +set $ws6 "6" +set $ws7 "7" +set $ws8 "8" +set $ws9 "9" +set $ws10 "10" + + +# switch to workspace X +bindsym $mod+1 workspace $ws1 +bindsym $mod+2 workspace $ws2 +bindsym $mod+3 workspace $ws3 +bindsym $mod+4 workspace $ws4 +bindsym $mod+5 workspace $ws5 +bindsym $mod+6 workspace $ws6 +bindsym $mod+7 workspace $ws7 +bindsym $mod+8 workspace $ws8 +bindsym $mod+9 workspace $ws9 +bindsym $mod+0 workspace $ws10 + +# move focused container to workspace +bindsym $mod+Shift+exclam move container to workspace $ws1 +bindsym $mod+Shift+at move container to workspace $ws2 +bindsym $mod+Shift+numbersign move container to workspace $ws3 +bindsym $mod+Shift+dollar move container to workspace $ws4 +bindsym $mod+Shift+percent move container to workspace $ws5 +bindsym $mod+Shift+asciicircum move container to workspace $ws6 +bindsym $mod+Shift+ampersand move container to workspace $ws7 +bindsym $mod+Shift+asterisk move container to workspace $ws8 +bindsym $mod+Shift+parenleft move container to workspace $ws9 +bindsym $mod+Shift+parenright move container to workspace $ws10 diff --git a/rename_workspace b/rename_workspace new file mode 100755 index 0000000..adfda65 --- /dev/null +++ b/rename_workspace @@ -0,0 +1,6 @@ +#!/bin/bash +OLD=$(i3-msg -t 'get_workspaces' | sed -e 's/{"num/\n{"num/g' | grep \"focused\":true | sed -e 's/,"/\n/g' | grep name | cut -d\" -f 3) +NEW=$(zenity --text="Enter new name:" --entry --title="Rename workspace $OLD" --entry-text="$OLD") +i3-msg "rename workspace \"$OLD\" to \"$NEW\"" +sed ~/.i3/config -i -e "s,^set \$\(ws[0-9]\+\) \"$OLD\",set \$\1 \"$NEW\"," +i3-msg reload -- cgit v1.2.1