dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 00500d18f660e4518f52059cb26419127ec10fb3
parent c384c80cb27fe69f74bbdc24173cedaf6e761e5f
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Mon, 17 Dec 2018 14:03:33 +0100

Add i3resize script and use it

Diffstat:
Mlinks/.config/i3/config | 5++++-
Mlinks/.config/i3/i3scripts/i3mpd | 2+-
Alinks/bin/i3resize | 27+++++++++++++++++++++++++++
3 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/links/.config/i3/config b/links/.config/i3/config @@ -201,8 +201,11 @@ mode "resize" { bindsym Return mode "default" bindsym Escape mode "default" } - #bindsym $mod+r mode "resize" +bindsym $mod+Shift+y exec --no-startup-id ~/bin/i3resize left +bindsym $mod+Shift+u exec --no-startup-id ~/bin/i3resize down +bindsym $mod+Shift+i exec --no-startup-id ~/bin/i3resize up +bindsym $mod+Shift+o exec --no-startup-id ~/bin/i3resize right bar { status_command i3blocks -c ~/.config/i3/i3blocks diff --git a/links/.config/i3/i3scripts/i3mpd b/links/.config/i3/i3scripts/i3mpd @@ -5,7 +5,7 @@ filter() { } case $BLOCK_BUTTON in - 1) mpc status | filter && setsid "$TERMINAL" -e ncmpcpp & ;; # right click, pause/unpause + 1) mpc status | filter && setsid st -e ncmpcpp & ;; # right click, pause/unpause 2) mpc toggle | filter ;; # right click, pause/unpause 3) mpc status | filter && pgrep -x dunst >/dev/null && notify-send "<b>🎵 Music module:</b> - Shows mpd song playing. diff --git a/links/bin/i3resize b/links/bin/i3resize @@ -0,0 +1,27 @@ +#!/bin/sh +# This script was made by `goferito` on Github. +# Some cleanup by Luke. + +[ -z "$1" ] && echo "No direction provided" && exit 1 +distanceStr="2 px or 2 ppt" + +moveChoice() { + i3-msg resize "$1" "$2" "$distanceStr" | grep '"success":true' || \ + i3-msg resize "$3" "$4" "$distanceStr" +} + +case $1 in + up) + moveChoice grow up shrink down + ;; + down) + moveChoice shrink up grow down + ;; + left) + moveChoice shrink right grow left + ;; + right) + moveChoice grow right shrink left + ;; +esac +