summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrbain Vaes <urbain@vaes.uk>2016-04-21 16:09:53 +0100
committerUrbain Vaes <urbain@vaes.uk>2016-04-21 16:09:53 +0100
commit3437dd6ab00d59ae96fc193a9a4024aacc04138e (patch)
treecfc19afc77a21a06fb28eadca9f8932aa6ea1a9a
parentd13ea66992cf451850630904cacbfe111187d02b (diff)
Fix mistake in colorscheme function
-rwxr-xr-xbin/bin/rename_workspace4
-rw-r--r--zsh/.zsh/functions3
2 files changed, 4 insertions, 3 deletions
diff --git a/bin/bin/rename_workspace b/bin/bin/rename_workspace
index 7636fd2..61fffd3 100755
--- a/bin/bin/rename_workspace
+++ b/bin/bin/rename_workspace
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
-workspace=$(i3-msg -t get_outputs | grep -Po '"current_workspace":"[^\"]*"' | sed 's/"current_workspace":"\([^"]\+\)"/\1/g')
-number=$(echo "${workspace//[!0-9]}")
+workspace=$(i3-msg -t get_workspaces | grep -Po '{[^}]*"focused":true[^}]*}' | sed 's/.*"name":"\([^"]*\)".*$/\1/g')
+number=$(i3-msg -t get_workspaces | grep -Po '{[^}]*"focused":true[^}]*}' | sed 's/{"num":\([^,]*\),.*$/\1/g')
new_name=$(zenity --entry --title="Rename workspace" --entry-text "$workspace")
if [[ "$new_name" != *:* ]]; then
diff --git a/zsh/.zsh/functions b/zsh/.zsh/functions
index e77dee7..661fe17 100644
--- a/zsh/.zsh/functions
+++ b/zsh/.zsh/functions
@@ -8,6 +8,7 @@ function colo {
if [[ "${XRESOURCE}" == *"-dark" ]]; then
export COLORSCHEME=${XRESOURCE%-dark}
export BACKGROUND="dark"
+ echo ${COLORSCHEME}
elif [[ "${XRESOURCE}" == *"-light" ]]; then
export COLORSCHEME=${XRESOURCE%-light}
export BACKGROUND="light"
@@ -24,7 +25,7 @@ function colo {
# Change default environment variable for future sessions
sed -i --follow-symlinks "s/^export COLORSCHEME=.*$/export COLORSCHEME=${COLORSCHEME}/g" ~/.zsh/tmp
- sed -i --follow-symlinks "s/^export COLORSCHEME=.*$/export BACKGROUND=${BACKGROUND}/g" ~/.zsh/tmp
+ sed -i --follow-symlinks "s/^export BACKGROUND=.*$/export BACKGROUND=${BACKGROUND}/g" ~/.zsh/tmp
}
# Completion for colorschemes (-M -> Case insensitive)