From e323b975650e1fc8183dd84d7eab951945483f90 Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Tue, 16 Aug 2022 00:00:59 +0200 Subject: [PATCH 1/5] unify keybinds with vim style --- .config/lvim/config.lua | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/.config/lvim/config.lua b/.config/lvim/config.lua index b90922c4..786dcec5 100644 --- a/.config/lvim/config.lua +++ b/.config/lvim/config.lua @@ -180,38 +180,28 @@ lvim.keys.insert_mode = { [""] = ":wa", [""] = ":lua Custom_Close()", [""] = "", - [""] = ":bn", - [""] = ":bp", } lvim.keys.normal_mode = { [""] = ":w", [""] = ":lua Custom_Close()", - [""] = "W", - [""] = "gE", - [""] = ":bn", - [""] = ":bp", - [""] = "", - [""] = "", + [""] = "W", + [""] = "gE", + [""] = "", + [""] = "", } lvim.keys.term_mode = { - [""] = ":bn", - [""] = ":bp" } lvim.keys.visual_mode = { [""] = ":w", [""] = ":lua Custom_Close()", ["<"] = ""] = ">gv", - [""] = ":bn", - [""] = ":bp", - [""] = "", - [""] = "", + [""] = "", + [""] = "", } lvim.keys.visual_block_mode = { [""] = ":w", [""] = ":lua Custom_Close()", - [""] = ":bn", - [""] = ":bp", ["K"] = ":move '<-2gv-gv", ["J"] = ":move '>+1gv-gv", [""] = "", From 56ed81b475f6901456f50a234dee59c02e4e3e7d Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Tue, 16 Aug 2022 00:01:16 +0200 Subject: [PATCH 2/5] more vim keybidns --- .config/kitty/kitty.conf | 1 - .config/kitty/kittyfullscreen.conf | 17 +++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf index ef23d173..5c093bc1 100644 --- a/.config/kitty/kitty.conf +++ b/.config/kitty/kitty.conf @@ -100,7 +100,6 @@ map kitty_mod+home scroll_home map kitty_mod+end scroll_end map kitty_mod+y scroll_to_prompt -1 map kitty_mod+x scroll_to_prompt 1 -map kitty_mod+h show_scrollback map kitty_mod+g show_last_command_output # Font sizes diff --git a/.config/kitty/kittyfullscreen.conf b/.config/kitty/kittyfullscreen.conf index f3763a7d..1d3f47e6 100644 --- a/.config/kitty/kittyfullscreen.conf +++ b/.config/kitty/kittyfullscreen.conf @@ -32,8 +32,8 @@ allow_remote_control yes #: Keyboard shortcuts {{{ # Tab management -map shift+right next_tab -map shift+left previous_tab +map kitty_mod+l next_tab +map kitty_mod+h previous_tab map kitty_mod+t new_tab map kitty_mod+r close_tab map kitty_mod+. move_tab_forward @@ -42,14 +42,11 @@ map kitty_mod+alt+t set_tab_title # Window Management enabled_layouts Tall -map kitty_mod+l next_layout -map kitty_mod+enter new_window +map kitty_mod+enter new_window_with_cwd map kitty_mod+q close_window -map kitty_mod+right next_window -map kitty_mod+left previous_window -map kitty_mod+j move_window_backward -map kitty_mod+k move_window_forward -map kitty_mod+h resize_window wider -map kitty_mod+l resize_window narrower +map kitty_mod+j next_window +map kitty_mod+k previous_window +map kitty_mod+left move_window_backward +map kitty_mod+right move_window_forward map kitty_mod+space move_window_to_top #: }}} From 73bc813ce2d541552683bc38ea0477d05b9eee46 Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Tue, 16 Aug 2022 00:01:30 +0200 Subject: [PATCH 3/5] debloat xresource XD --- .config/x11/xresources | 102 +++++++++++++++++++++++++++++------------ 1 file changed, 72 insertions(+), 30 deletions(-) diff --git a/.config/x11/xresources b/.config/x11/xresources index 6b3502a0..2bb9d8ba 100644 --- a/.config/x11/xresources +++ b/.config/x11/xresources @@ -1,14 +1,11 @@ -!! NOTE: X11 OPTIONS !! Set cursor size (Check GTK in .config too): Xcursor.size: 24 -Xcursor.theme: Fluent-dark-cursors +!! Set transparency (0-1): +*.alpha: 0.8 +!! Set a default font and font size: +*.font: NotoSans Nerd Font:style=Regular:pixelsize=14:antialias=true:autohint=true; -!! NOTE: DWM OPTIONS -*.baralpha: 204 -*.borderalpha: 204 -*.mainmon: 0 -*.font: JetBrainsMono Nerd Font Mono:pixelsize=14:antialias=true:autohint=true; /* name dark light */ /* black 0 8 */ /* red 1 9 */ @@ -19,26 +16,71 @@ Xcursor.theme: Fluent-dark-cursors /* cyan 6 14 */ /* white 7 15 */ -!! tokyo-night: -*.color0 #15161E -*.color1 #f7768e -*.color2 #9ece6a -*.color3 #e0af68 -*.color4 #7aa2f7 -*.color5 #bb9af7 -*.color6 #7dcfff -*.color7 #a9b1d6 -*.color8 #414868 -*.color9 #f7768e -*.color10 #9ece6a -*.color11 #e0af68 -*.color12 #7aa2f7 -*.color13 #bb9af7 -*.color14 #7dcfff -*.color15 #c0caf5 -*.color16 #ff9e64 -*.color17 #db4b4b -*.inactivebg: #1a1b26 -*.activebg: #1a1b26 -*.inactivefg: #a9b1d6 -*.activefg: #c0caf5 +! TokyoNight colors for Xresources + +*background: #1a1b26 +*foreground: #c0caf5 + +*color0: #15161E +*color1: #f7768e +*color2: #9ece6a +*color3: #e0af68 +*color4: #7aa2f7 +*color5: #bb9af7 +*color6: #7dcfff +*color7: #a9b1d6 + +*color8: #414868 +*color9: #f7768e +*color10: #9ece6a +*color11: #e0af68 +*color12: #7aa2f7 +*color13: #bb9af7 +*color14: #7dcfff +*color15: #c0caf5 + +! TokyoNight colors for Xresources + +! *background: #24283b +! *foreground: #c0caf5 + +! *color0: #1D202F +! *color1: #f7768e +! *color2: #9ece6a +! *color3: #e0af68 +! *color4: #7aa2f7 +! *color5: #bb9af7 +! *color6: #7dcfff +! *color7: #a9b1d6 + +! *color8: #414868 +! *color9: #f7768e +! *color10: #9ece6a +! *color11: #e0af68 +! *color12: #7aa2f7 +! *color13: #bb9af7 +! *color14: #7dcfff +! *color15: #c0caf5 + +! TokyoNight colors for Xresources + +! *background: #e1e2e7 +! *foreground: #3760bf + +! *color0: #e9e9ed +! *color1: #f52a65 +! *color2: #587539 +! *color3: #8c6c3e +! *color4: #2e7de9 +! *color5: #9854f1 +! *color6: #007197 +! *color7: #6172b0 + +! *color8: #a1a6c5 +! *color9: #f52a65 +! *color10: #587539 +! *color11: #8c6c3e +! *color12: #2e7de9 +! *color13: #9854f1 +! *color14: #007197 +! *color15: #3760bf From 6f12f5169948871b6fcf7ded895d16ceb7cb9689 Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Tue, 16 Aug 2022 00:01:38 +0200 Subject: [PATCH 4/5] initial prep for new DWM --- .local/bin/statusbar/sb-clock | 28 +--------------------------- .local/bin/statusbar/sb-forecast | 28 +++------------------------- .local/bin/statusbar/sb-help-icon | 17 ----------------- .local/bin/statusbar/sb-mpdup | 2 +- .local/bin/statusbar/sb-music | 19 ++----------------- .local/bin/statusbar/sb-volume | 15 ++------------- 6 files changed, 9 insertions(+), 100 deletions(-) delete mode 100755 .local/bin/statusbar/sb-help-icon diff --git a/.local/bin/statusbar/sb-clock b/.local/bin/statusbar/sb-clock index a3a602e2..b844adf0 100755 --- a/.local/bin/statusbar/sb-clock +++ b/.local/bin/statusbar/sb-clock @@ -1,29 +1,3 @@ #!/bin/sh -clock=$(date '+%I') - -case "$clock" in - "00") icon="" ;; - "01") icon="" ;; - "02") icon="" ;; - "03") icon="" ;; - "04") icon="" ;; - "05") icon="" ;; - "06") icon="" ;; - "07") icon="" ;; - "08") icon="" ;; - "09") icon="" ;; - "10") icon="" ;; - "11") icon="" ;; - "12") icon="" ;; -esac - -case $BLOCK_BUTTON in - 1) notify-send "This Month" "$(cal --color=always | sed "s/..7m//;s/..27m/<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;; - 2) setsid -f "$TERMINAL" -e calcurse ;; - 3) notify-send " Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\` -- Middle click opens calcurse if installed" ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; -esac - -echo " $(date "+%d.%m.%Y $icon %H:%M") " +date "+%d.%m.%Y %H:%M" diff --git a/.local/bin/statusbar/sb-forecast b/.local/bin/statusbar/sb-forecast index 6fbc9bea..48e37134 100755 --- a/.local/bin/statusbar/sb-forecast +++ b/.local/bin/statusbar/sb-forecast @@ -1,11 +1,4 @@ #!/bin/sh - -# Usually intended for the statusbar. - -# If we have internet, get a weather report from wttr.in and store it locally. -# You could set up a shell alias to view the full file in a pager in the -# terminal if desired. This function will only be run once a day when needed. -# Options can be found at https://wttr.in/:help weatherreport="${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport" weatheremoji="${XDG_CACHE_HOME:-$HOME/.cache}/weatheremoji" url="wttr.in/Karlsruhe" @@ -26,28 +19,13 @@ s/🌩// s/🌫// ' "${weatheremoji}" } -getforecast() { curl -sf "$url$opt" > "$weatherreport" && curl -sf "$url$emojiopt" > "$weatheremoji" || exit 1 ;} -# Some very particular and terse stream manipulation. We get the maximum -# precipitation chance and the daily high and low from the downloaded file and -# display them with coresponding emojis. +getforecast() { curl -sf "$url$opt" > "$weatherreport" && curl -sf "$url$emojiopt" > "$weatheremoji" ;} showweather() { emoji=$(cat "$weatheremoji") && printf "%s" "$(sed '16q;d' "$weatherreport" | grep -wo "[0-9]*%" | sort -rn | sed "s/^/ $(printf %.1s "$emoji") /g;1q" | tr -d '\n')" -sed '13q;d' "$weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sed 's/+//g' | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print "  " $1 "°"," " $2 "°"}' ;} + sed '13q;d' "$weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sed 's/+//g' | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " " $1 "°"," " $2 "°"}' ;} -case $BLOCK_BUTTON in - 1) setsid -f "$TERMINAL" -e less -Srf "$weatherreport" ;; - 2) getforecast && showweather ;; - 3) notify-send " Weather module" "\- Left click for full forecast. -- Middle click to update forecast. -${emoji}: Chance of rain/snow -: Daily low -: Daily high" ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; -esac - -# The test if our forcecast is updated to the day. If it isn't download a new -# weather report from wttr.in with the above function. [ "$(stat -c %y "$weatherreport" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] || getforecast && convertemoji + showweather diff --git a/.local/bin/statusbar/sb-help-icon b/.local/bin/statusbar/sb-help-icon deleted file mode 100755 index bc1a1405..00000000 --- a/.local/bin/statusbar/sb-help-icon +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -# The clickable help menu. Middle click to restart wm. - -# If dwm is running, use dwm's readme and restart. -pidof dwm >/dev/null && - READMEFILE=/usr/local/share/dwm/larbs.mom - restartwm() { pkill -HUP dwm ;} || - restartwm() { i3 restart ;} - -case $BLOCK_BUTTON in - 1) groff -mom "${READMEFILE:-${XDG_DATA_HOME:-$HOME/.local/share}/larbs/readme.mom}" -Tpdf | zathura - ;; - 2) restartwm ;; - 3) notify-send " Help module" "\- Left click to open LARBS guide. -- Middle click to refresh window manager." ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; -esac; echo "" diff --git a/.local/bin/statusbar/sb-mpdup b/.local/bin/statusbar/sb-mpdup index af81a7d6..60e9b799 100755 --- a/.local/bin/statusbar/sb-mpdup +++ b/.local/bin/statusbar/sb-mpdup @@ -4,5 +4,5 @@ # music player's status. mpd must be running on X's start for this to work. while : ; do - mpc idle >/dev/null && kill -45 "$(pidof "${STATUSBAR:-dwmblocks}")" || break + mpc idle >/dev/null && kill -46 "$(pidof dwm)" || break done diff --git a/.local/bin/statusbar/sb-music b/.local/bin/statusbar/sb-music index fcd0d449..87846f40 100755 --- a/.local/bin/statusbar/sb-music +++ b/.local/bin/statusbar/sb-music @@ -1,30 +1,15 @@ #!/bin/sh - filter() { if mpc 1>/dev/null 2>&1 && [ "$(mpc | wc -l)" -eq 3 ]; then song=$(mpc current -f "%artist% - %title%" | xargs -0 ) [ ${#song} -gt 35 ] && song="$(printf %.35s "$song")…" mpc | awk 'NR==2' | grep -q playing && icon="" || icon="" - echo " $icon $song " + echo "$icon $song" elif mpc 1>/dev/null 2>&1 && [ "$(mpc | wc -l)" -eq 1 ]; then - echo " ﱙ " + echo "ﱙ" else exit 1 fi } pidof -x sb-mpdup >/dev/null 2>&1 || sb-mpdup >/dev/null 2>&1 & - -case $BLOCK_BUTTON in - 1) mpc status | filter ; setsid -f "$TERMINAL" -e ncmpcpp ;; # right click, pause/unpause - 2) mpc toggle | filter ;; # right click, pause/unpause - 3) mpc status | filter ; notify-send " Music module" "\- Shows mpd song playing. -- ⏸ when paused. -- Left click opens ncmpcpp. -- Middle click pauses. -- Scroll changes track.";; # right click, pause/unpause - 4) mpc prev | filter ;; # scroll up, previous - 5) mpc next | filter ;; # scroll down, next - 6) mpc status | filter ; "$TERMINAL" -e "$EDITOR" "$0" ;; - *) mpc status | filter ;; -esac diff --git a/.local/bin/statusbar/sb-volume b/.local/bin/statusbar/sb-volume index 98f90cc4..370db04f 100755 --- a/.local/bin/statusbar/sb-volume +++ b/.local/bin/statusbar/sb-volume @@ -2,18 +2,7 @@ # Prints the current volume or ﱝ if muted. -case $BLOCK_BUTTON in - 1) setsid -f "$TERMINAL" -e pulsemixer ;; - 2) pamixer -t ;; - 4) pamixer --allow-boost -i 1 ;; - 5) pamixer --allow-boost -d 1 ;; - 3) notify-send "蓼Volume module" "\- Shows volume , ﱝ if muted. -- Middle click to mute. -- Scroll to change." ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; -esac - -[ $(pamixer --get-mute) = true ] && echo "ﱝ" && exit +[ "$(pamixer --get-mute)" = true ] && echo "ﱝ" && exit vol="$(pamixer --get-volume)" @@ -29,4 +18,4 @@ else echo "   " && exit fi -echo " $icon $vol% " +echo "$icon $vol%" From 1f259b3acdd7c169db0ed65cc805b9894deeab47 Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Tue, 16 Aug 2022 00:03:15 +0200 Subject: [PATCH 5/5] fix some shit --- .config/lvim/config.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/lvim/config.lua b/.config/lvim/config.lua index 786dcec5..89a77cbc 100644 --- a/.config/lvim/config.lua +++ b/.config/lvim/config.lua @@ -80,7 +80,7 @@ vim.api.nvim_create_autocmd("BufWritePost", { command = "!cd ~/.local/src/dwmblocks/; sudo make install && { killall -q dwmblocks;setsid -f dwmblocks }" }) -vim.api.nvim_create_autocmd("VimLeave", { +vim.api.nvim_create_autocmd("BufLeave", { pattern = "*.tex", command = "!texclear %" }) @@ -219,7 +219,7 @@ lvim.builtin.which_key.mappings = { j = { "BufferLinePick", "Jump" }, f = { "Telescope buffers", "Find" }, b = { "BufferLineCyclePrev", "Previous" }, - c = { "w!!compiler %:p", "Compile" }, + c = { "w!!compiler \"%:p\"", "Compile" }, -- w = { "BufferWipeout", "Wipeout" }, -- TODO: implement this for bufferline e = { "BufferLinePickClose",