From 7d3dc968b6183f51dc2594c80450372f0c8fb811 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Mon, 23 Dec 2024 10:01:15 +0100 Subject: Changes for new laptop --- battery-checknow | 2 +- dmenu-unmount | 3 +-- open-file | 6 +++--- open-stdin | 8 ++++---- terminal | 4 +++- xedit | 3 ++- 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/battery-checknow b/battery-checknow index 66bbd60..4b76488 100755 --- a/battery-checknow +++ b/battery-checknow @@ -4,7 +4,7 @@ # Requires: battery-status, notify-battery file="${XDG_DATA_HOME:-$HOME/.local/share}/batterystatus" -notify="notify push" +notify=${NOTIFY:-"notify push"} low=20 crit=15 diff --git a/dmenu-unmount b/dmenu-unmount index 8f7a27f..93c8186 100755 --- a/dmenu-unmount +++ b/dmenu-unmount @@ -7,8 +7,7 @@ # Example: dmenu-unmount -m slmenu -w echo menu=dmenu -#writeout=notify-send -writeout="notify push" +writeout=${NOTIFY:-"notify push"} usage() { echo "Usage: dmenu-unmount [-m MENU] [-w WRITER]" diff --git a/open-file b/open-file index f196073..eb7ea1c 100755 --- a/open-file +++ b/open-file @@ -9,9 +9,9 @@ menu="dmenu -i -l 15" # Change default apps here -video="vlc" -music="vlc" -pdf="zathura" +video=${VIDEO:-vlc} +music=${MUSIC:-vlc} +pdf=${PDF:-zathura} img="imv" word="libreoffice" sheet="libreoffice" diff --git a/open-stdin b/open-stdin index 5c0ee1e..a1e10b5 100755 --- a/open-stdin +++ b/open-stdin @@ -1,12 +1,12 @@ #!/bin/sh -# Saves standard input in a download folder and opens it (spawn) +# Saves standard input in a temporary file and opens it (spawn) # Usage: open-stdin -# Requires: open-file +# Requires: open-file (or set $OPENER to e.g. xdg-open) -#folder=$HOME/Downloads/open-stdin folder=${TMPDIR:-/tmp} +open=${OPENER:-open-file} tempfile=$(mktemp -p "$folder") -cat > "$tempfile" && open-file $@ "$tempfile" +cat > "$tempfile" && $open $@ "$tempfile" diff --git a/terminal b/terminal index b98a67e..c6b358f 100755 --- a/terminal +++ b/terminal @@ -2,4 +2,6 @@ # My default terminal -st -e tmux new-session "$@" +terminal=${TERMINAL:-'st -e tmux new-session "$@"'} + +$terminal diff --git a/xedit b/xedit index 9438aa8..4fb3114 100755 --- a/xedit +++ b/xedit @@ -4,5 +4,6 @@ # Requires: terminal editor=${EDITOR:-${VISUAL:-vi}} +xed=${XEDIT:-'terminal "$editor"'} -terminal "$editor" "$@" +$xed "$@" -- cgit v1.3