dotfiles

my shiny new dotfiles
git clone git://git.jakekoroman.com/dotfiles
Log | Files | Refs | README

commit c02f30a7750b3ee4888208f5465865e857db4ad6
parent 0f7ed3b750136ee651f0eef207ed63c71304184d
Author: Jake Koroman <jakekoroman@gmail.com>
Date:   Tue,  2 Apr 2024 20:44:46 -0400

laptop dwl, and cleanup

Diffstat:
M.gitignore | 4++--
Mdeploy | 1+
Adevice-specific/laptop/dwl-hardware.h | 71+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mdwl/config.h | 61+++++++++++++++++++++++++++++++++++++------------------------
Ddwl/device.h | 2--
Ddwlb/zsh | 0
6 files changed, 111 insertions(+), 28 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -12,4 +12,5 @@ dwl/*.o dwl/dwl dwlb/*.o -dwlb/dwlb -\ No newline at end of file +dwlb/dwlb +dwl/device.h diff --git a/deploy b/deploy @@ -35,6 +35,7 @@ symlink_file "$(pwd)/device-specific/$hardware/i3status" "$(pwd)/.config/i3statu symlink_file "$(pwd)/device-specific/$hardware/emacs.el" "$(pwd)/.config/emacs/local/device.el" symlink_file "$(pwd)/device-specific/$hardware/dwl-hardware.h" "$(pwd)/dwl/device.h" +mkdir -p "$(pwd)/.config/foot" sed "s/{FOOT_FONT}/$FOOT_FONT/g" "$(pwd)/shared-configs/foot/template.ini" > "$(pwd)/.config/foot/foot.ini" stow -D . 2> /dev/null diff --git a/device-specific/laptop/dwl-hardware.h b/device-specific/laptop/dwl-hardware.h @@ -0,0 +1,71 @@ +/* + * NOTE(jake): i think its useful to share some settings between dwlb and dwl so putting this here + * not sure if i like this approach but it works + */ + +#define DEVICE_FONT "monospace:size=10" + +#ifndef NOT_DWL +/* monitors */ +/* NOTE: ALWAYS add a fallback rule, even if you are completely sure it won't be used */ +static const MonitorRule monrules[] = { + /* name mfact nmaster scale layout rotate/reflect x y resx resy rate mode adaptive */ + { "NULL", 0.50f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 0, 0, 0, 0.0f, 0, 0}, + { "eDP-1", 0.50f, 1, 1.5f, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 480, 2560, 1440, 60.0f, 0, 0}, + { "DP-4", 0.50f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 1706, 0, 2560, 1440, 60.0f, 1, 0}, +}; + +/* keyboard */ +static const struct xkb_rule_names xkb_rules = { + /* can specify fields: rules, model, layout, variant, options */ + /* example: + .options = "ctrl:nocaps", + */ + .options = "caps:escape", +}; + +static const int repeat_rate = 25; +static const int repeat_delay = 600; + +/* Trackpad */ +static const int tap_to_click = 1; +static const int tap_and_drag = 1; +static const int drag_lock = 1; +static const int natural_scrolling = 0; +static const int disable_while_typing = 1; +static const int left_handed = 0; +static const int middle_button_emulation = 0; +/* You can choose between: +LIBINPUT_CONFIG_SCROLL_NO_SCROLL +LIBINPUT_CONFIG_SCROLL_2FG +LIBINPUT_CONFIG_SCROLL_EDGE +LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN +*/ +static const enum libinput_config_scroll_method scroll_method = LIBINPUT_CONFIG_SCROLL_2FG; + +/* You can choose between: +LIBINPUT_CONFIG_CLICK_METHOD_NONE +LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS +LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER +*/ +static const enum libinput_config_click_method click_method = LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS; + +/* You can choose between: +LIBINPUT_CONFIG_SEND_EVENTS_ENABLED +LIBINPUT_CONFIG_SEND_EVENTS_DISABLED +LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE +*/ +static const uint32_t send_events_mode = LIBINPUT_CONFIG_SEND_EVENTS_ENABLED; + +/* You can choose between: +LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT +LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE +*/ +static const enum libinput_config_accel_profile accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE; +static const double accel_speed = -0.6; +/* You can choose between: +LIBINPUT_CONFIG_TAP_MAP_LRM -- 1/2/3 finger tap maps to left/right/middle +LIBINPUT_CONFIG_TAP_MAP_LMR -- 1/2/3 finger tap maps to left/middle/right +*/ +static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TAP_MAP_LRM; +#endif diff --git a/dwl/config.h b/dwl/config.h @@ -4,9 +4,11 @@ ((hex >> 8) & 0xFF) / 255.0f, \ (hex & 0xFF) / 255.0f } -#define AUDIODOWN XKB_KEY_XF86AudioLowerVolume -#define AUDIOUP XKB_KEY_XF86AudioRaiseVolume -#define AUDIOMUTE XKB_KEY_XF86AudioMute +#define AUDIODOWN XKB_KEY_XF86AudioLowerVolume +#define AUDIOUP XKB_KEY_XF86AudioRaiseVolume +#define AUDIOMUTE XKB_KEY_XF86AudioMute +#define BRIGHTUP XKB_KEY_XF86MonBrightnessUp +#define BRIGHTDOWN XKB_KEY_XF86MonBrightnessDown /* appearance */ static const int sloppyfocus = 1; /* focus follows mouse */ @@ -26,17 +28,10 @@ static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You ca static int log_level = WLR_ERROR; static const Rule rules[] = { - /* app_id title tags mask isfloating isterm noswallow monitor */ - { "foot", NULL, 0, 0, 1, 1, -1 }, - { "mpv" , NULL, 0, 0, 0, 0, -1 }, - { "swiv", NULL, 0, 0, 0, 0, -1 }, -}; - -enum LayoutFunction { - ltile = 0, - lfloat = 1, - lmonocle = 2, - lcenteredmaster = 3, + /* app_id title tags mask isfloating isterm noswallow monitor */ + { "foot", NULL, 0, 0, 1, 1, -1 }, + { "LibreWolf", NULL, 0, 0, 0, 1, -1 }, + { "firefox", NULL, 0, 0, 0, 1, -1 }, }; /* layout(s) */ @@ -48,6 +43,13 @@ static const Layout layouts[] = { { "|M|", centeredmaster }, }; +enum LayoutFunction { + ltile = 0, + lfloat = 1, + lmonocle = 2, + lcenteredmaster = 3, +}; + /* If you want to use the windows key for MODKEY, use WLR_MODIFIER_LOGO */ #define MODKEY WLR_MODIFIER_LOGO @@ -62,16 +64,21 @@ static const Layout layouts[] = { /* commands */ #define TERMINAL "foot" -static const char *termcmd[] = { TERMINAL, NULL }; -static const char *menucmd[] = { "bemenu-run", NULL }; -static const char *pavucmd[] = { "pavucontrol", NULL }; -static const char *bookmarkscmd[] = { "bookmarks", NULL }; -static const char *passcmd[] = { "passmenu-otp", NULL }; -static const char *sshmenucmd[] = { "sshmenu", NULL }; - -static const char *volmutecmd[] = { "wpctl", "set-mute", "@DEFAULT_AUDIO_SINK@", "toggle", NULL }; -static const char *voldowncmd[] = { "wpctl", "set-volume", "@DEFAULT_AUDIO_SINK@", "2%-", NULL }; -static const char *volupcmd[] = { "wpctl", "set-volume", "@DEFAULT_AUDIO_SINK@", "2%+", NULL }; +#define BROWSER "librewolf" +static const char *bookmarkscmd[] = { "bookmarks", NULL }; +static const char *browsercmd[] = { BROWSER, NULL }; +static const char *brightupcmd[] = { "brightness", "up", NULL }; +static const char *brightdowncmd[] = { "brightness", "down", NULL }; +static const char *menucmd[] = { "bemenu-run", NULL }; +static const char *passcmd[] = { "passmenu-otp", NULL }; +static const char *pavucmd[] = { "pavucontrol", NULL }; +static const char *rdpmenucmd[] = { "rdpmenu", NULL }; +static const char *sshmenucmd[] = { "sshmenu", NULL }; +static const char *swaylockcmd[] = { "swaylock", "-f", "-c", "181818", NULL }; +static const char *termcmd[] = { TERMINAL, NULL }; +static const char *volmutecmd[] = { "wpctl", "set-mute", "@DEFAULT_AUDIO_SINK@", "toggle", NULL }; +static const char *voldowncmd[] = { "wpctl", "set-volume", "@DEFAULT_AUDIO_SINK@", "2%-", NULL }; +static const char *volupcmd[] = { "wpctl", "set-volume", "@DEFAULT_AUDIO_SINK@", "2%+", NULL }; static const Key keys[] = { /* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */ @@ -84,6 +91,9 @@ static const Key keys[] = { { MODKEY, XKB_KEY_F12, spawn, {.v = passcmd} }, { MODKEY, XKB_KEY_n, spawn, SHCMD(TERMINAL " -e newsboat") }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_N, spawn, SHCMD(TERMINAL " -e neomutt") }, + { MODKEY, XKB_KEY_b, spawn, {.v = browsercmd} }, + { MODKEY, XKB_KEY_r, spawn, {.v = rdpmenucmd} }, + { MODKEY, XKB_KEY_Delete, spawn, {.v = swaylockcmd} }, { MODKEY, XKB_KEY_F2, togglebar, {0} }, { MODKEY, XKB_KEY_j, focusstack, {.i = +1} }, { MODKEY, XKB_KEY_k, focusstack, {.i = -1} }, @@ -114,6 +124,9 @@ static const Key keys[] = { { 0, AUDIOUP, spawn, {.v = volupcmd} }, { 0, AUDIOMUTE, spawn, {.v = volmutecmd} }, + { 0, BRIGHTUP, spawn, {.v = brightupcmd} }, + { 0, BRIGHTDOWN, spawn, {.v = brightdowncmd} }, + TAGKEYS( XKB_KEY_1, XKB_KEY_exclam, 0), TAGKEYS( XKB_KEY_2, XKB_KEY_at, 1), TAGKEYS( XKB_KEY_3, XKB_KEY_numbersign, 2), diff --git a/dwl/device.h b/dwl/device.h @@ -1 +0,0 @@ -/home/jake/dotfiles/device-specific/desktop/dwl-hardware.h -\ No newline at end of file diff --git a/dwlb/zsh b/dwlb/zsh