Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to use bold font weight #285

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions completions/bash/swaylock
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ _swaylock()
--disable-caps-lock-text
--font
--font-size
--font-bold
--help
--hide-keyboard-layout
--ignore-empty-password
Expand Down
1 change: 1 addition & 0 deletions completions/fish/swaylock.fish
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ complete -c swaylock -l debug -s d --description "Enable debugg
complete -c swaylock -l disable-caps-lock-text -s L --description "Disable the Caps Lock text."
complete -c swaylock -l font --description "Sets the font of the text."
complete -c swaylock -l font-size --description "Sets a fixed font size for the indicator text."
complete -c swaylock -l font-bold --description "Use bold font weight for the indicator text"
complete -c swaylock -l help -s h --description "Show help message and quit."
complete -c swaylock -l hide-keyboard-layout -s K --description "Hide the current xkb layout while typing."
complete -c swaylock -l ignore-empty-password -s e --description "When an empty password is provided, do not validate it."
Expand Down
1 change: 1 addition & 0 deletions completions/zsh/_swaylock
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ _arguments -s \
'(--disable-caps-lock-text -L)'{--disable-caps-lock-text,-L}'[Disable the Caps Lock text]' \
'(--font)'--font'[Sets the font of the text]:font:' \
'(--font-size)'--font-size'[Sets a fixed font size for the indicator text]' \
'(--font-bold)'--font-bold'[Use bold font weight for the indicator text]' \
'(--help -h)'{--help,-h}'[Show help message and quit]' \
'(--hide-keyboard-layout -K)'{--hide-keyboard-layout,-K}'[Hide the current xkb layout while typing]' \
'(--ignore-empty-password -e)'{--ignore-empty-password,-e}'[When an empty password is provided, do not validate it]' \
Expand Down
1 change: 1 addition & 0 deletions include/swaylock.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ struct swaylock_args {
enum background_mode mode;
char *font;
uint32_t font_size;
bool font_bold;
uint32_t radius;
uint32_t thickness;
uint32_t indicator_x_position;
Expand Down
2 changes: 2 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ static int parse_options(int argc, char **argv, struct swaylock_state *state,
LO_CAPS_LOCK_KEY_HL_COLOR,
LO_FONT,
LO_FONT_SIZE,
LO_FONT_BOLD,
LO_IND_IDLE_VISIBLE,
LO_IND_RADIUS,
LO_IND_X_POSITION,
Expand Down Expand Up @@ -542,6 +543,7 @@ static int parse_options(int argc, char **argv, struct swaylock_state *state,
{"caps-lock-key-hl-color", required_argument, NULL, LO_CAPS_LOCK_KEY_HL_COLOR},
{"font", required_argument, NULL, LO_FONT},
{"font-size", required_argument, NULL, LO_FONT_SIZE},
{"font-bold", no_argument, NULL, LO_FONT_BOLD},
{"indicator-idle-visible", no_argument, NULL, LO_IND_IDLE_VISIBLE},
{"indicator-radius", required_argument, NULL, LO_IND_RADIUS},
{"indicator-thickness", required_argument, NULL, LO_IND_THICKNESS},
Expand Down
2 changes: 1 addition & 1 deletion render.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static void configure_font_drawing(cairo_t *cairo, struct swaylock_state *state,

cairo_set_font_options(cairo, fo);
cairo_select_font_face(cairo, state->args.font,
CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
CAIRO_FONT_SLANT_NORMAL, state->args.font_bold ? CAIRO_FONT_WEIGHT_BOLD : CAIRO_FONT_WEIGHT_NORMAL);
if (state->args.font_size > 0) {
cairo_set_font_size(cairo, state->args.font_size);
} else {
Expand Down
3 changes: 3 additions & 0 deletions swaylock.1.scd
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ Locks your Wayland session.
*--font-size* <size>
Sets a fixed font size for the indicator text.

*--font-bold*
Use bold font weight for the indicator text

*--indicator-idle-visible*
Sets the indicator to show even if idle.

Expand Down