commit fdedaa91b76aad7c502f17470fc94df84413c18e
parent 1c023236fafd19f9b9913b61896e179b54ff3f1c
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Wed, 16 Jan 2019 09:55:01 +0100
Improve keyboard layout switch, decrease night screen color temperature
Diffstat:
3 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/links/.config/i3/config b/links/.config/i3/config
@@ -105,15 +105,13 @@ bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
-bindsym $mod+$modalt+l exec --no-startup-id keyboard-layout-switch.sh && pkill -RTMIN+3 i3blocks
+bindsym $mod+$modalt+l exec --no-startup-id keyboard-layout-switch.sh > ~/out.txt
bindsym $mod+m exec $term -e tmux-mutt.sh
bindsym $mod+n exec $term -e ranger
bindsym $mod+o exec --no-startup-id ddspawn fuzzylaunch
bindsym $mod+p exec --no-startup-id ddspawn dropdowncalc
bindsym $mod+q kill
bindsym $mod+r exec $term -e tmux-newsboat.sh
-#bindsym $mod+s layout stacking
-#bindsym $mod+t exec --no-startup-id textqr
bindsym $mod+t exec --no-startup-id message -p
bindsym $mod+$modalt+t exec --no-startup-id textqr
bindsym $mod+u exec --no-startup-id dmenuunicode
diff --git a/links/.xinitrc b/links/.xinitrc
@@ -36,7 +36,8 @@ if [ "$(hostname)" = "iddqd" ]; then
fi
if [ "$(hostname)" != "phony" ]; then
- redshift -l 56.09:10.12 & # Aarhus
+ # default temperature is 6500 K day, 4500 K night
+ redshift -l 56.09:10.12 -t 6500:3300 & # Aarhus
#redshift -l 32.84:-117.26 & # San Diego
fi
diff --git a/links/bin/keyboard-layout-switch.sh b/links/bin/keyboard-layout-switch.sh
@@ -1,4 +1,6 @@
-#!/bin/bash
+#!/usr/bin/env bash
+set -e
+set -v
# the language is written to ./.kbd-layout
layoutfile="$HOME/.kbd-layout"
@@ -12,18 +14,15 @@ function set_language {
notify-send "$1"
xmodmap ~/.Xmodmap
echo "$1" > "$layoutfile"
- exit 0
+ pkill -RTMIN+3 i3blocks
}
[[ $# -gt 0 ]] && set_language "$1"
# write the file if it doesn't exist
if [ ! -f $layoutfile ]; then
- echo "us" > $layoutfile
- setxkbmap "$lang1"
- xmodmap ~/.Xmodmap
- #notify-send $LANG1
- exit
+ set_language "us"
+ exit 0
fi
# read the language file, and switch to the other language