diff options
| -rw-r--r-- | .bmdirs | 1 | ||||
| -rw-r--r-- | .config/i3/config | 16 | ||||
| -rw-r--r-- | .config/i3blocks/config | 38 | ||||
| -rw-r--r-- | .config/mimeapps.list | 1 | ||||
| -rw-r--r-- | .config/newsboat/urls | 1 | ||||
| -rwxr-xr-x | .config/ranger/scope.sh | 2 | ||||
| -rw-r--r-- | .local/share/applications/gif.desktop | 4 | ||||
| -rw-r--r-- | .profile | 7 | ||||
| -rw-r--r-- | .readme.mom | 8 | ||||
| -rwxr-xr-x | .scripts/cron/newsup | 12 | ||||
| -rwxr-xr-x | .scripts/i3cmds/displayselect | 2 | ||||
| -rwxr-xr-x | .scripts/i3cmds/samedir | 30 | ||||
| -rwxr-xr-x | .scripts/i3cmds/showclip | 4 | ||||
| -rwxr-xr-x | .scripts/i3cmds/td-toggle | 2 | ||||
| -rwxr-xr-x | .scripts/i3cmds/tutorialvids | 18 | ||||
| -rwxr-xr-x | .scripts/statusbar/battery (renamed from .scripts/statusbar/i3battery) | 21 | ||||
| -rwxr-xr-x | .scripts/statusbar/clock (renamed from .scripts/statusbar/i3date) | 0 | ||||
| -rwxr-xr-x | .scripts/statusbar/cpu (renamed from .scripts/statusbar/i3cpu) | 2 | ||||
| -rwxr-xr-x | .scripts/statusbar/disk (renamed from .scripts/statusbar/i3disk) | 0 | ||||
| -rwxr-xr-x | .scripts/statusbar/help (renamed from .scripts/statusbar/i3help) | 0 | ||||
| -rwxr-xr-x | .scripts/statusbar/i3mpdupdate | 9 | ||||
| -rwxr-xr-x | .scripts/statusbar/i3torrent | 6 | ||||
| -rwxr-xr-x | .scripts/statusbar/internet (renamed from .scripts/statusbar/i3internet) | 0 | ||||
| -rwxr-xr-x | .scripts/statusbar/mailbox (renamed from .scripts/statusbar/i3mail) | 0 | ||||
| -rwxr-xr-x | .scripts/statusbar/memory (renamed from .scripts/statusbar/i3mem) | 0 | ||||
| -rwxr-xr-x | .scripts/statusbar/music (renamed from .scripts/statusbar/i3mpd) | 0 | ||||
| -rwxr-xr-x | .scripts/statusbar/news (renamed from .scripts/statusbar/i3news) | 4 | ||||
| -rwxr-xr-x | .scripts/statusbar/pacpackages (renamed from .scripts/statusbar/i3pacman) | 0 | ||||
| -rwxr-xr-x | .scripts/statusbar/torrent | 26 | ||||
| -rwxr-xr-x | .scripts/statusbar/volume (renamed from .scripts/statusbar/i3volume) | 0 | ||||
| -rwxr-xr-x | .scripts/statusbar/weather (renamed from .scripts/statusbar/i3weather) | 0 | ||||
| -rwxr-xr-x | .scripts/tools/dmenupass | 2 | ||||
| -rwxr-xr-x | .scripts/tools/lmc | 13 | ||||
| -rwxr-xr-x | .scripts/tools/podentr | 6 | ||||
| -rwxr-xr-x | .scripts/tools/queueandnotify | 18 | ||||
| -rw-r--r-- | .vimrc | 11 |
36 files changed, 134 insertions, 130 deletions
@@ -8,4 +8,3 @@ vv ~/Videos cf ~/.config sc ~/.scripts mn /mnt -e /etc diff --git a/.config/i3/config b/.config/i3/config index 78a4a19..e63e4c6 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -60,9 +60,11 @@ exec --no-startup-id remaps # Unclutter makes the mouse invisible after a brief period exec --no-startup-id unclutter # Run the script to update the mpd i3block on change. -exec --no-startup-id i3mpdupdate +exec_always --no-startup-id mpdupdate # mpd startup exec --no-startup-id mpd +# Podboat automatic queue and download +exec_always --no-startup-id podentr # Set Xresources colors: set_from_resource $darkblack color0 #000000 @@ -124,7 +126,7 @@ bindsym $mod+grave exec --no-startup-id dmenuunicode ##bindsym $mod+asciitilde #STOP/HIDE EVERYTHING: -bindsym $mod+Shift+Delete exec --no-startup-id lmc truemute ; exec $truepause ; exec --no-startup-id pauseallmpv; workspace 0; exec $term -e htop ; exec $term -e ranger +bindsym $mod+Shift+Delete exec --no-startup-id lmc truemute ; exec --no-startup-id lmc pause ; exec --no-startup-id pauseallmpv; workspace 0; exec $term -e htop ; exec $term -e ranger # Show selection: bindsym $mod+Insert exec --no-startup-id showclip @@ -198,17 +200,17 @@ bindsym $mod+Shift+z gaps outer current minus 5 bindsym $mod+x exec --no-startup-id lockscreen bindsym $mod+Shift+x exec --no-startup-id prompt "Shutdown computer?" "$shutdown" -#bindsym $mod+c +#bindsym $mod+c bindsym $mod+Shift+c exec --no-startup-id camtoggle -#bindsym $mod+v -#bindsym $mod+Shift+v +#bindsym $mod+v +#bindsym $mod+Shift+v bindsym $mod+b bar mode toggle bindsym $mod+Shift+b floating toggle; sticky toggle; exec --no-startup-id bottomleft bindsym $mod+n exec $term -e newsboat && pkill -RTMIN+6 i3blocks -##bindsym $mod+Shift+n +bindsym $mod+Shift+n floating toggle; sticky toggle; exec --no-startup-id bottomright bindsym $mod+m exec --no-startup-id $term -e ncmpcpp bindsym $mod+Shift+m exec --no-startup-id lmc mute @@ -331,7 +333,7 @@ bindsym Shift+Print exec --no-startup-id scrot -u bindsym $mod+Print exec --no-startup-id dmenurecord bindsym $mod+Scroll_Lock exec --no-startup-id "killall screenkey || screenkey" bindsym $mod+Delete exec $stoprec -bindsym XF86Launch1 exec $stoprec & xset dpms force off +bindsym XF86Launch1 exec --no-startup-id xset dpms force off # #---Extra XF86 Keys---# # # These are the extra media keys that some keyboards have. diff --git a/.config/i3blocks/config b/.config/i3blocks/config index 8758f2e..fbfb938 100644 --- a/.config/i3blocks/config +++ b/.config/i3blocks/config @@ -1,4 +1,4 @@ -command=/usr/lib/i3blocks/$BLOCK_NAME +command=~/.scripts/statusbar/$BLOCK_NAME separator_block_width=15 markup=pango @@ -7,79 +7,63 @@ command=cat ~/.recordingicon interval=once signal=9 -[mpd] +[music] label=🎼 -command=i3mpd interval=once signal=11 [news] label=📰 -command=i3news interval=once signal=6 -[pacman] +[pacpackages] label=📦 -command=i3pacman interval=once signal=8 -[torrents] -command=i3torrent +[torrent] interval=20 signal=7 [weather] -command=i3weather interval=3600 -[mail] +[mailbox] label=📬 -command=i3mail interval=180 signal=12 #[memory] -#command=i3mem #interval=30 #label=🧠 #[cpu] -#command=i3cpu #interval=15 #label=💻 [volume] interval=once -command=i3volume signal=10 -#[diskspace] +#[disk] #interval=60 -#command=i3disk / +#command=disk / -#[diskspace] +#[disk] #interval=60 -#command=i3disk /home 🏠 +#command=disk /home 🏠 [battery] -command=i3battery BAT1 +command=battery BAT0 interval=5 -[battery] -command=i3battery BAT0 -interval=5 - -[time] +[clock] label=📅 -command=i3date interval=30 [internet] -command=i3internet interval=10 [help] -command=i3help interval=once diff --git a/.config/mimeapps.list b/.config/mimeapps.list index 43bf715..fa9bdb1 100644 --- a/.config/mimeapps.list +++ b/.config/mimeapps.list @@ -5,3 +5,4 @@ text/plain=vim.desktop; application/pdf=zathura.desktop; image/png=feh.desktop; image/jpeg=feh.desktop; +image/gif=gif.desktop; diff --git a/.config/newsboat/urls b/.config/newsboat/urls index 7e26775..d651459 100644 --- a/.config/newsboat/urls +++ b/.config/newsboat/urls @@ -1,3 +1,4 @@ http://lukesmith.xyz/rss.xml +https://notrelated.libsyn.com/rss https://www.youtube.com/feeds/videos.xml?channel_id=UC2eYFnH61tmytImy1mTYvhA "~Luke Smith (YouTube)" https://www.archlinux.org/feeds/news/ "tech" diff --git a/.config/ranger/scope.sh b/.config/ranger/scope.sh index feef291..cce86cf 100755 --- a/.config/ranger/scope.sh +++ b/.config/ranger/scope.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash # ranger supports enhanced previews. If the option "use_preview_script" # is set to True and this file exists, this script will be called and its # output is displayed in ranger. ANSI color codes are supported. diff --git a/.local/share/applications/gif.desktop b/.local/share/applications/gif.desktop new file mode 100644 index 0000000..366fd94 --- /dev/null +++ b/.local/share/applications/gif.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Type=Application +Name=Animated gif handler +Exec=/usr/bin/mpv --loop %u @@ -1,8 +1,8 @@ -#!/bin/sh +#!/bin/bash # Profile file. Runs on login. # Adds `~/.scripts` and all subdirectories to $PATH -export PATH="$(du $HOME/.scripts/ | cut -f2 | tr '\n' ':')$PATH" +export PATH="$(du "$HOME/.scripts/" | cut -f2 | tr '\n' ':')$PATH" export EDITOR="vim" export TERMINAL="st" export BROWSER="firefox" @@ -11,6 +11,7 @@ export BIB="$HOME/Documents/LaTeX/uni.bib" export REFER="$HOME/.referbib" # PIX is here I have LARBS keep icons. Subject to change, hence a variable. export PIX="$HOME/.scripts/pix" +export SUDO_ASKPASS="$HOME/.scripts/tools/dmenupass" # less/man colors export LESS=-R @@ -24,7 +25,7 @@ export LESS_TERMCAP_ue=$'\E[0m' # reset underline [ ! -f ~/.shortcuts ] && shortcuts >/dev/null 2>&1 -[ -f ~/.bashrc ] && source ~/.bashrc +[ -f ~/.bashrc ] && source "$HOME/.bashrc" # Start graphical server if i3 not already running. [ "$(tty)" = "/dev/tty1" ] && ! pgrep -x i3 >/dev/null && exec startx diff --git a/.readme.mom b/.readme.mom index 06e8b3b..37aa7cc 100644 --- a/.readme.mom +++ b/.readme.mom @@ -68,9 +68,6 @@ but you can also hold it down and it will act as another Windows/super/mod key. .ITEM The menu button (usually between the right Alt and Ctrl) is an alternative Super/Mod button. This is to make one-handing on laptops easier. -.ITEM -The system also uses the US International keyboard by default. -This allows you to type a lot of characters in many different European languages. .LIST OFF .PP If you'd like to change any of these keyboard changes, you need only open and change \f(CW~/.scripts/tools/remaps\fP. @@ -153,8 +150,9 @@ To type capital letters, hold down the \f(CWShift\fP key\(emthat might sound lik .ITEM \f(CWMod+b\fP \(en Toggle status bar .ITEM -\f(CWMod+B\fP \(en Make window float in bottom left corner (good for video watched - intermittently) +\f(CWMod+B\fP \(en Toggle window float in bottom left corner (good for video watched intermittently) +.ITEM +\f(CWMod+N\fP \(en Same as above, but for the botttom right corner. .LIST OFF .HEADING 2 "Basic Programs" .PP diff --git a/.scripts/cron/newsup b/.scripts/cron/newsup index 81c9b01..598cced 100755 --- a/.scripts/cron/newsup +++ b/.scripts/cron/newsup @@ -1,18 +1,16 @@ #!/bin/sh - # Set as a cron job to check for new RSS entries for newsboat. -# Note that newsboat cannot be opened during the sync and this -# sync cannot run while another instance of newsboat is open. +# If newsboat is open, sends it an "R" key to refresh. ping -q -t 1 -c 1 `ip r | grep -m 1 default | cut -d ' ' -f 3` >/dev/null || exit -note "Updating RSS feeds..." "$PIX/rss.gif" +/usr/bin/notify-send -i "$PIX/rss.gif" "Updating RSS feeds..." + +pgrep -x newsboat >/dev/null && /usr/bin/xdotool key --window "$(/usr/bin/xdotool search --name newsboat)" R && exit echo 🔃 > ~/.config/newsboat/.update pkill -RTMIN+6 i3blocks - /usr/bin/newsboat -x reload rm -f ~/.config/newsboat/.update pkill -RTMIN+6 i3blocks - -note "RSS feed update complete." "$PIX/rss.gif" +/usr/bin/notify-send -i "$PIX/rss.gif" "RSS feed update complete." diff --git a/.scripts/i3cmds/displayselect b/.scripts/i3cmds/displayselect index a8cf2f5..c9a2bd9 100755 --- a/.scripts/i3cmds/displayselect +++ b/.scripts/i3cmds/displayselect @@ -45,3 +45,5 @@ esac feh --bg-scale "$HOME/.config/wall.png" # Re-remap keys if keyboard added (for laptop bases) remaps +# Restart dunst to ensure proper location on screen +pgrep -x dunst >/dev/null && killall dunst && setsid dunst & diff --git a/.scripts/i3cmds/samedir b/.scripts/i3cmds/samedir index 7d65838..88845fc 100755 --- a/.scripts/i3cmds/samedir +++ b/.scripts/i3cmds/samedir @@ -1,27 +1,5 @@ #!/bin/sh -# i3 thread: https://faq.i3wm.org/question/150/how-to-launch-a-terminal-from-here/?answer=152#post-id-152 - -CMD=$TERMINAL -CWD='' - -# Get window ID -ID=$(xdpyinfo | grep focus | cut -f4 -d " ") - -# Get PID of process whose window this is -PID=$(xprop -id "$ID" | grep -m 1 PID | cut -d " " -f 3) - -# Get last child process (shell, vim, etc) -if [ -n "$PID" ]; then - TREE=$(pstree -lpA "$PID" | tail -n 1) - PID=$(echo "$TREE" | awk -F'---' '{print $NF}' | sed -re 's/[^0-9]//g') - - # If we find the working directory, run the command in that directory - if [ -e "/proc/$PID/cwd" ]; then - CWD=$(readlink /proc/"$PID"/cwd) - fi -fi -if [ -n "$CWD" ]; then - cd "$CWD" && "$CMD" -else - "$CMD" -fi +PID=$(xprop -id "$(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}')" | grep -m 1 PID | cut -d " " -f 3) +PID=$(echo "$(pstree -lpA "$PID" | tail -n 1)" | awk -F'---' '{print $NF}' | sed -re 's/[^0-9]//g') +cd "$(readlink /proc/"$PID"/cwd)" +"$TERMINAL" diff --git a/.scripts/i3cmds/showclip b/.scripts/i3cmds/showclip index 7b3aeee..5764487 100755 --- a/.scripts/i3cmds/showclip +++ b/.scripts/i3cmds/showclip @@ -10,6 +10,6 @@ clip=$(xclip -o -selection clipboard) prim=$(xclip -o -selection primary) [ "$prim" != "" ] && notify-send "<b>Clipboard:</b> -$prim" -[ "$clip" != "" ] && notify-send "<b>Primary:</b> $clip" +[ "$clip" != "" ] && notify-send "<b>Primary:</b> +$prim" diff --git a/.scripts/i3cmds/td-toggle b/.scripts/i3cmds/td-toggle index 4eb6652..6489626 100755 --- a/.scripts/i3cmds/td-toggle +++ b/.scripts/i3cmds/td-toggle @@ -2,7 +2,7 @@ # If transmission-daemon is running, will ask to kill, else will ask to start. -[ ! -f /usr/bin/transmission-daemon ] && echo "Transmission not installed." && exit +[ ! -f /usr/bin/transmission-daemon ] && notify-send "Transmission daemon not installed." && exit if pgrep -x transmission-da >/dev/null ; then diff --git a/.scripts/i3cmds/tutorialvids b/.scripts/i3cmds/tutorialvids index d5fee01..2743bfc 100755 --- a/.scripts/i3cmds/tutorialvids +++ b/.scripts/i3cmds/tutorialvids @@ -2,17 +2,17 @@ vidlist=" status bar https://www.youtube.com/watch?v=gKumet6b-WY feh -i3 -mutt https://www.youtube.com/watch?v=2U3vRbF7v5A -ncmpcpp https://www.youtube.com/watch?v=sZIEdI9TS2U -newsboat https://www.youtube.com/watch?v=dUFCRqs822w -ranger https://www.youtube.com/watch?v=L6Vu7WPkoJo -zathura https://www.youtube.com/watch?v=V_Iz4zdyRM4 +st (terminal) https://www.youtube.com/watch?v=9H75enWM22k +i3 (window manager) https://www.youtube.com/watch?v=GKviflL9XeI +mutt (email) https://www.youtube.com/watch?v=2U3vRbF7v5A +ncmpcpp (music player) https://www.youtube.com/watch?v=sZIEdI9TS2U +newsboat (RSS reader) https://www.youtube.com/watch?v=dUFCRqs822w +ranger (file manager) https://www.youtube.com/watch?v=L6Vu7WPkoJo +zathura (pdf viewer) https://www.youtube.com/watch?v=V_Iz4zdyRM4 gpg keys https://www.youtube.com/watch?v=DMGIlj7u7Eo -calcurse https://www.youtube.com/watch?v=hvc-pHjbhdE +calcurse (calendar) https://www.youtube.com/watch?v=hvc-pHjbhdE urlview https://www.youtube.com/watch?v=IgzpAjFgbCw colorschemes with pywal https://www.youtube.com/watch?v=Es79N_9BblE vi mode in shell https://www.youtube.com/watch?v=GqoJQft5R2E " - -mpv "$(echo "$vidlist" | grep -P "^$(echo "$vidlist" | grep "https:" | sed 's/\t.*//g' | dmenu -i -p "Learn about what? (ESC to cancel)" -l 5)\\t" | sed 's/.*\t//')" +mpv "$(echo "$vidlist" | grep -P "^$(echo "$vidlist" | grep "https:" | sed 's/\t.*//g' | dmenu -i -p "Learn about what? (ESC to cancel)" -l 5 | awk '{print $1}')\s" | sed 's/.*\t//')" diff --git a/.scripts/statusbar/i3battery b/.scripts/statusbar/battery index b485d9a..b2634e6 100755 --- a/.scripts/statusbar/i3battery +++ b/.scripts/statusbar/battery @@ -1,6 +1,9 @@ #!/bin/sh # Give a battery name (e.g. BAT0) as an argument. +# get xresources colors +for x in "$(xrdb -query | sed "s/.*\./export /g;s/:\s*/=\"/g;s/$/\"/g")"; do eval "$x"; done + case $BLOCK_BUTTON in 3) pgrep -x dunst >/dev/null && notify-send "<b>🔋 Battery module:</b> 🔋: discharging @@ -14,21 +17,19 @@ esac capacity=$(cat /sys/class/power_supply/"$1"/capacity) || exit status=$(cat /sys/class/power_supply/"$1"/status) -if [ "$capacity" -ge 80 ]; then - color="#b8bb26" -elif [ "$capacity" -ge 60 ]; then - color="#ebdbb2" -elif [ "$capacity" -ge 40 ]; then - color="#fabd2f" -elif [ "$capacity" -ge 20 ]; then - color="#fe8019" +if [ "$capacity" -ge 75 ]; then + color="$color10" +elif [ "$capacity" -ge 50 ]; then + color="$color15" +elif [ "$capacity" -ge 25 ]; then + color="$color11" else - color="#fb4934" + color="$color9" warn="❗" fi [ -z $warn ] && warn=" " -[ "$status" = "Charging" ] && color="#FFF" +[ "$status" = "Charging" ] && color="$color15" printf "<span color='%s'>%s%s%s</span>" "$color" "$(echo "$status" | sed -e "s/,//g;s/Discharging/🔋/;s/Charging/🔌/;s/Unknown/♻️/;s/Full/⚡/;s/ 0*/ /g;s/ :/ /g")" "$warn" "$(echo "$capacity" | sed -e 's/$/%/')" diff --git a/.scripts/statusbar/i3date b/.scripts/statusbar/clock index caed51a..caed51a 100755 --- a/.scripts/statusbar/i3date +++ b/.scripts/statusbar/clock diff --git a/.scripts/statusbar/i3cpu b/.scripts/statusbar/cpu index 7dbdc1f..fc9d617 100755 --- a/.scripts/statusbar/i3cpu +++ b/.scripts/statusbar/cpu @@ -9,4 +9,4 @@ $(ps axch -o cmd:15,%cpu --sort=-%cpu | head)" ;; - % is of single core." ;; esac -sensors | awk '/^temp1/ {print $2}' +sensors | awk '/Core 0/ {print $3}' diff --git a/.scripts/statusbar/i3disk b/.scripts/statusbar/disk index 3a12394..3a12394 100755 --- a/.scripts/statusbar/i3disk +++ b/.scripts/statusbar/disk diff --git a/.scripts/statusbar/i3help b/.scripts/statusbar/help index eacb15b..eacb15b 100755 --- a/.scripts/statusbar/i3help +++ b/.scripts/statusbar/help diff --git a/.scripts/statusbar/i3mpdupdate b/.scripts/statusbar/i3mpdupdate deleted file mode 100755 index 646b49e..0000000 --- a/.scripts/statusbar/i3mpdupdate +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -[ "$(pgrep -x i3mpdupdate | wc -l)" -gt 2 ] && exit - -while : ; do - pgrep -x mpd || exit - mpc idle > /dev/null - pkill -RTMIN+11 i3blocks ; -done diff --git a/.scripts/statusbar/i3torrent b/.scripts/statusbar/i3torrent deleted file mode 100755 index 603ff01..0000000 --- a/.scripts/statusbar/i3torrent +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -case $BLOCK_BUTTON in - 1) $TERMINAL -e transmission-remote-cli -esac - -transmission-remote -l | grep % | sed -e "s/.*100%.*/Z/g;s/.*Idle.*/A/g;s/.*%.*/M/g" | sort -h | uniq -c | sed -e "s/Z/🌱/g;s/M/⬇️/g;s/A/⌛️/g" | awk '{print $2, $1}' | tr '\n' ' ' | sed -e "s/ $//g" diff --git a/.scripts/statusbar/i3internet b/.scripts/statusbar/internet index e26e633..e26e633 100755 --- a/.scripts/statusbar/i3internet +++ b/.scripts/statusbar/internet diff --git a/.scripts/statusbar/i3mail b/.scripts/statusbar/mailbox index bb72c5d..bb72c5d 100755 --- a/.scripts/statusbar/i3mail +++ b/.scripts/statusbar/mailbox diff --git a/.scripts/statusbar/i3mem b/.scripts/statusbar/memory index 40705c4..40705c4 100755 --- a/.scripts/statusbar/i3mem +++ b/.scripts/statusbar/memory diff --git a/.scripts/statusbar/i3mpd b/.scripts/statusbar/music index ef3a6c3..ef3a6c3 100755 --- a/.scripts/statusbar/i3mpd +++ b/.scripts/statusbar/music diff --git a/.scripts/statusbar/i3news b/.scripts/statusbar/news index 9a036f5..3c471a0 100755 --- a/.scripts/statusbar/i3news +++ b/.scripts/statusbar/news @@ -6,7 +6,7 @@ case $BLOCK_BUTTON in 1) setsid "$TERMINAL" -e newsboat ;; - 2) setsid newsup >/dev/null ;; + 2) setsid newsup >/dev/null & exit ;; 3) pgrep -x dunst >/dev/null && notify-send "<b>📰 News module:</b> - Shows unread news items - Shows 🔃 if updating with \`newsup\` @@ -15,4 +15,4 @@ case $BLOCK_BUTTON in <b>Note:</b> Only one instance of newsboat (including updates) may be running at a time." ;; esac -echo "$(newsboat -x print-unread | awk '{ print $1}' | sed s/^0$//g)$(cat ~/.config/newsboat/.update 2>/dev/null)" + cat ~/.config/newsboat/.update 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ print $1}' | sed s/^0$//g)$(cat ~/.config/newsboat/.update 2>/dev/null)" diff --git a/.scripts/statusbar/i3pacman b/.scripts/statusbar/pacpackages index 1207e2c..1207e2c 100755 --- a/.scripts/statusbar/i3pacman +++ b/.scripts/statusbar/pacpackages diff --git a/.scripts/statusbar/torrent b/.scripts/statusbar/torrent new file mode 100755 index 0000000..06ddd3e --- /dev/null +++ b/.scripts/statusbar/torrent @@ -0,0 +1,26 @@ +#!/bin/sh + +transmission-remote -l | grep % | + sed " # This first sed command is to ensure a desirable order with sort + s/.*Stopped.*/A/g; + s/.*Seeding.*/Z/g; + s/.*100%.*/N/g; + s/.*Idle.*/B/g; + s/.*%.*/M/g" | + sort -h | uniq -c | sed " # Now we replace the standin letters with icons. + s/A/🛑/g; + s/B/⌛️/g; + s/M/🔽/g; + s/N/✅/g; + s/Z/🌱/g" | awk '{print $2, $1}' | tr '\n' ' ' | sed -e "s/ $//g" + +case $BLOCK_BUTTON in + 1) $TERMINAL -e transmission-remote-cli ;; + 3) pgrep -x dunst >/dev/null && notify-send "<b>Torrent module:</b> +🛑: paused +⏳: waiting +🔽: downloading +✅: done +🌱: done and seeding" ;; +esac + diff --git a/.scripts/statusbar/i3volume b/.scripts/statusbar/volume index 26e5a17..26e5a17 100755 --- a/.scripts/statusbar/i3volume +++ b/.scripts/statusbar/volume diff --git a/.scripts/statusbar/i3weather b/.scripts/statusbar/weather index a6c8d75..a6c8d75 100755 --- a/.scripts/statusbar/i3weather +++ b/.scripts/statusbar/weather diff --git a/.scripts/tools/dmenupass b/.scripts/tools/dmenupass new file mode 100755 index 0000000..4fc464f --- /dev/null +++ b/.scripts/tools/dmenupass @@ -0,0 +1,2 @@ +#!/bin/sh +dmenu -fn Monospace-18 -sb "#d79921" -sf "#1d2021" -nf "#000000" -nb "#000000" -p "$1" <&- && echo diff --git a/.scripts/tools/lmc b/.scripts/tools/lmc index 45cfcd9..18cf2c2 100755 --- a/.scripts/tools/lmc +++ b/.scripts/tools/lmc @@ -1,16 +1,13 @@ #!/bin/sh - # A general audio interface for LARBS. -newvol="pkill -RTMIN+10 i3blocks" - [ -z "$2" ] && num="2" || num="$2" case "$1" in - u*) pulsemixer --change-volume +"$num" ; $newvol ;; - d*) pulsemixer --change-volume -"$num" ; $newvol ;; - m*) pulsemixer --toggle-mute ; $newvol ;; - truemute) pulsemixer --mute ; $newvol ;; + u*) pulsemixer --change-volume +"$num" ;; + d*) pulsemixer --change-volume -"$num" ;; + m*) pulsemixer --toggle-mute ;; + truemute) pulsemixer --mute ;; play) mpc play ;; n*) mpc next ;; prev) mpc prev ;; @@ -41,3 +38,5 @@ All of these commands, except for \`truemute\`, \`prev\` and \`play\` can be tru i.e. \`lmc r\` for \`lmc restart\`. EOF esac + +pkill -RTMIN+10 i3blocks diff --git a/.scripts/tools/podentr b/.scripts/tools/podentr new file mode 100755 index 0000000..13ab4a8 --- /dev/null +++ b/.scripts/tools/podentr @@ -0,0 +1,6 @@ +#!/bin/sh +# entr command to run `queueandnotify` when newsboat queue is changed + +[ "$(pgrep -x $(basename $0) | wc -l)" -gt 2 ] && exit + +echo ~/.local/share/newsboat/queue | entr -p queueandnotify 2>/dev/null diff --git a/.scripts/tools/queueandnotify b/.scripts/tools/queueandnotify new file mode 100755 index 0000000..332668f --- /dev/null +++ b/.scripts/tools/queueandnotify @@ -0,0 +1,18 @@ +#!/bin/sh +# Podboat sucks. This script replaces it. +# It reads the newsboat queue, queuing downloads with taskspooler. +# It also removes the junk from extentions. +queuefile="$HOME/.local/share/newsboat/queue" + +while read -r line; do + [ -z "$line" ] && continue + url="$(echo "$line" | awk '{print $1}')" + base="$(basename "$url")" + notify-send -i "$PIX/dl.png" "Queuing $base..." + idnum="$(tsp curl -LO "$url")" + realname="$(echo "$base" | sed "s/?\(source\|dest\).*//;s/%20/ /g")" + tsp -D "$idnum" mv "$base" "$realname" + tsp -D "$idnum" notify-send -i "$PIX/check.png" "$realname done." +done < "$queuefile" + +echo > "$queuefile" @@ -69,11 +69,11 @@ call plug#end() autocmd BufRead,BufNewFile *.md set tw=79 " Use urlscan to choose and open a url: - :noremap <leader>u :w<Home>silent <End> !urlscan<CR> - :noremap ,, :w<Home>silent <End> !urlscan<CR> + :noremap <leader>u :w<Home> !urlscan -r 'linkhandler {}'<CR> + :noremap ,, !urlscan -r 'linkhandler {}'<CR> -" Copy selected text to system clipboard (requires gvim installed): - vnoremap <C-c> "*Y :let @+=@*<CR> +" Copy selected text to system clipboard (requires gvim/nvim/vim-x11 installed): + vnoremap <C-c> "+y map <C-p> "+P " Enable Goyo by default for mutt writting @@ -104,8 +104,7 @@ call plug#end() """LATEX " Word count: - autocmd FileType tex map <leader>o :w !detex \| wc -w<CR> - autocmd FileType tex inoremap <leader>o <Esc>:w !detex \| wc -w<CR> + autocmd FileType tex map <leader><leader>o :w !detex \| wc -w<CR> " Code snippets autocmd FileType tex inoremap ,fr \begin{frame}<Enter>\frametitle{}<Enter><Enter><++><Enter><Enter>\end{frame}<Enter><Enter><++><Esc>6kf}i autocmd FileType tex inoremap ,fi \begin{fitch}<Enter><Enter>\end{fitch}<Enter><Enter><++><Esc>3kA |
