This is my first attempt at anything functioning within elisp. This script is part of my configuration file that I use across multiple machines, one of which is hi-dpi and the other is not. To avoid having to reset my default font size every time I pull from my remote repository, I thought it would be nice to write a function to detect the size of the screen and adjust the font size accordingly.
(if (and (eq 3840 (x-display-pixel-width))
(eq 2160 (x-display-pixel-height)))
(setq-default dotspacemacs-default-font '("Source Code Pro" :size 34))
(setq-default dotspacemacs-default-font '("Source Code Pro" :size 18)))
)
It feels a bit repetitious, but I am not comfortable enough with the language to even see how I could simplify anything. Initially I tried to set a font-size variable, but it did not seem to be able to traverse functions easily (i.e. it was set at a local scope).