Skip to content

Commit

Permalink
added inverse-scroll.sh and togglegaps.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
boydthomson authored Jan 11, 2018
1 parent c938108 commit 5a7012a
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .config/i3/inverse-scroll.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# Get id of touchpad and the id of the field corresponding to
# natural scrolling
id=`xinput list | grep "TouchPad" | cut -d'=' -f2 | cut -d'[' -f1`
natural_scrolling_id=`xinput list-props $id | \
grep "Natural Scrolling Enabled (" \
| cut -d'(' -f2 | cut -d')' -f1`

# Set the property to true
xinput --set-prop $id $natural_scrolling_id 1
#xinput --set-prop 14 280 1
30 changes: 30 additions & 0 deletions .config/i3/togglegaps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

# toggle_gaps [on|off|toggle]

INNER=19
OUTER=19

mode=$1

if [[ -z "$mode" || "$mode" == "toggle" ]]; then

# Get current workspace.
workspace=$(i3-msg -t get_workspaces \
| jq -r '.[] | if .["focused"] then .["name"] else empty end')
# Get current inner gap size. (0 means default)
inner_gaps=$(i3-msg -t get_tree \
| jq -r 'recurse(.nodes[]) | if .type == "workspace" and .name == "'"$workspace"'" then .gaps.inner else empty end')

if [[ "$inner_gaps" == 0 ]]; then
mode="off"
else
mode="on"
fi
fi

if [[ "$mode" == "on" ]]; then
i3-msg "gaps inner current set $INNER; gaps outer current set $OUTER"
else
i3-msg "gaps inner current set 0; gaps outer current set 0"
fi

0 comments on commit 5a7012a

Please sign in to comment.