-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added inverse-scroll.sh and togglegaps.sh
- Loading branch information
1 parent
c938108
commit 5a7012a
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |