From 71ca28742ac4f93ab2401eaee8e78471c023cd4b Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Thu, 7 Nov 2024 11:32:27 +0800 Subject: Update --- Makefile | 4 +- README.md | 2 + X11/libinput/00-keyboard.conf | 9 + X11/libinput/09-custom-kbd.conf | 6 + X11/libinput/30-touchpad.conf | 7 + X11/mpd/ncmpcpp/.gitignore | 1 + X11/mpd/ncmpcpp/bindings | 46 +++++ X11/mpd/ncmpcpp/config | 95 ++++++++++ X11/mpd/ncmpcpp/config.bak | 66 +++++++ X11/mpd/ncmpcpp/cover.sh | 18 ++ X11/mpd/ncmpcpp/cover_obs.sh | 21 +++ X11/mpd/ncmpcpp/default_cover.png | Bin 0 -> 42425 bytes X11/mpd/ncmpcpp/scripts/album-art | 248 +++++++++++++++++++++++++ X11/mpd/ncmpcpp/scripts/music.png | Bin 0 -> 113344 bytes X11/mpd/ncmpcpp/scripts/ncmpcpp-art | 22 +++ X11/mpd/ncmpcpp/tsession | 32 ++++ kobo/settings.reader.lua | 257 -------------------------- kobo/settings/gestures.lua | 358 ------------------------------------ misc/kobo/settings.reader.lua | 257 ++++++++++++++++++++++++++ misc/kobo/settings/gestures.lua | 358 ++++++++++++++++++++++++++++++++++++ misc/libinput/00-keyboard.conf | 9 - misc/libinput/30-touchpad.conf | 7 - misc/systemd/wakeup.service | 12 ++ mpd/ncmpcpp/.gitignore | 1 - mpd/ncmpcpp/bindings | 46 ----- mpd/ncmpcpp/config | 95 ---------- mpd/ncmpcpp/config.bak | 66 ------- mpd/ncmpcpp/cover.sh | 18 -- mpd/ncmpcpp/cover_obs.sh | 21 --- mpd/ncmpcpp/default_cover.png | Bin 42425 -> 0 bytes mpd/ncmpcpp/scripts/album-art | 248 ------------------------- mpd/ncmpcpp/scripts/music.png | Bin 113344 -> 0 bytes mpd/ncmpcpp/scripts/ncmpcpp-art | 22 --- mpd/ncmpcpp/tsession | 32 ---- systemd/wakeup.service | 12 -- web/stylelint.config.json | 5 - xorg/09-custom-kbd.conf | 6 - 37 files changed, 1202 insertions(+), 1205 deletions(-) create mode 100644 X11/libinput/00-keyboard.conf create mode 100644 X11/libinput/09-custom-kbd.conf create mode 100644 X11/libinput/30-touchpad.conf create mode 100644 X11/mpd/ncmpcpp/.gitignore create mode 100644 X11/mpd/ncmpcpp/bindings create mode 100644 X11/mpd/ncmpcpp/config create mode 100644 X11/mpd/ncmpcpp/config.bak create mode 100755 X11/mpd/ncmpcpp/cover.sh create mode 100755 X11/mpd/ncmpcpp/cover_obs.sh create mode 100644 X11/mpd/ncmpcpp/default_cover.png create mode 100755 X11/mpd/ncmpcpp/scripts/album-art create mode 100644 X11/mpd/ncmpcpp/scripts/music.png create mode 100755 X11/mpd/ncmpcpp/scripts/ncmpcpp-art create mode 100644 X11/mpd/ncmpcpp/tsession delete mode 100755 kobo/settings.reader.lua delete mode 100644 kobo/settings/gestures.lua create mode 100755 misc/kobo/settings.reader.lua create mode 100644 misc/kobo/settings/gestures.lua delete mode 100644 misc/libinput/00-keyboard.conf delete mode 100644 misc/libinput/30-touchpad.conf create mode 100644 misc/systemd/wakeup.service delete mode 100644 mpd/ncmpcpp/.gitignore delete mode 100644 mpd/ncmpcpp/bindings delete mode 100644 mpd/ncmpcpp/config delete mode 100644 mpd/ncmpcpp/config.bak delete mode 100755 mpd/ncmpcpp/cover.sh delete mode 100755 mpd/ncmpcpp/cover_obs.sh delete mode 100644 mpd/ncmpcpp/default_cover.png delete mode 100755 mpd/ncmpcpp/scripts/album-art delete mode 100644 mpd/ncmpcpp/scripts/music.png delete mode 100755 mpd/ncmpcpp/scripts/ncmpcpp-art delete mode 100644 mpd/ncmpcpp/tsession delete mode 100644 systemd/wakeup.service delete mode 100644 web/stylelint.config.json delete mode 100644 xorg/09-custom-kbd.conf diff --git a/Makefile b/Makefile index 41d22a8..555634e 100644 --- a/Makefile +++ b/Makefile @@ -65,7 +65,7 @@ crontab: # Swap Ctrl-Caps in X11 libinput: - sudo ln -sf `pwd`/misc/libinput/* /etc/X11/xorg.conf.d/ + sudo ln -sf `pwd`/X11/libinput/* /etc/X11/xorg.conf.d/ # Swap Ctrl-Caps in tty2~6 console: @@ -104,7 +104,7 @@ alacritty: ln -sf `pwd`/X11/alacritty ~/.config/alacritty mpd: - ln -sf `pwd`/mpd/ncmpcpp ~/.config/ncmpcpp + ln -sf `pwd`/X11/mpd/ncmpcpp ~/.config/ncmpcpp rm -rf ~/.ncmpcpp snippets: diff --git a/README.md b/README.md index 8843333..1ab9a10 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ ## Getting Started + **via curl** + ``` curl -fsS https://raw.githubusercontent.com/typebrook/helper/dev/bin/install.sh | bash diff --git a/X11/libinput/00-keyboard.conf b/X11/libinput/00-keyboard.conf new file mode 100644 index 0000000..4aa4ac7 --- /dev/null +++ b/X11/libinput/00-keyboard.conf @@ -0,0 +1,9 @@ +# Written by systemd-localed(8), read by systemd-localed and Xorg. It's +# probably wise not to edit this file manually. Use localectl(1) to +# instruct systemd-localed to update it. +Section "InputClass" + Identifier "system-keyboard" + MatchIsKeyboard "on" + Option "XkbLayout" "us" + Option "XkbOptions" "ctrl:nocaps" +EndSection diff --git a/X11/libinput/09-custom-kbd.conf b/X11/libinput/09-custom-kbd.conf new file mode 100644 index 0000000..f2123ff --- /dev/null +++ b/X11/libinput/09-custom-kbd.conf @@ -0,0 +1,6 @@ +Section "InputClass" + Identifier "keyboard defaults" + MatchIsKeyboard "on" + + Option "XKbOptions" "ctrl:nocaps" +EndSection diff --git a/X11/libinput/30-touchpad.conf b/X11/libinput/30-touchpad.conf new file mode 100644 index 0000000..b5d4424 --- /dev/null +++ b/X11/libinput/30-touchpad.conf @@ -0,0 +1,7 @@ +# check ~/.local/share/xorg/Xorg.0.log for device name +Section "InputClass" + Identifier "touchpad" + Driver "libinput" + Option "Tapping" "on" + Option "NaturalScrolling" "on" +EndSection diff --git a/X11/mpd/ncmpcpp/.gitignore b/X11/mpd/ncmpcpp/.gitignore new file mode 100644 index 0000000..397b4a7 --- /dev/null +++ b/X11/mpd/ncmpcpp/.gitignore @@ -0,0 +1 @@ +*.log diff --git a/X11/mpd/ncmpcpp/bindings b/X11/mpd/ncmpcpp/bindings new file mode 100644 index 0000000..d035f7f --- /dev/null +++ b/X11/mpd/ncmpcpp/bindings @@ -0,0 +1,46 @@ +# the t key isn't used and it's easier to press than /, so lets use it +def_key "t" + find +def_key "t" + find_item_forward + +def_key "+" + show_clock +def_key "=" + volume_up + +def_key "j" + scroll_down +def_key "k" + scroll_up + +def_key "ctrl-u" + page_up +def_key "ctrl-d" + page_down + +def_key "h" + previous_column +def_key "l" + next_column + +def_key "." + show_lyrics + +def_key "n" + next_found_item +def_key "N" + previous_found_item + +def_key "J" + move_sort_order_down +def_key "K" + move_sort_order_up + +def_key "g" + move_home +def_key "G" + move_end + +def_key "0" + replay_song diff --git a/X11/mpd/ncmpcpp/config b/X11/mpd/ncmpcpp/config new file mode 100644 index 0000000..e818015 --- /dev/null +++ b/X11/mpd/ncmpcpp/config @@ -0,0 +1,95 @@ +## Copyright (C) 2020-2021 Aditya Shakya +## Everyone is permitted to copy and distribute copies of this file under GNU-GPL3 + +### Directories ### +ncmpcpp_directory = ~/.config/ncmpcpp/ +lyrics_directory = ~/.config/ncmpcpp/lyrics +mpd_music_dir = ~/Music +mpd_host = "localhost" +mpd_port = "6600" +mpd_crossfade_time = "2" + +### Script ### +#execute_on_song_change="~/.config/ncmpcpp/scripts/album-art" +#execute_on_song_change = "~/.ncmpcpp/cover_obs.sh" + +### Behaviour ### +message_delay_time = 1 +autocenter_mode = "yes" +centered_cursor = "yes" +ignore_leading_the = "yes" +playlist_disable_highlight_delay = 2 +allow_for_physical_item_deletion = "no" + +### Visualizer ### +#visualizer_data_source = /tmp/mpd.fifo +#visualizer_output_name = "mpd_visualizer" +#visualizer_in_stereo = "yes" +#visualizer_look = " " +visualizer_type = "spectrum" + +### Appearance ### +playlist_display_mode = "columns" +colors_enabled = "yes" +#user_interface = classic +user_interface = alternative +volume_color = "white" + +### Window ### +song_window_title_format = "Music Player" +#song_window_title_format = "{%a - }{%t}|{%f}" +statusbar_visibility = "no" +header_visibility = "no" +titles_visibility = "yes" + +### Progress bar ### +progressbar_look = "▂▂▂" +progressbar_color = "black" +progressbar_elapsed_color = "yellow" + +### Alternative UI ### +alternative_ui_separator_color = "blue" +alternative_header_first_line_format = $b$5$/b $b$8{%t}|{%f}$/b $/b +alternative_header_second_line_format = {$b{$2 %a$9}{ - $7 %b$9}{ ($2%y$9)}}|{%D} + +### Song list ### +song_status_format = "$7%t" +song_list_format = " $4%t$9 $7$R%a$9 $2%l$9 " +song_library_format = {{%a - %t} (%b)}|{%f} +song_columns_list_format = "(35)[blue]{t} (30)[green]{a} (6)[cyan]{lr}" + +### Colors ### +main_window_color = "blue" +state_line_color = "black" +current_item_prefix = "$(blue)$r" +current_item_suffix = "$/r$(end)" +current_item_inactive_column_prefix = red +current_item_inactive_column_suffix = red +now_playing_prefix = "$4 " +selected_item_prefix = "* " + +color1 = "white" +color2 = "red" + +### Layout ### +startup_screen = visualizer +startup_slave_screen = playlist +startup_slave_screen_focus = yes +locked_screen_width_part = 25 + +### Misc ### +default_place_to_search_in = "database" + +display_bitrate = "no" +enable_window_title = "yes" +follow_now_playing_lyrics = "yes" +empty_tag_marker = "" + +cyclic_scrolling = "yes" +header_text_scrolling = "yes" +jump_to_now_playing_song_at_start = "yes" +lines_scrolled = "2" + +system_encoding = "utf-8" +regular_expressions = "extended" + diff --git a/X11/mpd/ncmpcpp/config.bak b/X11/mpd/ncmpcpp/config.bak new file mode 100644 index 0000000..eb3fff6 --- /dev/null +++ b/X11/mpd/ncmpcpp/config.bak @@ -0,0 +1,66 @@ +## Copyright (C) 2020-2021 Aditya Shakya +## Everyone is permitted to copy and distribute copies of this file under GNU-GPL3 + +### Directories ### +ncmpcpp_directory = ~/.ncmpcpp +lyrics_directory = ~/.ncmpcpp/lyrics +mpd_music_dir = ~/Music +mpd_host = "localhost" +mpd_port = "6600" +mpd_crossfade_time = "2" + +### Script ### +execute_on_song_change = "kunst --size 60x60 --silent" + +### Behaviour ### +message_delay_time = 1 +autocenter_mode = "yes" +centered_cursor = "yes" +ignore_leading_the = "yes" +playlist_disable_highlight_delay = 2 +allow_for_physical_item_deletion = "no" + +### Visualizer ### +visualizer_data_source = /tmp/mpd.fifo +visualizer_output_name = "mpd_visualizer" +visualizer_in_stereo = "yes" +visualizer_look = ●● +visualizer_type = "ellipse" + +### Appearance ### +playlist_display_mode = "columns" +colors_enabled = "yes" +#user_interface = classic +user_interface = alternative +volume_color = "white" + +### Window ### +song_window_title_format = "{%a - }{%t}|{%f}" +statusbar_visibility = "no" +header_visibility = "no" +titles_visibility = "no" + +### Progress bar ### +progressbar_look = "▂▂▂" +progressbar_color = "black" +progressbar_elapsed_color = "yellow" + +### Alternative UI ### +alternative_ui_separator_color = "black" +alternative_header_first_line_format = $b$5$/b $b$8{%t}|{%f}$/b $/b +alternative_header_second_line_format = {$b{$2 %a$9}{ - $7 %b$9}{ ($2%y$9)}}|{%D} + +### Song list ### +song_status_format = "$7%t" +song_list_format = " %t $R%a %l " +song_library_format = {{%a - %t} (%b)}|{%f} +song_columns_list_format = "(53)[white]{tr} (45)[blue]{a}" + +### Colors ### +main_window_color = "blue" +current_item_prefix = "$(blue)$r" +current_item_suffix = "$/r$(end)" +current_item_inactive_column_prefix = red +current_item_inactive_column_suffix = red +color1 = "white" +color2 = "red" diff --git a/X11/mpd/ncmpcpp/cover.sh b/X11/mpd/ncmpcpp/cover.sh new file mode 100755 index 0000000..8fe8d4d --- /dev/null +++ b/X11/mpd/ncmpcpp/cover.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +source "`ueberzug library`" +COVER="/tmp/album_cover.png" + +function add_cover { + ImageLayer::add [identifier]="img" [x]="2" [y]="1" [path]="$COVER" +} + +ImageLayer 0< <( +if [ ! -f "$COVER" ]; then + cp "$HOME/.ncmpcpp/default_cover.png" "$COVER" +fi +#rerender image when changed +while inotifywait -q -q -e close_write "$COVER"; do + add_cover +done +) diff --git a/X11/mpd/ncmpcpp/cover_obs.sh b/X11/mpd/ncmpcpp/cover_obs.sh new file mode 100755 index 0000000..032bd08 --- /dev/null +++ b/X11/mpd/ncmpcpp/cover_obs.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +COVER="/tmp/album_cover.png" +COVER_SIZE="400" + +#path to current song +file="$MUSIC_DIR/$(mpc --format %file% current)" +album="${file%/*}" +#search for cover image +#use embedded image if present, otherwise take it from the current folder +err=$(ffmpeg -loglevel 16 -y -i "$file" -an -vcodec copy $EMB_COVER 2>&1) +if [ "$err" != "" ]; then + art=$(find "$album" -maxdepth 1 | grep -m 1 ".*\.\(jpg\|png\|gif\|bmp\)") +else + art=$EMB_COVER +fi +if [ "$art" = "" ]; then + art="$HOME/.ncmpcpp/default_cover.png" +fi +#copy and resize image to destination +ffmpeg -loglevel 0 -y -i "$art" -vf "scale=$COVER_SIZE:-1" "$COVER" \ No newline at end of file diff --git a/X11/mpd/ncmpcpp/default_cover.png b/X11/mpd/ncmpcpp/default_cover.png new file mode 100644 index 0000000..c02d40b Binary files /dev/null and b/X11/mpd/ncmpcpp/default_cover.png differ diff --git a/X11/mpd/ncmpcpp/scripts/album-art b/X11/mpd/ncmpcpp/scripts/album-art new file mode 100755 index 0000000..d852f34 --- /dev/null +++ b/X11/mpd/ncmpcpp/scripts/album-art @@ -0,0 +1,248 @@ +#!/usr/bin/env bash + +## Copyright (C) 2020-2021 Aditya Shakya +## Everyone is permitted to copy and distribute copies of this file under GNU-GPL3 + +## Cover art script for ncmpcpp + +# SETTINGS +music_library="$HOME/Music" +padding_top=3 +padding_bottom=0 +padding_right=0 +max_width=40 +reserved_playlist_cols=31 +reserved_cols_in_percent="false" +force_square="true" +square_alignment="top" +left_aligned="true" +padding_left=0 + +# Only set this if the geometries are wrong or ncmpcpp shouts at you to do it. +# Visually select/highlight a character on your terminal, zoom in an image +# editor and count how many pixels a character's width and height are. +font_height= +font_width= + +main() { + kill_previous_instances >/dev/null 2>&1 + find_cover_image >/dev/null 2>&1 + display_cover_image 2>/dev/null + dunstify -u low --replace=69 -i "$cover_path" "$(mpc current)" + detect_window_resizes >/dev/null 2>&1 +} + +# ==== Main functions ========================================================= + +kill_previous_instances() { + script_name=$(basename "$0") + for pid in $(pidof -x "$script_name"); do + if [ "$pid" != $$ ]; then + kill -15 "$pid" + fi + done +} + +find_cover_image() { + + # First we check if the audio file has an embedded album art + ext="$(mpc --format %file% current | sed 's/^.*\.//')" + if [ "$ext" = "flac" ]; then + # since FFMPEG cannot export embedded FLAC art we use metaflac + metaflac --export-picture-to=/tmp/mpd_cover.jpg \ + "$(mpc --format "$music_library"/%file% current)" && + cover_path="/tmp/mpd_cover.jpg" && return + else + ffmpeg -y -i "$(mpc --format "$music_library"/%file% | head -n 1)" \ + /tmp/mpd_cover.jpg && + cover_path="/tmp/mpd_cover.jpg" && return + fi + + # If no embedded art was found we look inside the music file's directory + album="$(mpc --format %album% current)" + file="$(mpc --format %file% current)" + album_dir="${file%/*}" + album_dir="$music_library/$album_dir" + found_covers="$(find "$album_dir" -type d -exec find {} -maxdepth 1 -type f \ + -iregex ".*/.*\(${album}\|cover\|folder\|artwork\|front\).*[.]\\(jpe?g\|png\|gif\|bmp\)" \; )" + cover_path="$(echo "$found_covers" | head -n1)" + if [ -n "$cover_path" ]; then + return + fi + + # If we still failed to find a cover image, we use the fallback + if [ -z "$cover_path" ]; then + cover_path="$HOME/.ncmpcpp/scripts/music.png" + fi +} + +display_cover_image() { + compute_geometry + + send_to_ueberzug \ + action "add" \ + identifier "mpd_cover" \ + path "$cover_path" \ + x "$ueber_left" \ + y "$padding_top" \ + height "$ueber_height" \ + width "$ueber_width" \ + synchronously_draw "True" \ + scaler "forced_cover" \ + scaling_position_x "0.5" +} + +detect_window_resizes() { + { + trap 'display_cover_image' WINCH + while :; do sleep .1; done + } & +} + + +# ==== Helper functions ========================================================= + +compute_geometry() { + unset LINES COLUMNS # Required in order for tput to work in a script + term_lines=$(tput lines) + term_cols=$(tput cols) + if [ -z "$font_height" ] || [ -z "$font_height" ]; then + guess_font_size + fi + + ueber_height=$(( term_lines - padding_top - padding_bottom )) + # Because Ueberzug uses characters as a unit we must multiply + # the line count (height) by the font size ratio in order to + # obtain an equivalent width in column count + ueber_width=$(( ueber_height * font_height / font_width )) + ueber_left=$(( term_cols - ueber_width - padding_right )) + + if [ "$left_aligned" = "true" ]; then + compute_geometry_left_aligned + else + compute_geometry_right_aligned + fi + + apply_force_square_setting +} + +compute_geometry_left_aligned() { + ueber_left=$padding_left + max_width_chars=$(( term_cols * max_width / 100 )) + if [ "$max_width" != 0 ] && + [ $(( ueber_width + padding_right + padding_left )) -gt "$max_width_chars" ]; then + ueber_width=$(( max_width_chars - padding_left - padding_right )) + fi +} + +compute_geometry_right_aligned() { + if [ "$reserved_cols_in_percent" = "true" ]; then + ueber_left_percent=$(printf "%.0f\n" $(calc "$ueber_left" / "$term_cols" '*' 100)) + if [ "$ueber_left_percent" -lt "$reserved_playlist_cols" ]; then + ueber_left=$(( term_cols * reserved_playlist_cols / 100 )) + ueber_width=$(( term_cols - ueber_left - padding_right )) + fi + else + if [ "$ueber_left" -lt "$reserved_playlist_cols" ]; then + ueber_left=$reserved_playlist_cols + ueber_width=$(( term_cols - ueber_left - padding_right )) + fi + + fi + + if [ "$max_width" != 0 ] && [ "$ueber_width" -gt "$max_width" ]; then + ueber_width=$max_width + ueber_left=$(( term_cols - ueber_width - padding_right )) + fi +} + +apply_force_square_setting() { + if [ $force_square = "true" ]; then + ueber_height=$(( ueber_width * font_width / font_height )) + case "$square_alignment" in + center) + area=$(( term_lines - padding_top - padding_bottom )) + padding_top=$(( padding_top + area / 2 - ueber_height / 2 )) + ;; + bottom) + padding_top=$(( term_lines - padding_bottom - ueber_height )) + ;; + *) ;; + esac + fi +} + +guess_font_size() { + # A font width and height estimate is required to + # properly compute the cover width (in columns). + # We are reproducing the arithmetic used by Ueberzug + # to guess font size. + # https://github.com/seebye/ueberzug/blob/master/ueberzug/terminal.py#L24 + + guess_terminal_pixelsize + + approx_font_width=$(( term_width / term_cols )) + approx_font_height=$(( term_height / term_lines )) + + term_xpadding=$(( ( - approx_font_width * term_cols + term_width ) / 2 )) + term_ypadding=$(( ( - approx_font_height * term_lines + term_height ) / 2 )) + + font_width=$(( (term_width - 2 * term_xpadding) / term_cols )) + font_height=$(( (term_height - 2 * term_ypadding) / term_lines )) +} + +guess_terminal_pixelsize() { + # We are re-using the same Python snippet that + # Ueberzug utilizes to retrieve terminal window size. + # https://github.com/seebye/ueberzug/blob/master/ueberzug/terminal.py#L10 + + python < "$FIFO_UEBERZUG" + + IFS=${old_IFS} +} + +main diff --git a/X11/mpd/ncmpcpp/scripts/music.png b/X11/mpd/ncmpcpp/scripts/music.png new file mode 100644 index 0000000..3ded333 Binary files /dev/null and b/X11/mpd/ncmpcpp/scripts/music.png differ diff --git a/X11/mpd/ncmpcpp/scripts/ncmpcpp-art b/X11/mpd/ncmpcpp/scripts/ncmpcpp-art new file mode 100755 index 0000000..38d34c1 --- /dev/null +++ b/X11/mpd/ncmpcpp/scripts/ncmpcpp-art @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +## Copyright (C) 2020-2021 Aditya Shakya +## Everyone is permitted to copy and distribute copies of this file under GNU-GPL3 + +export FIFO_UEBERZUG="/tmp/mpd-ueberzug-${PPID}" + +cleanup() { + rm "$FIFO_UEBERZUG" 2>/dev/null + rm /tmp/mpd_cover.jpg 2>/dev/null + pkill -P $$ 2>/dev/null + pkill album-art +} + +pkill -P $$ 2>/dev/null +rm "$FIFO_UEBERZUG" 2>/dev/null +mkfifo "$FIFO_UEBERZUG" >/dev/null +trap cleanup EXIT 2>/dev/null +tail --follow "$FIFO_UEBERZUG" | ueberzug layer --silent --parser simple >/dev/null 2>&1 & + +ncmpcpp -c ~/.ncmpcpp/config-art +cleanup diff --git a/X11/mpd/ncmpcpp/tsession b/X11/mpd/ncmpcpp/tsession new file mode 100644 index 0000000..e34d4b8 --- /dev/null +++ b/X11/mpd/ncmpcpp/tsession @@ -0,0 +1,32 @@ +neww +set -g status off + +#image pane; run cover script, disable text output and remove prompt +send-keys "stty -echo" C-m +send-keys "tput civis -- invisible" C-m +send-keys "export PS1=''" C-m +send-keys "clear" C-m +send-keys "~/.ncmpcpp/cover.sh " C-m + +#catalog pane; run instance of ncmpcpp +split-window -v +select-pane -t 1 +send-keys "ncmpcpp --config='~/.ncmpcpp/catalog.conf'" C-m +send-keys 1 + +#visualizer pane; run instance of ncmpcpp in visualizer mode +select-pane -t 0 +split-window -h +send-keys "ncmpcpp --config='~/.ncmpcpp/visualizer.conf'" C-m +send-keys 8 +send-keys u + +#resize image and visualizer pane to fit image +resize-pane -t 0 -x 49 -y 23 +resize-pane -t 1 -y 23 + +#hook for keeping the image pane size constant +set-hook client-resized 'resize-pane -t 0 -x 49 -y 23' + +#focus on catalog pane +select-pane -t 2 \ No newline at end of file diff --git a/kobo/settings.reader.lua b/kobo/settings.reader.lua deleted file mode 100755 index ea3722a..0000000 --- a/kobo/settings.reader.lua +++ /dev/null @@ -1,257 +0,0 @@ --- we can read Lua syntax here! -return { - ["BookShortcuts_directory_action"] = "FM", - ["SSH_allow_no_password"] = true, - ["activate_menu"] = "swipe", - ["auto_disable_wifi"] = true, - ["auto_save_settings_interval_minutes"] = 15, - ["auto_standby_timeout_seconds"] = -1, - ["auto_suspend_timeout_seconds"] = 900, - ["autodim_duration_seconds"] = 5, - ["autodim_fraction"] = 20, - ["autodim_starttime_minutes"] = -1, - ["autoshutdown_timeout_seconds"] = -1, - ["autoturn_distance"] = 1, - ["autoturn_enabled"] = false, - ["autoturn_timeout_seconds"] = 5, - ["autowarmth_fl_off_during_day_offset_s"] = 0, - ["avoid_flashing_ui"] = true, - ["back_in_filemanager"] = "parent_folder", - ["back_in_reader"] = "default", - ["back_to_exit"] = "disable", - ["bookmarks_items_font_size"] = 19, - ["bookmarks_items_per_page"] = 14, - ["calibre_opds"] = {}, - ["closed_rotation_mode"] = 0, - ["copt_font_gamma"] = 43, - ["copt_h_page_margins"] = { - [1] = 20, - [2] = 20, - }, - ["copt_line_spacing"] = 115, - ["copt_status_line"] = 1, - ["coverbrowser_initial_default_setup_done"] = true, - ["cre_font_family_fonts"] = {}, - ["cre_header_auto_refresh"] = 1, - ["cre_header_battery"] = 1, - ["cre_header_battery_percent"] = 0, - ["cre_header_chapter_marks"] = 1, - ["cre_header_clock"] = 1, - ["cre_header_page_count"] = 1, - ["cre_header_page_number"] = 1, - ["cre_header_reading_percent"] = 0, - ["cre_header_title"] = 1, - ["default_highlight_action"] = "dictionary", - ["dev_no_c_blitter"] = false, - ["device_id"] = "2F1B2BBA7854401D999E14DD76377039", - ["device_status_battery_alarm"] = true, - ["device_status_battery_interval_minutes"] = 15, - ["device_status_battery_threshold"] = 10, - ["device_status_battery_threshold_high"] = 100, - ["device_status_memory_interval_minutes"] = 5, - ["device_status_memory_threshold"] = 100, - ["dicts_disabled"] = {}, - ["dicts_order"] = {}, - ["duration_format"] = "classic", - ["end_document_action"] = "mark_read", - ["exporter"] = { - ["html"] = { - ["enabled"] = false, - }, - ["joplin"] = { - ["enabled"] = false, - }, - ["json"] = { - ["enabled"] = false, - }, - ["markdown"] = { - ["formatting_options"] = { - ["invert"] = "bold", - ["lighten"] = "italic", - ["strikeout"] = "strikethrough", - ["underscore"] = "underline_markdownit", - }, - ["highlight_formatting"] = true, - }, - ["readwise"] = { - ["enabled"] = false, - }, - ["text"] = { - ["enabled"] = false, - }, - }, - ["filemanagermenu_tab_index"] = 3, - ["flash_keyboard"] = false, - ["folder_shortcuts"] = {}, - ["footer"] = { - ["align"] = "center", - ["all_at_once"] = false, - ["auto_refresh_time"] = false, - ["battery"] = false, - ["battery_hide_threshold"] = 100, - ["book_chapter"] = false, - ["book_chapter_max_width_pct"] = 30, - ["book_time_to_read"] = false, - ["book_title"] = false, - ["book_title_max_width_pct"] = 30, - ["bookmark_count"] = false, - ["bottom_horizontal_separator"] = false, - ["chapter_progress"] = false, - ["chapter_time_to_read"] = false, - ["container_bottom_padding"] = 1, - ["container_height"] = 14, - ["disable_progress_bar"] = false, - ["disabled"] = false, - ["frontlight"] = false, - ["hide_empty_generators"] = false, - ["item_prefix"] = "icons", - ["items_separator"] = "bar", - ["lock_tap"] = false, - ["mem_usage"] = false, - ["page_progress"] = true, - ["pages_left"] = false, - ["pages_left_book"] = false, - ["pages_left_includes_current_page"] = false, - ["percentage"] = false, - ["progress_bar_min_width_pct"] = 20, - ["progress_bar_position"] = "alongside", - ["progress_margin"] = false, - ["progress_margin_width"] = 24, - ["progress_pct_format"] = "0", - ["progress_style_thick_height"] = 7, - ["progress_style_thin"] = false, - ["progress_style_thin_height"] = 3, - ["reclaim_height"] = false, - ["skim_widget_on_hold"] = false, - ["text_font_bold"] = false, - ["text_font_size"] = 14, - ["time"] = true, - ["toc_markers"] = true, - ["toc_markers_width"] = 2, - ["wifi_status"] = false, - }, - ["frontlight_intensity"] = 15, - ["frontlight_warmth"] = 0, - ["ges_tap_interval_on_keyboard_ms"] = 0, - ["highlight_lighten_factor"] = 0.2, - ["highlight_long_hold_threshold_s"] = 3, - ["history_filter"] = "all", - ["hold_pan_rate"] = 5, - ["home_dir"] = "/mnt/onboard/books", - ["inertial_scroll"] = false, - ["input_ignore_gsensor"] = true, - ["is_frontlight_on"] = false, - ["keyboard_key_font_size"] = 22, - ["keyboard_layout"] = "en", - ["keyboard_layouts"] = {}, - ["language"] = "C", - ["last_migration_date"] = 20221027, - ["lastdir"] = "/mnt/onboard/books", - ["lastfile"] = "/mnt/onboard/books/unix/ascii.txt", - ["low_pan_rate"] = false, - ["menu_search_string"] = "幫助", - ["metric_length"] = true, - ["multiswipes_enabled"] = false, - ["opds_servers"] = { - [1] = { - ["title"] = "Project Gutenberg", - ["url"] = "https://m.gutenberg.org/ebooks.opds/?format=opds", - }, - [2] = { - ["title"] = "Standard Ebooks", - ["url"] = "https://standardebooks.org/feeds/opds", - }, - [3] = { - ["title"] = "Feedbooks", - ["url"] = "https://catalog.feedbooks.com/catalog/public_domain.atom", - }, - [4] = { - ["title"] = "ManyBooks", - ["url"] = "http://manybooks.net/opds/index.php", - }, - [5] = { - ["title"] = "Internet Archive", - ["url"] = "https://bookserver.archive.org/", - }, - [6] = { - ["title"] = "textos.info (Spanish)", - ["url"] = "https://www.textos.info/catalogo.atom", - }, - [7] = { - ["title"] = "Gallica (French)", - ["url"] = "https://gallica.bnf.fr/opds", - }, - }, - ["page_turns_tap_zones"] = "default", - ["panel_zoom_enabled"] = { - ["cbt"] = true, - ["cbz"] = true, - }, - ["panel_zoom_fallback_to_text_selection"] = { - ["pdf"] = true, - }, - ["plugins_disabled"] = { - ["calibre"] = true, - ["calibrecompanion"] = true, - ["evernote"] = true, - ["exporter"] = true, - ["externalkeyboard"] = true, - ["goodreads"] = true, - ["japanese"] = true, - ["keepalive"] = true, - ["kobolight"] = true, - ["movetoarchive"] = true, - ["opds"] = true, - ["readtimer"] = true, - ["send2ebook"] = true, - ["storagestat"] = true, - ["vocabbuilder"] = true, - ["zsync"] = true, - }, - ["quickstart_shown_version"] = 202301000000, - ["reader_footer_custom_text"] = "KOReader", - ["reader_footer_custom_text_repetitions"] = "1", - ["reader_footer_mode"] = 0, - ["save_document"] = "prompt", - ["screensaver_delay"] = "disable", - ["screensaver_hide_fallback_msg"] = false, - ["screensaver_image"] = "/mnt/onboard/screenshots/Reader_2023-02-15_140821.png", - ["screensaver_img_background"] = "black", - ["screensaver_message_position"] = "bottom", - ["screensaver_msg_background"] = "none", - ["screensaver_show_message"] = true, - ["screensaver_stretch_images"] = false, - ["screensaver_type"] = "image_file", - ["screenshot_dir"] = "/mnt/onboard/screenshots/", - ["scroll_method"] = "classic", - ["shorten_home_dir"] = false, - ["show_bottom_menu"] = false, - ["show_hidden"] = true, - ["show_unsupported"] = true, - ["start_with"] = "filemanager", - ["statistics"] = { - ["calendar_browse_future_months"] = false, - ["calendar_nb_book_spans"] = 3, - ["calendar_show_histogram"] = true, - ["calendar_start_day_of_week"] = 2, - ["convert_to_db"] = true, - ["is_enabled"] = true, - ["max_sec"] = 120, - ["min_sec"] = 5, - }, - ["style_tweaks"] = { - ["footnote-inpage_epub_smaller"] = true, - ["footnote-inpage_fb2"] = true, - }, - ["style_tweaks_in_dispatcher"] = {}, - ["terminal_buffer_size"] = 16, - ["terminal_font_size"] = 16, - ["terminal_shell"] = "sh", - ["text_lang_fallback"] = "en-US", - ["toc_items_per_page"] = 14, - ["vocabulary_builder"] = { - ["enabled"] = true, - }, - ["wifi_disable_action"] = "leave_on", - ["wifi_was_on"] = false, -} diff --git a/kobo/settings/gestures.lua b/kobo/settings/gestures.lua deleted file mode 100644 index a15d344..0000000 --- a/kobo/settings/gestures.lua +++ /dev/null @@ -1,358 +0,0 @@ --- we can read Lua syntax here! -return { - ["custom_multiswipes"] = {}, - ["gesture_fm"] = { - ["hold_bottom_left_corner"] = { - ["history"] = true, - ["settings"] = { - ["order"] = { - [1] = "history", - }, - }, - }, - ["hold_bottom_right_corner"] = { - ["settings"] = { - ["order"] = { - [1] = "suspend", - }, - }, - ["suspend"] = true, - }, - ["hold_top_left_corner"] = { - ["exit"] = true, - ["settings"] = { - ["order"] = { - [1] = "exit", - }, - }, - }, - ["hold_top_right_corner"] = { - ["settings"] = { - ["order"] = { - [1] = "terminal", - }, - }, - ["terminal"] = true, - }, - ["multiswipe"] = {}, - ["multiswipe_east_north"] = { - ["history"] = true, - }, - ["multiswipe_east_north_west"] = {}, - ["multiswipe_east_north_west_east"] = {}, - ["multiswipe_east_south"] = { - ["go_to"] = true, - }, - ["multiswipe_east_south_west_north"] = { - ["full_refresh"] = true, - }, - ["multiswipe_east_west"] = {}, - ["multiswipe_east_west_east"] = { - ["favorites"] = true, - }, - ["multiswipe_north_east"] = {}, - ["multiswipe_north_south"] = { - ["folder_up"] = true, - }, - ["multiswipe_north_south_north"] = {}, - ["multiswipe_north_west"] = { - ["folder_shortcuts"] = true, - }, - ["multiswipe_northwest_southwest_northwest"] = { - ["toggle_wifi"] = true, - }, - ["multiswipe_south_east"] = {}, - ["multiswipe_south_east_north"] = {}, - ["multiswipe_south_east_north_south"] = {}, - ["multiswipe_south_north"] = {}, - ["multiswipe_south_north_south"] = {}, - ["multiswipe_south_west"] = { - ["show_frontlight_dialog"] = true, - }, - ["multiswipe_southeast_northeast"] = {}, - ["multiswipe_southeast_northeast_northwest"] = { - ["wifi_on"] = true, - }, - ["multiswipe_southeast_southwest_northwest"] = { - ["wifi_off"] = true, - }, - ["multiswipe_west_east"] = {}, - ["multiswipe_west_east_west"] = { - ["open_previous_document"] = true, - }, - ["multiswipe_west_north"] = {}, - ["multiswipe_west_south"] = { - ["back"] = true, - }, - ["one_finger_swipe_right_edge_down"] = { - ["full_refresh"] = true, - ["settings"] = { - ["order"] = { - [1] = "full_refresh", - }, - }, - }, - ["one_finger_swipe_right_edge_up"] = { - ["full_refresh"] = true, - ["settings"] = { - ["order"] = { - [1] = "full_refresh", - }, - }, - }, - ["pinch_gesture"] = { - ["folder_up"] = true, - ["settings"] = { - ["order"] = { - [1] = "folder_up", - }, - }, - }, - ["short_diagonal_swipe"] = { - ["settings"] = { - ["order"] = { - [1] = "show_menu", - }, - }, - ["show_menu"] = true, - }, - ["spread_gesture"] = { - ["open_previous_document"] = true, - ["settings"] = { - ["order"] = { - [1] = "open_previous_document", - }, - }, - }, - ["tap_left_bottom_corner"] = { - ["settings"] = { - ["order"] = { - [1] = "show_frontlight_dialog", - }, - }, - ["show_frontlight_dialog"] = true, - }, - ["two_finger_swipe_east"] = { - ["settings"] = { - ["order"] = { - [1] = "toggle_wifi", - }, - }, - ["toggle_wifi"] = true, - }, - ["two_finger_swipe_north"] = { - ["settings"] = { - ["order"] = { - [1] = "show_network_info", - }, - }, - ["show_network_info"] = true, - }, - ["two_finger_swipe_south"] = { - ["reboot"] = true, - ["settings"] = { - ["order"] = { - [1] = "reboot", - }, - }, - }, - ["two_finger_swipe_west"] = { - ["settings"] = { - ["order"] = { - [1] = "toggle_ssh_server", - }, - }, - ["toggle_ssh_server"] = true, - }, - }, - ["gesture_reader"] = { - ["double_tap_left_side"] = { - ["page_jmp"] = -10, - }, - ["double_tap_right_side"] = { - ["page_jmp"] = 10, - }, - ["hold_bottom_left_corner"] = { - ["history"] = true, - ["settings"] = { - ["order"] = { - [1] = "history", - }, - }, - }, - ["hold_bottom_right_corner"] = { - ["settings"] = { - ["order"] = { - [1] = "suspend", - }, - }, - ["suspend"] = true, - }, - ["hold_top_left_corner"] = { - ["screenshot"] = true, - ["settings"] = { - ["order"] = { - [1] = "screenshot", - }, - }, - }, - ["hold_top_right_corner"] = { - ["book_info"] = true, - ["settings"] = { - ["order"] = { - [1] = "book_info", - }, - }, - }, - ["multiswipe"] = {}, - ["multiswipe_east_north"] = { - ["history"] = true, - }, - ["multiswipe_east_north_west"] = { - ["zoom"] = "contentwidth", - }, - ["multiswipe_east_north_west_east"] = { - ["zoom"] = "pagewidth", - }, - ["multiswipe_east_south"] = { - ["go_to"] = true, - }, - ["multiswipe_east_south_west_north"] = { - ["full_refresh"] = true, - }, - ["multiswipe_east_west"] = { - ["latest_bookmark"] = true, - }, - ["multiswipe_east_west_east"] = { - ["favorites"] = true, - }, - ["multiswipe_north_east"] = { - ["toc"] = true, - }, - ["multiswipe_north_south"] = {}, - ["multiswipe_north_south_north"] = { - ["prev_chapter"] = true, - }, - ["multiswipe_north_west"] = { - ["bookmarks"] = true, - }, - ["multiswipe_northwest_southwest_northwest"] = { - ["toggle_wifi"] = true, - }, - ["multiswipe_south_east"] = { - ["toggle_reflow"] = true, - }, - ["multiswipe_south_east_north"] = { - ["zoom"] = "contentheight", - }, - ["multiswipe_south_east_north_south"] = { - ["zoom"] = "pageheight", - }, - ["multiswipe_south_north"] = { - ["skim"] = true, - }, - ["multiswipe_south_north_south"] = { - ["next_chapter"] = true, - }, - ["multiswipe_south_west"] = { - ["show_frontlight_dialog"] = true, - }, - ["multiswipe_southeast_northeast"] = { - ["follow_nearest_link"] = true, - }, - ["multiswipe_southeast_northeast_northwest"] = { - ["wifi_on"] = true, - }, - ["multiswipe_southeast_southwest_northwest"] = { - ["wifi_off"] = true, - }, - ["multiswipe_west_east"] = { - ["previous_location"] = true, - }, - ["multiswipe_west_east_west"] = { - ["open_previous_document"] = true, - }, - ["multiswipe_west_north"] = { - ["book_status"] = true, - }, - ["multiswipe_west_south"] = { - ["back"] = true, - }, - ["one_finger_swipe_right_edge_down"] = { - ["page_browser"] = true, - ["settings"] = { - ["order"] = { - [1] = "page_browser", - }, - }, - }, - ["one_finger_swipe_right_edge_up"] = { - ["book_map"] = true, - ["settings"] = { - ["order"] = { - [1] = "book_map", - }, - }, - }, - ["pinch_gesture"] = { - ["filemanager"] = true, - ["settings"] = { - ["order"] = { - [1] = "filemanager", - }, - }, - }, - ["short_diagonal_swipe"] = { - ["settings"] = { - ["order"] = { - [1] = "show_menu", - }, - }, - ["show_menu"] = true, - }, - ["spread_gesture"] = { - ["open_previous_document"] = true, - ["settings"] = { - ["order"] = { - [1] = "open_previous_document", - }, - }, - }, - ["tap_left_bottom_corner"] = { - ["settings"] = { - ["order"] = { - [1] = "show_frontlight_dialog", - }, - }, - ["show_frontlight_dialog"] = true, - }, - ["tap_top_left_corner"] = { - ["toggle_page_flipping"] = true, - }, - ["tap_top_right_corner"] = { - ["toggle_bookmark"] = true, - }, - ["two_finger_swipe_east"] = { - ["toc"] = true, - }, - ["two_finger_swipe_north"] = { - ["settings"] = { - ["order"] = { - [1] = "toggle_gsensor", - }, - }, - ["toggle_gsensor"] = true, - }, - ["two_finger_swipe_south"] = { - ["settings"] = { - ["order"] = { - [1] = "skim", - }, - }, - ["skim"] = true, - }, - ["two_finger_swipe_west"] = { - ["bookmarks"] = true, - }, - }, -} diff --git a/misc/kobo/settings.reader.lua b/misc/kobo/settings.reader.lua new file mode 100755 index 0000000..ea3722a --- /dev/null +++ b/misc/kobo/settings.reader.lua @@ -0,0 +1,257 @@ +-- we can read Lua syntax here! +return { + ["BookShortcuts_directory_action"] = "FM", + ["SSH_allow_no_password"] = true, + ["activate_menu"] = "swipe", + ["auto_disable_wifi"] = true, + ["auto_save_settings_interval_minutes"] = 15, + ["auto_standby_timeout_seconds"] = -1, + ["auto_suspend_timeout_seconds"] = 900, + ["autodim_duration_seconds"] = 5, + ["autodim_fraction"] = 20, + ["autodim_starttime_minutes"] = -1, + ["autoshutdown_timeout_seconds"] = -1, + ["autoturn_distance"] = 1, + ["autoturn_enabled"] = false, + ["autoturn_timeout_seconds"] = 5, + ["autowarmth_fl_off_during_day_offset_s"] = 0, + ["avoid_flashing_ui"] = true, + ["back_in_filemanager"] = "parent_folder", + ["back_in_reader"] = "default", + ["back_to_exit"] = "disable", + ["bookmarks_items_font_size"] = 19, + ["bookmarks_items_per_page"] = 14, + ["calibre_opds"] = {}, + ["closed_rotation_mode"] = 0, + ["copt_font_gamma"] = 43, + ["copt_h_page_margins"] = { + [1] = 20, + [2] = 20, + }, + ["copt_line_spacing"] = 115, + ["copt_status_line"] = 1, + ["coverbrowser_initial_default_setup_done"] = true, + ["cre_font_family_fonts"] = {}, + ["cre_header_auto_refresh"] = 1, + ["cre_header_battery"] = 1, + ["cre_header_battery_percent"] = 0, + ["cre_header_chapter_marks"] = 1, + ["cre_header_clock"] = 1, + ["cre_header_page_count"] = 1, + ["cre_header_page_number"] = 1, + ["cre_header_reading_percent"] = 0, + ["cre_header_title"] = 1, + ["default_highlight_action"] = "dictionary", + ["dev_no_c_blitter"] = false, + ["device_id"] = "2F1B2BBA7854401D999E14DD76377039", + ["device_status_battery_alarm"] = true, + ["device_status_battery_interval_minutes"] = 15, + ["device_status_battery_threshold"] = 10, + ["device_status_battery_threshold_high"] = 100, + ["device_status_memory_interval_minutes"] = 5, + ["device_status_memory_threshold"] = 100, + ["dicts_disabled"] = {}, + ["dicts_order"] = {}, + ["duration_format"] = "classic", + ["end_document_action"] = "mark_read", + ["exporter"] = { + ["html"] = { + ["enabled"] = false, + }, + ["joplin"] = { + ["enabled"] = false, + }, + ["json"] = { + ["enabled"] = false, + }, + ["markdown"] = { + ["formatting_options"] = { + ["invert"] = "bold", + ["lighten"] = "italic", + ["strikeout"] = "strikethrough", + ["underscore"] = "underline_markdownit", + }, + ["highlight_formatting"] = true, + }, + ["readwise"] = { + ["enabled"] = false, + }, + ["text"] = { + ["enabled"] = false, + }, + }, + ["filemanagermenu_tab_index"] = 3, + ["flash_keyboard"] = false, + ["folder_shortcuts"] = {}, + ["footer"] = { + ["align"] = "center", + ["all_at_once"] = false, + ["auto_refresh_time"] = false, + ["battery"] = false, + ["battery_hide_threshold"] = 100, + ["book_chapter"] = false, + ["book_chapter_max_width_pct"] = 30, + ["book_time_to_read"] = false, + ["book_title"] = false, + ["book_title_max_width_pct"] = 30, + ["bookmark_count"] = false, + ["bottom_horizontal_separator"] = false, + ["chapter_progress"] = false, + ["chapter_time_to_read"] = false, + ["container_bottom_padding"] = 1, + ["container_height"] = 14, + ["disable_progress_bar"] = false, + ["disabled"] = false, + ["frontlight"] = false, + ["hide_empty_generators"] = false, + ["item_prefix"] = "icons", + ["items_separator"] = "bar", + ["lock_tap"] = false, + ["mem_usage"] = false, + ["page_progress"] = true, + ["pages_left"] = false, + ["pages_left_book"] = false, + ["pages_left_includes_current_page"] = false, + ["percentage"] = false, + ["progress_bar_min_width_pct"] = 20, + ["progress_bar_position"] = "alongside", + ["progress_margin"] = false, + ["progress_margin_width"] = 24, + ["progress_pct_format"] = "0", + ["progress_style_thick_height"] = 7, + ["progress_style_thin"] = false, + ["progress_style_thin_height"] = 3, + ["reclaim_height"] = false, + ["skim_widget_on_hold"] = false, + ["text_font_bold"] = false, + ["text_font_size"] = 14, + ["time"] = true, + ["toc_markers"] = true, + ["toc_markers_width"] = 2, + ["wifi_status"] = false, + }, + ["frontlight_intensity"] = 15, + ["frontlight_warmth"] = 0, + ["ges_tap_interval_on_keyboard_ms"] = 0, + ["highlight_lighten_factor"] = 0.2, + ["highlight_long_hold_threshold_s"] = 3, + ["history_filter"] = "all", + ["hold_pan_rate"] = 5, + ["home_dir"] = "/mnt/onboard/books", + ["inertial_scroll"] = false, + ["input_ignore_gsensor"] = true, + ["is_frontlight_on"] = false, + ["keyboard_key_font_size"] = 22, + ["keyboard_layout"] = "en", + ["keyboard_layouts"] = {}, + ["language"] = "C", + ["last_migration_date"] = 20221027, + ["lastdir"] = "/mnt/onboard/books", + ["lastfile"] = "/mnt/onboard/books/unix/ascii.txt", + ["low_pan_rate"] = false, + ["menu_search_string"] = "幫助", + ["metric_length"] = true, + ["multiswipes_enabled"] = false, + ["opds_servers"] = { + [1] = { + ["title"] = "Project Gutenberg", + ["url"] = "https://m.gutenberg.org/ebooks.opds/?format=opds", + }, + [2] = { + ["title"] = "Standard Ebooks", + ["url"] = "https://standardebooks.org/feeds/opds", + }, + [3] = { + ["title"] = "Feedbooks", + ["url"] = "https://catalog.feedbooks.com/catalog/public_domain.atom", + }, + [4] = { + ["title"] = "ManyBooks", + ["url"] = "http://manybooks.net/opds/index.php", + }, + [5] = { + ["title"] = "Internet Archive", + ["url"] = "https://bookserver.archive.org/", + }, + [6] = { + ["title"] = "textos.info (Spanish)", + ["url"] = "https://www.textos.info/catalogo.atom", + }, + [7] = { + ["title"] = "Gallica (French)", + ["url"] = "https://gallica.bnf.fr/opds", + }, + }, + ["page_turns_tap_zones"] = "default", + ["panel_zoom_enabled"] = { + ["cbt"] = true, + ["cbz"] = true, + }, + ["panel_zoom_fallback_to_text_selection"] = { + ["pdf"] = true, + }, + ["plugins_disabled"] = { + ["calibre"] = true, + ["calibrecompanion"] = true, + ["evernote"] = true, + ["exporter"] = true, + ["externalkeyboard"] = true, + ["goodreads"] = true, + ["japanese"] = true, + ["keepalive"] = true, + ["kobolight"] = true, + ["movetoarchive"] = true, + ["opds"] = true, + ["readtimer"] = true, + ["send2ebook"] = true, + ["storagestat"] = true, + ["vocabbuilder"] = true, + ["zsync"] = true, + }, + ["quickstart_shown_version"] = 202301000000, + ["reader_footer_custom_text"] = "KOReader", + ["reader_footer_custom_text_repetitions"] = "1", + ["reader_footer_mode"] = 0, + ["save_document"] = "prompt", + ["screensaver_delay"] = "disable", + ["screensaver_hide_fallback_msg"] = false, + ["screensaver_image"] = "/mnt/onboard/screenshots/Reader_2023-02-15_140821.png", + ["screensaver_img_background"] = "black", + ["screensaver_message_position"] = "bottom", + ["screensaver_msg_background"] = "none", + ["screensaver_show_message"] = true, + ["screensaver_stretch_images"] = false, + ["screensaver_type"] = "image_file", + ["screenshot_dir"] = "/mnt/onboard/screenshots/", + ["scroll_method"] = "classic", + ["shorten_home_dir"] = false, + ["show_bottom_menu"] = false, + ["show_hidden"] = true, + ["show_unsupported"] = true, + ["start_with"] = "filemanager", + ["statistics"] = { + ["calendar_browse_future_months"] = false, + ["calendar_nb_book_spans"] = 3, + ["calendar_show_histogram"] = true, + ["calendar_start_day_of_week"] = 2, + ["convert_to_db"] = true, + ["is_enabled"] = true, + ["max_sec"] = 120, + ["min_sec"] = 5, + }, + ["style_tweaks"] = { + ["footnote-inpage_epub_smaller"] = true, + ["footnote-inpage_fb2"] = true, + }, + ["style_tweaks_in_dispatcher"] = {}, + ["terminal_buffer_size"] = 16, + ["terminal_font_size"] = 16, + ["terminal_shell"] = "sh", + ["text_lang_fallback"] = "en-US", + ["toc_items_per_page"] = 14, + ["vocabulary_builder"] = { + ["enabled"] = true, + }, + ["wifi_disable_action"] = "leave_on", + ["wifi_was_on"] = false, +} diff --git a/misc/kobo/settings/gestures.lua b/misc/kobo/settings/gestures.lua new file mode 100644 index 0000000..a15d344 --- /dev/null +++ b/misc/kobo/settings/gestures.lua @@ -0,0 +1,358 @@ +-- we can read Lua syntax here! +return { + ["custom_multiswipes"] = {}, + ["gesture_fm"] = { + ["hold_bottom_left_corner"] = { + ["history"] = true, + ["settings"] = { + ["order"] = { + [1] = "history", + }, + }, + }, + ["hold_bottom_right_corner"] = { + ["settings"] = { + ["order"] = { + [1] = "suspend", + }, + }, + ["suspend"] = true, + }, + ["hold_top_left_corner"] = { + ["exit"] = true, + ["settings"] = { + ["order"] = { + [1] = "exit", + }, + }, + }, + ["hold_top_right_corner"] = { + ["settings"] = { + ["order"] = { + [1] = "terminal", + }, + }, + ["terminal"] = true, + }, + ["multiswipe"] = {}, + ["multiswipe_east_north"] = { + ["history"] = true, + }, + ["multiswipe_east_north_west"] = {}, + ["multiswipe_east_north_west_east"] = {}, + ["multiswipe_east_south"] = { + ["go_to"] = true, + }, + ["multiswipe_east_south_west_north"] = { + ["full_refresh"] = true, + }, + ["multiswipe_east_west"] = {}, + ["multiswipe_east_west_east"] = { + ["favorites"] = true, + }, + ["multiswipe_north_east"] = {}, + ["multiswipe_north_south"] = { + ["folder_up"] = true, + }, + ["multiswipe_north_south_north"] = {}, + ["multiswipe_north_west"] = { + ["folder_shortcuts"] = true, + }, + ["multiswipe_northwest_southwest_northwest"] = { + ["toggle_wifi"] = true, + }, + ["multiswipe_south_east"] = {}, + ["multiswipe_south_east_north"] = {}, + ["multiswipe_south_east_north_south"] = {}, + ["multiswipe_south_north"] = {}, + ["multiswipe_south_north_south"] = {}, + ["multiswipe_south_west"] = { + ["show_frontlight_dialog"] = true, + }, + ["multiswipe_southeast_northeast"] = {}, + ["multiswipe_southeast_northeast_northwest"] = { + ["wifi_on"] = true, + }, + ["multiswipe_southeast_southwest_northwest"] = { + ["wifi_off"] = true, + }, + ["multiswipe_west_east"] = {}, + ["multiswipe_west_east_west"] = { + ["open_previous_document"] = true, + }, + ["multiswipe_west_north"] = {}, + ["multiswipe_west_south"] = { + ["back"] = true, + }, + ["one_finger_swipe_right_edge_down"] = { + ["full_refresh"] = true, + ["settings"] = { + ["order"] = { + [1] = "full_refresh", + }, + }, + }, + ["one_finger_swipe_right_edge_up"] = { + ["full_refresh"] = true, + ["settings"] = { + ["order"] = { + [1] = "full_refresh", + }, + }, + }, + ["pinch_gesture"] = { + ["folder_up"] = true, + ["settings"] = { + ["order"] = { + [1] = "folder_up", + }, + }, + }, + ["short_diagonal_swipe"] = { + ["settings"] = { + ["order"] = { + [1] = "show_menu", + }, + }, + ["show_menu"] = true, + }, + ["spread_gesture"] = { + ["open_previous_document"] = true, + ["settings"] = { + ["order"] = { + [1] = "open_previous_document", + }, + }, + }, + ["tap_left_bottom_corner"] = { + ["settings"] = { + ["order"] = { + [1] = "show_frontlight_dialog", + }, + }, + ["show_frontlight_dialog"] = true, + }, + ["two_finger_swipe_east"] = { + ["settings"] = { + ["order"] = { + [1] = "toggle_wifi", + }, + }, + ["toggle_wifi"] = true, + }, + ["two_finger_swipe_north"] = { + ["settings"] = { + ["order"] = { + [1] = "show_network_info", + }, + }, + ["show_network_info"] = true, + }, + ["two_finger_swipe_south"] = { + ["reboot"] = true, + ["settings"] = { + ["order"] = { + [1] = "reboot", + }, + }, + }, + ["two_finger_swipe_west"] = { + ["settings"] = { + ["order"] = { + [1] = "toggle_ssh_server", + }, + }, + ["toggle_ssh_server"] = true, + }, + }, + ["gesture_reader"] = { + ["double_tap_left_side"] = { + ["page_jmp"] = -10, + }, + ["double_tap_right_side"] = { + ["page_jmp"] = 10, + }, + ["hold_bottom_left_corner"] = { + ["history"] = true, + ["settings"] = { + ["order"] = { + [1] = "history", + }, + }, + }, + ["hold_bottom_right_corner"] = { + ["settings"] = { + ["order"] = { + [1] = "suspend", + }, + }, + ["suspend"] = true, + }, + ["hold_top_left_corner"] = { + ["screenshot"] = true, + ["settings"] = { + ["order"] = { + [1] = "screenshot", + }, + }, + }, + ["hold_top_right_corner"] = { + ["book_info"] = true, + ["settings"] = { + ["order"] = { + [1] = "book_info", + }, + }, + }, + ["multiswipe"] = {}, + ["multiswipe_east_north"] = { + ["history"] = true, + }, + ["multiswipe_east_north_west"] = { + ["zoom"] = "contentwidth", + }, + ["multiswipe_east_north_west_east"] = { + ["zoom"] = "pagewidth", + }, + ["multiswipe_east_south"] = { + ["go_to"] = true, + }, + ["multiswipe_east_south_west_north"] = { + ["full_refresh"] = true, + }, + ["multiswipe_east_west"] = { + ["latest_bookmark"] = true, + }, + ["multiswipe_east_west_east"] = { + ["favorites"] = true, + }, + ["multiswipe_north_east"] = { + ["toc"] = true, + }, + ["multiswipe_north_south"] = {}, + ["multiswipe_north_south_north"] = { + ["prev_chapter"] = true, + }, + ["multiswipe_north_west"] = { + ["bookmarks"] = true, + }, + ["multiswipe_northwest_southwest_northwest"] = { + ["toggle_wifi"] = true, + }, + ["multiswipe_south_east"] = { + ["toggle_reflow"] = true, + }, + ["multiswipe_south_east_north"] = { + ["zoom"] = "contentheight", + }, + ["multiswipe_south_east_north_south"] = { + ["zoom"] = "pageheight", + }, + ["multiswipe_south_north"] = { + ["skim"] = true, + }, + ["multiswipe_south_north_south"] = { + ["next_chapter"] = true, + }, + ["multiswipe_south_west"] = { + ["show_frontlight_dialog"] = true, + }, + ["multiswipe_southeast_northeast"] = { + ["follow_nearest_link"] = true, + }, + ["multiswipe_southeast_northeast_northwest"] = { + ["wifi_on"] = true, + }, + ["multiswipe_southeast_southwest_northwest"] = { + ["wifi_off"] = true, + }, + ["multiswipe_west_east"] = { + ["previous_location"] = true, + }, + ["multiswipe_west_east_west"] = { + ["open_previous_document"] = true, + }, + ["multiswipe_west_north"] = { + ["book_status"] = true, + }, + ["multiswipe_west_south"] = { + ["back"] = true, + }, + ["one_finger_swipe_right_edge_down"] = { + ["page_browser"] = true, + ["settings"] = { + ["order"] = { + [1] = "page_browser", + }, + }, + }, + ["one_finger_swipe_right_edge_up"] = { + ["book_map"] = true, + ["settings"] = { + ["order"] = { + [1] = "book_map", + }, + }, + }, + ["pinch_gesture"] = { + ["filemanager"] = true, + ["settings"] = { + ["order"] = { + [1] = "filemanager", + }, + }, + }, + ["short_diagonal_swipe"] = { + ["settings"] = { + ["order"] = { + [1] = "show_menu", + }, + }, + ["show_menu"] = true, + }, + ["spread_gesture"] = { + ["open_previous_document"] = true, + ["settings"] = { + ["order"] = { + [1] = "open_previous_document", + }, + }, + }, + ["tap_left_bottom_corner"] = { + ["settings"] = { + ["order"] = { + [1] = "show_frontlight_dialog", + }, + }, + ["show_frontlight_dialog"] = true, + }, + ["tap_top_left_corner"] = { + ["toggle_page_flipping"] = true, + }, + ["tap_top_right_corner"] = { + ["toggle_bookmark"] = true, + }, + ["two_finger_swipe_east"] = { + ["toc"] = true, + }, + ["two_finger_swipe_north"] = { + ["settings"] = { + ["order"] = { + [1] = "toggle_gsensor", + }, + }, + ["toggle_gsensor"] = true, + }, + ["two_finger_swipe_south"] = { + ["settings"] = { + ["order"] = { + [1] = "skim", + }, + }, + ["skim"] = true, + }, + ["two_finger_swipe_west"] = { + ["bookmarks"] = true, + }, + }, +} diff --git a/misc/libinput/00-keyboard.conf b/misc/libinput/00-keyboard.conf deleted file mode 100644 index 4aa4ac7..0000000 --- a/misc/libinput/00-keyboard.conf +++ /dev/null @@ -1,9 +0,0 @@ -# Written by systemd-localed(8), read by systemd-localed and Xorg. It's -# probably wise not to edit this file manually. Use localectl(1) to -# instruct systemd-localed to update it. -Section "InputClass" - Identifier "system-keyboard" - MatchIsKeyboard "on" - Option "XkbLayout" "us" - Option "XkbOptions" "ctrl:nocaps" -EndSection diff --git a/misc/libinput/30-touchpad.conf b/misc/libinput/30-touchpad.conf deleted file mode 100644 index b5d4424..0000000 --- a/misc/libinput/30-touchpad.conf +++ /dev/null @@ -1,7 +0,0 @@ -# check ~/.local/share/xorg/Xorg.0.log for device name -Section "InputClass" - Identifier "touchpad" - Driver "libinput" - Option "Tapping" "on" - Option "NaturalScrolling" "on" -EndSection diff --git a/misc/systemd/wakeup.service b/misc/systemd/wakeup.service new file mode 100644 index 0000000..0a292d3 --- /dev/null +++ b/misc/systemd/wakeup.service @@ -0,0 +1,12 @@ +[Unit] +Description=Run my_user_script +After=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target network-online.target +Wants=network-online.target + +[Service] +ExecStart=/home/pham/helper/bin/wakeup.sh +User=pham +Environment=DISPLAY=:0 + +[Install] +WantedBy=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target diff --git a/mpd/ncmpcpp/.gitignore b/mpd/ncmpcpp/.gitignore deleted file mode 100644 index 397b4a7..0000000 --- a/mpd/ncmpcpp/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.log diff --git a/mpd/ncmpcpp/bindings b/mpd/ncmpcpp/bindings deleted file mode 100644 index d035f7f..0000000 --- a/mpd/ncmpcpp/bindings +++ /dev/null @@ -1,46 +0,0 @@ -# the t key isn't used and it's easier to press than /, so lets use it -def_key "t" - find -def_key "t" - find_item_forward - -def_key "+" - show_clock -def_key "=" - volume_up - -def_key "j" - scroll_down -def_key "k" - scroll_up - -def_key "ctrl-u" - page_up -def_key "ctrl-d" - page_down - -def_key "h" - previous_column -def_key "l" - next_column - -def_key "." - show_lyrics - -def_key "n" - next_found_item -def_key "N" - previous_found_item - -def_key "J" - move_sort_order_down -def_key "K" - move_sort_order_up - -def_key "g" - move_home -def_key "G" - move_end - -def_key "0" - replay_song diff --git a/mpd/ncmpcpp/config b/mpd/ncmpcpp/config deleted file mode 100644 index e818015..0000000 --- a/mpd/ncmpcpp/config +++ /dev/null @@ -1,95 +0,0 @@ -## Copyright (C) 2020-2021 Aditya Shakya -## Everyone is permitted to copy and distribute copies of this file under GNU-GPL3 - -### Directories ### -ncmpcpp_directory = ~/.config/ncmpcpp/ -lyrics_directory = ~/.config/ncmpcpp/lyrics -mpd_music_dir = ~/Music -mpd_host = "localhost" -mpd_port = "6600" -mpd_crossfade_time = "2" - -### Script ### -#execute_on_song_change="~/.config/ncmpcpp/scripts/album-art" -#execute_on_song_change = "~/.ncmpcpp/cover_obs.sh" - -### Behaviour ### -message_delay_time = 1 -autocenter_mode = "yes" -centered_cursor = "yes" -ignore_leading_the = "yes" -playlist_disable_highlight_delay = 2 -allow_for_physical_item_deletion = "no" - -### Visualizer ### -#visualizer_data_source = /tmp/mpd.fifo -#visualizer_output_name = "mpd_visualizer" -#visualizer_in_stereo = "yes" -#visualizer_look = " " -visualizer_type = "spectrum" - -### Appearance ### -playlist_display_mode = "columns" -colors_enabled = "yes" -#user_interface = classic -user_interface = alternative -volume_color = "white" - -### Window ### -song_window_title_format = "Music Player" -#song_window_title_format = "{%a - }{%t}|{%f}" -statusbar_visibility = "no" -header_visibility = "no" -titles_visibility = "yes" - -### Progress bar ### -progressbar_look = "▂▂▂" -progressbar_color = "black" -progressbar_elapsed_color = "yellow" - -### Alternative UI ### -alternative_ui_separator_color = "blue" -alternative_header_first_line_format = $b$5$/b $b$8{%t}|{%f}$/b $/b -alternative_header_second_line_format = {$b{$2 %a$9}{ - $7 %b$9}{ ($2%y$9)}}|{%D} - -### Song list ### -song_status_format = "$7%t" -song_list_format = " $4%t$9 $7$R%a$9 $2%l$9 " -song_library_format = {{%a - %t} (%b)}|{%f} -song_columns_list_format = "(35)[blue]{t} (30)[green]{a} (6)[cyan]{lr}" - -### Colors ### -main_window_color = "blue" -state_line_color = "black" -current_item_prefix = "$(blue)$r" -current_item_suffix = "$/r$(end)" -current_item_inactive_column_prefix = red -current_item_inactive_column_suffix = red -now_playing_prefix = "$4 " -selected_item_prefix = "* " - -color1 = "white" -color2 = "red" - -### Layout ### -startup_screen = visualizer -startup_slave_screen = playlist -startup_slave_screen_focus = yes -locked_screen_width_part = 25 - -### Misc ### -default_place_to_search_in = "database" - -display_bitrate = "no" -enable_window_title = "yes" -follow_now_playing_lyrics = "yes" -empty_tag_marker = "" - -cyclic_scrolling = "yes" -header_text_scrolling = "yes" -jump_to_now_playing_song_at_start = "yes" -lines_scrolled = "2" - -system_encoding = "utf-8" -regular_expressions = "extended" - diff --git a/mpd/ncmpcpp/config.bak b/mpd/ncmpcpp/config.bak deleted file mode 100644 index eb3fff6..0000000 --- a/mpd/ncmpcpp/config.bak +++ /dev/null @@ -1,66 +0,0 @@ -## Copyright (C) 2020-2021 Aditya Shakya -## Everyone is permitted to copy and distribute copies of this file under GNU-GPL3 - -### Directories ### -ncmpcpp_directory = ~/.ncmpcpp -lyrics_directory = ~/.ncmpcpp/lyrics -mpd_music_dir = ~/Music -mpd_host = "localhost" -mpd_port = "6600" -mpd_crossfade_time = "2" - -### Script ### -execute_on_song_change = "kunst --size 60x60 --silent" - -### Behaviour ### -message_delay_time = 1 -autocenter_mode = "yes" -centered_cursor = "yes" -ignore_leading_the = "yes" -playlist_disable_highlight_delay = 2 -allow_for_physical_item_deletion = "no" - -### Visualizer ### -visualizer_data_source = /tmp/mpd.fifo -visualizer_output_name = "mpd_visualizer" -visualizer_in_stereo = "yes" -visualizer_look = ●● -visualizer_type = "ellipse" - -### Appearance ### -playlist_display_mode = "columns" -colors_enabled = "yes" -#user_interface = classic -user_interface = alternative -volume_color = "white" - -### Window ### -song_window_title_format = "{%a - }{%t}|{%f}" -statusbar_visibility = "no" -header_visibility = "no" -titles_visibility = "no" - -### Progress bar ### -progressbar_look = "▂▂▂" -progressbar_color = "black" -progressbar_elapsed_color = "yellow" - -### Alternative UI ### -alternative_ui_separator_color = "black" -alternative_header_first_line_format = $b$5$/b $b$8{%t}|{%f}$/b $/b -alternative_header_second_line_format = {$b{$2 %a$9}{ - $7 %b$9}{ ($2%y$9)}}|{%D} - -### Song list ### -song_status_format = "$7%t" -song_list_format = " %t $R%a %l " -song_library_format = {{%a - %t} (%b)}|{%f} -song_columns_list_format = "(53)[white]{tr} (45)[blue]{a}" - -### Colors ### -main_window_color = "blue" -current_item_prefix = "$(blue)$r" -current_item_suffix = "$/r$(end)" -current_item_inactive_column_prefix = red -current_item_inactive_column_suffix = red -color1 = "white" -color2 = "red" diff --git a/mpd/ncmpcpp/cover.sh b/mpd/ncmpcpp/cover.sh deleted file mode 100755 index 8fe8d4d..0000000 --- a/mpd/ncmpcpp/cover.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -source "`ueberzug library`" -COVER="/tmp/album_cover.png" - -function add_cover { - ImageLayer::add [identifier]="img" [x]="2" [y]="1" [path]="$COVER" -} - -ImageLayer 0< <( -if [ ! -f "$COVER" ]; then - cp "$HOME/.ncmpcpp/default_cover.png" "$COVER" -fi -#rerender image when changed -while inotifywait -q -q -e close_write "$COVER"; do - add_cover -done -) diff --git a/mpd/ncmpcpp/cover_obs.sh b/mpd/ncmpcpp/cover_obs.sh deleted file mode 100755 index 032bd08..0000000 --- a/mpd/ncmpcpp/cover_obs.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -COVER="/tmp/album_cover.png" -COVER_SIZE="400" - -#path to current song -file="$MUSIC_DIR/$(mpc --format %file% current)" -album="${file%/*}" -#search for cover image -#use embedded image if present, otherwise take it from the current folder -err=$(ffmpeg -loglevel 16 -y -i "$file" -an -vcodec copy $EMB_COVER 2>&1) -if [ "$err" != "" ]; then - art=$(find "$album" -maxdepth 1 | grep -m 1 ".*\.\(jpg\|png\|gif\|bmp\)") -else - art=$EMB_COVER -fi -if [ "$art" = "" ]; then - art="$HOME/.ncmpcpp/default_cover.png" -fi -#copy and resize image to destination -ffmpeg -loglevel 0 -y -i "$art" -vf "scale=$COVER_SIZE:-1" "$COVER" \ No newline at end of file diff --git a/mpd/ncmpcpp/default_cover.png b/mpd/ncmpcpp/default_cover.png deleted file mode 100644 index c02d40b..0000000 Binary files a/mpd/ncmpcpp/default_cover.png and /dev/null differ diff --git a/mpd/ncmpcpp/scripts/album-art b/mpd/ncmpcpp/scripts/album-art deleted file mode 100755 index d852f34..0000000 --- a/mpd/ncmpcpp/scripts/album-art +++ /dev/null @@ -1,248 +0,0 @@ -#!/usr/bin/env bash - -## Copyright (C) 2020-2021 Aditya Shakya -## Everyone is permitted to copy and distribute copies of this file under GNU-GPL3 - -## Cover art script for ncmpcpp - -# SETTINGS -music_library="$HOME/Music" -padding_top=3 -padding_bottom=0 -padding_right=0 -max_width=40 -reserved_playlist_cols=31 -reserved_cols_in_percent="false" -force_square="true" -square_alignment="top" -left_aligned="true" -padding_left=0 - -# Only set this if the geometries are wrong or ncmpcpp shouts at you to do it. -# Visually select/highlight a character on your terminal, zoom in an image -# editor and count how many pixels a character's width and height are. -font_height= -font_width= - -main() { - kill_previous_instances >/dev/null 2>&1 - find_cover_image >/dev/null 2>&1 - display_cover_image 2>/dev/null - dunstify -u low --replace=69 -i "$cover_path" "$(mpc current)" - detect_window_resizes >/dev/null 2>&1 -} - -# ==== Main functions ========================================================= - -kill_previous_instances() { - script_name=$(basename "$0") - for pid in $(pidof -x "$script_name"); do - if [ "$pid" != $$ ]; then - kill -15 "$pid" - fi - done -} - -find_cover_image() { - - # First we check if the audio file has an embedded album art - ext="$(mpc --format %file% current | sed 's/^.*\.//')" - if [ "$ext" = "flac" ]; then - # since FFMPEG cannot export embedded FLAC art we use metaflac - metaflac --export-picture-to=/tmp/mpd_cover.jpg \ - "$(mpc --format "$music_library"/%file% current)" && - cover_path="/tmp/mpd_cover.jpg" && return - else - ffmpeg -y -i "$(mpc --format "$music_library"/%file% | head -n 1)" \ - /tmp/mpd_cover.jpg && - cover_path="/tmp/mpd_cover.jpg" && return - fi - - # If no embedded art was found we look inside the music file's directory - album="$(mpc --format %album% current)" - file="$(mpc --format %file% current)" - album_dir="${file%/*}" - album_dir="$music_library/$album_dir" - found_covers="$(find "$album_dir" -type d -exec find {} -maxdepth 1 -type f \ - -iregex ".*/.*\(${album}\|cover\|folder\|artwork\|front\).*[.]\\(jpe?g\|png\|gif\|bmp\)" \; )" - cover_path="$(echo "$found_covers" | head -n1)" - if [ -n "$cover_path" ]; then - return - fi - - # If we still failed to find a cover image, we use the fallback - if [ -z "$cover_path" ]; then - cover_path="$HOME/.ncmpcpp/scripts/music.png" - fi -} - -display_cover_image() { - compute_geometry - - send_to_ueberzug \ - action "add" \ - identifier "mpd_cover" \ - path "$cover_path" \ - x "$ueber_left" \ - y "$padding_top" \ - height "$ueber_height" \ - width "$ueber_width" \ - synchronously_draw "True" \ - scaler "forced_cover" \ - scaling_position_x "0.5" -} - -detect_window_resizes() { - { - trap 'display_cover_image' WINCH - while :; do sleep .1; done - } & -} - - -# ==== Helper functions ========================================================= - -compute_geometry() { - unset LINES COLUMNS # Required in order for tput to work in a script - term_lines=$(tput lines) - term_cols=$(tput cols) - if [ -z "$font_height" ] || [ -z "$font_height" ]; then - guess_font_size - fi - - ueber_height=$(( term_lines - padding_top - padding_bottom )) - # Because Ueberzug uses characters as a unit we must multiply - # the line count (height) by the font size ratio in order to - # obtain an equivalent width in column count - ueber_width=$(( ueber_height * font_height / font_width )) - ueber_left=$(( term_cols - ueber_width - padding_right )) - - if [ "$left_aligned" = "true" ]; then - compute_geometry_left_aligned - else - compute_geometry_right_aligned - fi - - apply_force_square_setting -} - -compute_geometry_left_aligned() { - ueber_left=$padding_left - max_width_chars=$(( term_cols * max_width / 100 )) - if [ "$max_width" != 0 ] && - [ $(( ueber_width + padding_right + padding_left )) -gt "$max_width_chars" ]; then - ueber_width=$(( max_width_chars - padding_left - padding_right )) - fi -} - -compute_geometry_right_aligned() { - if [ "$reserved_cols_in_percent" = "true" ]; then - ueber_left_percent=$(printf "%.0f\n" $(calc "$ueber_left" / "$term_cols" '*' 100)) - if [ "$ueber_left_percent" -lt "$reserved_playlist_cols" ]; then - ueber_left=$(( term_cols * reserved_playlist_cols / 100 )) - ueber_width=$(( term_cols - ueber_left - padding_right )) - fi - else - if [ "$ueber_left" -lt "$reserved_playlist_cols" ]; then - ueber_left=$reserved_playlist_cols - ueber_width=$(( term_cols - ueber_left - padding_right )) - fi - - fi - - if [ "$max_width" != 0 ] && [ "$ueber_width" -gt "$max_width" ]; then - ueber_width=$max_width - ueber_left=$(( term_cols - ueber_width - padding_right )) - fi -} - -apply_force_square_setting() { - if [ $force_square = "true" ]; then - ueber_height=$(( ueber_width * font_width / font_height )) - case "$square_alignment" in - center) - area=$(( term_lines - padding_top - padding_bottom )) - padding_top=$(( padding_top + area / 2 - ueber_height / 2 )) - ;; - bottom) - padding_top=$(( term_lines - padding_bottom - ueber_height )) - ;; - *) ;; - esac - fi -} - -guess_font_size() { - # A font width and height estimate is required to - # properly compute the cover width (in columns). - # We are reproducing the arithmetic used by Ueberzug - # to guess font size. - # https://github.com/seebye/ueberzug/blob/master/ueberzug/terminal.py#L24 - - guess_terminal_pixelsize - - approx_font_width=$(( term_width / term_cols )) - approx_font_height=$(( term_height / term_lines )) - - term_xpadding=$(( ( - approx_font_width * term_cols + term_width ) / 2 )) - term_ypadding=$(( ( - approx_font_height * term_lines + term_height ) / 2 )) - - font_width=$(( (term_width - 2 * term_xpadding) / term_cols )) - font_height=$(( (term_height - 2 * term_ypadding) / term_lines )) -} - -guess_terminal_pixelsize() { - # We are re-using the same Python snippet that - # Ueberzug utilizes to retrieve terminal window size. - # https://github.com/seebye/ueberzug/blob/master/ueberzug/terminal.py#L10 - - python < "$FIFO_UEBERZUG" - - IFS=${old_IFS} -} - -main diff --git a/mpd/ncmpcpp/scripts/music.png b/mpd/ncmpcpp/scripts/music.png deleted file mode 100644 index 3ded333..0000000 Binary files a/mpd/ncmpcpp/scripts/music.png and /dev/null differ diff --git a/mpd/ncmpcpp/scripts/ncmpcpp-art b/mpd/ncmpcpp/scripts/ncmpcpp-art deleted file mode 100755 index 38d34c1..0000000 --- a/mpd/ncmpcpp/scripts/ncmpcpp-art +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -## Copyright (C) 2020-2021 Aditya Shakya -## Everyone is permitted to copy and distribute copies of this file under GNU-GPL3 - -export FIFO_UEBERZUG="/tmp/mpd-ueberzug-${PPID}" - -cleanup() { - rm "$FIFO_UEBERZUG" 2>/dev/null - rm /tmp/mpd_cover.jpg 2>/dev/null - pkill -P $$ 2>/dev/null - pkill album-art -} - -pkill -P $$ 2>/dev/null -rm "$FIFO_UEBERZUG" 2>/dev/null -mkfifo "$FIFO_UEBERZUG" >/dev/null -trap cleanup EXIT 2>/dev/null -tail --follow "$FIFO_UEBERZUG" | ueberzug layer --silent --parser simple >/dev/null 2>&1 & - -ncmpcpp -c ~/.ncmpcpp/config-art -cleanup diff --git a/mpd/ncmpcpp/tsession b/mpd/ncmpcpp/tsession deleted file mode 100644 index e34d4b8..0000000 --- a/mpd/ncmpcpp/tsession +++ /dev/null @@ -1,32 +0,0 @@ -neww -set -g status off - -#image pane; run cover script, disable text output and remove prompt -send-keys "stty -echo" C-m -send-keys "tput civis -- invisible" C-m -send-keys "export PS1=''" C-m -send-keys "clear" C-m -send-keys "~/.ncmpcpp/cover.sh " C-m - -#catalog pane; run instance of ncmpcpp -split-window -v -select-pane -t 1 -send-keys "ncmpcpp --config='~/.ncmpcpp/catalog.conf'" C-m -send-keys 1 - -#visualizer pane; run instance of ncmpcpp in visualizer mode -select-pane -t 0 -split-window -h -send-keys "ncmpcpp --config='~/.ncmpcpp/visualizer.conf'" C-m -send-keys 8 -send-keys u - -#resize image and visualizer pane to fit image -resize-pane -t 0 -x 49 -y 23 -resize-pane -t 1 -y 23 - -#hook for keeping the image pane size constant -set-hook client-resized 'resize-pane -t 0 -x 49 -y 23' - -#focus on catalog pane -select-pane -t 2 \ No newline at end of file diff --git a/systemd/wakeup.service b/systemd/wakeup.service deleted file mode 100644 index 0a292d3..0000000 --- a/systemd/wakeup.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Run my_user_script -After=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target network-online.target -Wants=network-online.target - -[Service] -ExecStart=/home/pham/helper/bin/wakeup.sh -User=pham -Environment=DISPLAY=:0 - -[Install] -WantedBy=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target diff --git a/web/stylelint.config.json b/web/stylelint.config.json deleted file mode 100644 index dd59e54..0000000 --- a/web/stylelint.config.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "extends": [ - "stylelint-config-clean-order" - ] -} diff --git a/xorg/09-custom-kbd.conf b/xorg/09-custom-kbd.conf deleted file mode 100644 index f2123ff..0000000 --- a/xorg/09-custom-kbd.conf +++ /dev/null @@ -1,6 +0,0 @@ -Section "InputClass" - Identifier "keyboard defaults" - MatchIsKeyboard "on" - - Option "XKbOptions" "ctrl:nocaps" -EndSection -- cgit v1.2.3-70-g09d2