Skip to content

Instantly share code, notes, and snippets.

@g-eorge
Last active August 29, 2015 14:18
Show Gist options
  • Save g-eorge/228643bc086bf7f994c0 to your computer and use it in GitHub Desktop.
Save g-eorge/228643bc086bf7f994c0 to your computer and use it in GitHub Desktop.
Open a terminal in i3 window manager with different font when not on the default display
bindsym Mod1+Return exec --no-startup-id term_for_display.sh
#!/usr/bin/env python
import json
from subprocess import check_output
out = check_output(["i3-msg", "-t", "get_workspaces"])
workspaces = json.loads(out.decode("utf-8"))
focused_workspace = filter(lambda x: x["focused"], workspaces)
print(next(focused_workspace)["output"])
#!/bin/bash
hidpi_display="eDP1"
current_display=$(get_display.py)
if [ "$current_display" != "$hidpi_display" ]; then
urxvt -fn "xft:Terminus:pixelsize=18,style=Regular"
else
urxvt
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment