summaryrefslogtreecommitdiff
path: root/x.c
diff options
context:
space:
mode:
authorMarcelo Lira <setanta@gmail.com>2025-03-02 04:03:16 -0300
committerMarcelo Lira <setanta@gmail.com>2025-03-03 16:12:29 -0300
commit01d5521913a1ff71cbc4f1534d8eb26c9e2f2978 (patch)
tree5865fda31bab7406f293e9f98742d25dc5c9a808 /x.c
parent054e4e34b9f73ace7db2dc36f77c9e2d7ff29117 (diff)
defaultfontsize
Set the default font size variable with the '-z' command line paramater. https://st.suckless.org/patches/defaultfontsize/
Diffstat (limited to 'x.c')
-rw-r--r--x.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/x.c b/x.c
index 4316574..65a5db1 100644
--- a/x.c
+++ b/x.c
@@ -4,6 +4,7 @@
#include <limits.h>
#include <locale.h>
#include <signal.h>
+#include <stdlib.h>
#include <sys/select.h>
#include <time.h>
#include <unistd.h>
@@ -1275,7 +1276,7 @@ xinit(int cols, int rows)
die("could not init fontconfig.\n");
usedfont = (opt_font == NULL)? font : opt_font;
- xloadfonts(usedfont, 0);
+ xloadfonts(usedfont, defaultfontsize);
/* spare fonts */
xloadsparefonts();
@@ -2384,6 +2385,11 @@ main(int argc, char *argv[])
case 'v':
die("%s " VERSION "\n", argv0);
break;
+ case 'z':
+ defaultfontsize = strtod(EARGF(usage()), NULL);
+ if (!(defaultfontsize > 0))
+ usage();
+ break;
default:
usage();
} ARGEND;