From cb8f9102498eddb8cd3cb907a2d64dd344a92910 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Thu, 10 Feb 2022 18:38:59 +0100 Subject: Removed environment variables for default programs. Some have been replaced by their own script. --- Makefile | 2 ++ dmenu-websearch | 2 +- mail-compose | 6 ++---- open-file | 20 ++++++++++---------- popup-cal12 | 2 +- popup-cal3 | 2 +- popup-terminal | 2 +- terminal | 5 +++++ xedit | 8 ++++++++ xedit-filter | 5 ++--- xplumb | 9 ++++----- 11 files changed, 37 insertions(+), 26 deletions(-) create mode 100755 terminal create mode 100755 xedit diff --git a/Makefile b/Makefile index dc6edfc..08b419e 100644 --- a/Makefile +++ b/Makefile @@ -27,12 +27,14 @@ SCRIPTS = addressgrep \ sfeed-browser \ spawn \ templess \ + terminal \ togglemute \ translate \ trash \ urlgrep \ volume \ websearch \ + xedit \ xedit-filter \ xkboptions \ xplumb \ diff --git a/dmenu-websearch b/dmenu-websearch index 04df2fc..d1af538 100755 --- a/dmenu-websearch +++ b/dmenu-websearch @@ -1,6 +1,6 @@ #!/bin/sh -# Popup $TERMINAL prompting for websearch +# dmenu prompt for websearch # Requires: dmenu (or similar), websearch menu=${MENU:-dmenu} diff --git a/mail-compose b/mail-compose index 1c293f0..40b4d05 100755 --- a/mail-compose +++ b/mail-compose @@ -1,8 +1,6 @@ #!/bin/sh # Open a mail composer. -# Requires: mblaze +# Requires: mblaze, terminal -terminal=${TERMINAL:-xterm} - -$terminal -e mcom $@ +terminal -e mcom $@ diff --git a/open-file b/open-file index 055aad2..848fd9b 100755 --- a/open-file +++ b/open-file @@ -4,19 +4,19 @@ # Launches files based on their mimetypes # Use option -s devour to swallow or -s " " to open normally from terminal # Use -t to specify mimetype -# Requires: dmenu_path or similar (fallback) -# dmenu-filepicker +# Requires: dmenu_path or similar (fallback), dmenu-filepicker menu=${MENU:-dmenu} -video=${VIDEOPLAYER:-mpv} -music=${MUSICPLAYER:-mpv} -pdf=${VIEWER:-zathura} -img=${IMAGEVIEWER:-imv} -word=${TEXTDOCUMENT:-libreoffice} -sheet=${SPREADSHEET:-libreoffice} -html=${HTMLVIEWER:-firefox} -xedit=${XEDITOR:-gedit} +# Change default apps here +video="mpv" +music="mpv --player-operation-mode=pseudo-gui" +pdf="zathura" +img="imv" +word="libreoffice" +sheet="libreoffice" +html="firefox --new-window" +xedit="xedit" openfile() { f="$@" diff --git a/popup-cal12 b/popup-cal12 index 3469a4c..cbe089a 100755 --- a/popup-cal12 +++ b/popup-cal12 @@ -1,6 +1,6 @@ #!/bin/sh -# Popup $TERMINAL displaying cal -3 +# Popup terminal displaying cal -3 # Requires: st (suckless terminal) st -T "stfloat" -g 69x36+620+250 -e sh -c 'cal $(date +%Y); read x' diff --git a/popup-cal3 b/popup-cal3 index 766c9cb..6dfed54 100755 --- a/popup-cal3 +++ b/popup-cal3 @@ -1,6 +1,6 @@ #!/bin/sh -# Popup $TERMINAL displaying cal -3 +# Popup terminal displaying cal -3 # Requires: st (suckless terminal) st -T "stfloat" -g 68x11+620+450 -e sh -c 'cal -3; read x' diff --git a/popup-terminal b/popup-terminal index 8863eb3..a9a20d1 100755 --- a/popup-terminal +++ b/popup-terminal @@ -2,4 +2,4 @@ # TODO maybe I want to run e.g. tmux in this? -st -T "stfloat" -g 85x25+550+300 $@ +st -T "stfloat" -g 85x25+550+300 tmux new-session $@ diff --git a/terminal b/terminal new file mode 100755 index 0000000..d751592 --- /dev/null +++ b/terminal @@ -0,0 +1,5 @@ +#!/bin/sh + +# My default terminal + +st -e tmux new-session $@ diff --git a/xedit b/xedit new file mode 100755 index 0000000..d456be8 --- /dev/null +++ b/xedit @@ -0,0 +1,8 @@ +#!/bin/sh + +# My X editor +# Requires: terminal + +editor=${EDITOR:-${VISUAL:-vi}} + +terminal $editor diff --git a/xedit-filter b/xedit-filter index 93e908c..9422760 100755 --- a/xedit-filter +++ b/xedit-filter @@ -1,10 +1,9 @@ #/!bin/sh # Open stdin in a text editor and sends modified selection to stdout - -xeditor=${XEDITOR:-gedit} +# Requires: xeditor f=$(mktemp) cat > "$f" -$xeditor "$f" && cat "$f" +xeditor "$f" && cat "$f" diff --git a/xplumb b/xplumb index 68b8cda..8fec4ac 100755 --- a/xplumb +++ b/xplumb @@ -5,7 +5,8 @@ # some possibilities (open file, open url, man page...). If none is matched, # a choice is prompted. -# Requires: dmenu (or similar), mail-compose, open-file, websearch, xsel +# Requires: dmenu (or similar), mail-compose, open-file, terminal, websearch, +# xedit, xsel # TODO: # send mail to email address; @@ -13,8 +14,6 @@ # choice: pipe to another program browser=${BROWSER:-firefox} -terminal=${TERMINAL:-xterm} -xeditor=${XEDITOR:-gedit} menu=${MENU:-dmenu} menuopts="-l 10" @@ -34,7 +33,7 @@ choice() { elif [ "$chosen" = "edit" ]; then f=$(mktemp) xsel > "$f" - $xeditor "$f" + xedit "$f" fi } @@ -47,7 +46,7 @@ tryman() { number=$(echo "$1" | sed 's/[^1-8]//g') name=$(echo "$1" | sed 's/([1-8])//g' | sed 's/ //g') if [ $(man -w "$number" "$name" | wc -l) = 1 ]; then - $terminal -e man "$number" "$name" + terminal -e man "$number" "$name" return 0 else return 1 -- cgit v1.3