dotfiles

Yes, my $HOME has a git repo now :(

git clone git://git.shimmy1996.com/dotfiles.git
commit 3ee0a5c770330debb7591fc897869f85726f9cff
parent bb8082fd7fa0d7cc8766ca3f828b56a961d414f5
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date:   Mon, 21 Jan 2019 18:05:02 -0500

Move terminal logic into separate script.

Diffstat:
M.config/sway/config | 3+--
A.local/bin/sway/launch-terminal | 9+++++++++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/.config/sway/config b/.config/sway/config
@@ -11,7 +11,6 @@ set $right l
 set $gaps_inner 10
 set $gaps_outer 0
 ## Applications
-set $term env WINIT_HIDPI_FACTOR=1.0 WAYLAND_DISPLAY= alacritty
 set $menu rofi -i -show drun
 set $clipboard rofi -modi "clipboard:greenclip print" -show clipboard -run-command '{cmd}'
 set $screenlocker swaylock -c 85ad8580 -u
@@ -94,7 +93,7 @@ exec_always ~/.local/bin/sway/import-gsettings \
     bindsym $mod+Escape exec --no-startup-id $screenlocker
 
     # start a terminal
-    bindsym $mod+Return exec --no-startup-id $term
+    bindsym $mod+Return exec --no-startup-id ~/.local/bin/sway/launch-terminal
 
     # kill focused window
     bindsym $mod+Shift+q kill
diff --git a/.local/bin/sway/launch-terminal b/.local/bin/sway/launch-terminal
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+
+# Adds special environment variables when starting terminal.
+
+if [[ $XDG_SESSION_TYPE -eq "wayland" ]]; then
+    exec env WINIT_HIDPI_FACTOR=1.0 WAYLAND_DISPLAY= $TERMINAL
+else
+    exec $TERMINAL
+fi