1
0
Fork 0
This commit is contained in:
Luca Bilke 2022-08-16 10:56:02 +02:00
commit 8f433b578e
10 changed files with 95 additions and 158 deletions

View File

@ -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

View File

@ -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
#: }}}

View File

@ -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 %"
})
@ -180,38 +180,28 @@ lvim.keys.insert_mode = {
["<C-S>"] = "<ESC>:w<CR>a",
["<C-Q>"] = "<ESC>:lua Custom_Close()<CR>",
["<C-BS>"] = "<C-W>",
["<C-.>"] = "<ESC>:bn<CR>",
["<C-,>"] = "<ESC>:bp<CR>",
}
lvim.keys.normal_mode = {
["<c-s>"] = ":w<CR>",
["<c-q>"] = ":lua Custom_Close()<CR>",
["<C-Right>"] = "W",
["<C-Left>"] = "gE",
["<C-.>"] = ":bn<CR>",
["<C-,>"] = ":bp<CR>",
["<S-Up>"] = "<C-U>",
["<S-Down>"] = "<C-D>",
["<C-l>"] = "W",
["<C-h>"] = "gE",
["<C-k>"] = "<C-U>",
["<C-j>"] = "<C-D>",
}
lvim.keys.term_mode = {
["<C-Right>"] = ":bn<CR>",
["<C-Left>"] = ":bp<CR>"
}
lvim.keys.visual_mode = {
["<c-s>"] = "<ESC>:w<CR>",
["<c-q>"] = "<ESC>:lua Custom_Close()<CR>",
["<"] = "<gv",
[">"] = ">gv",
["<C-.>"] = "<ESC>:bn<CR>",
["<C-,>"] = "<ESC>:bp<CR>",
["<S-Up>"] = "<C-U>",
["<S-Down>"] = "<C-D>",
["<C-k>"] = "<C-U>",
["<C-j>"] = "<C-D>",
}
lvim.keys.visual_block_mode = {
["<c-s>"] = "<ESC>:w<CR>",
["<c-q>"] = "<ESC>:lua Custom_Close()<CR>",
["<C-.>"] = "<ESC>:bn<CR>",
["<C-,>"] = "<ESC>:bp<CR>",
["K"] = ":move '<-2<CR>gv-gv",
["J"] = ":move '>+1<CR>gv-gv",
["<S-Up>"] = "<C-U>",

View File

@ -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

View File

@ -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/<b><span color=\"red\">/;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"

View File

@ -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

View File

@ -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 ""

View File

@ -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

View File

@ -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

View File

@ -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%"