-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update all tcsh wrappers with sh
- Loading branch information
Beat Reichenbach
committed
Apr 1, 2024
1 parent
01cba4f
commit 5420b99
Showing
19 changed files
with
753 additions
and
759 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,58 @@ | ||
#!/bin/tcsh -f | ||
# | ||
#!/bin/sh | ||
|
||
# | ||
# This script attempts to register RV as the protocol hander for | ||
# links that look like rvlink://blah. | ||
# This script attempts to register RV as the protocol hander for | ||
# links that look like rvlink://blah. | ||
# | ||
# It should be sufficient for gnome apps like pidgin and kde apps | ||
# like konqueror. Firefox seems to pay attention to the gnome | ||
# settings at least to the degree that it recognizes links of the | ||
# form rvlink://blah as hot-links, but it may still ask you to | ||
# select the application the first time you click on one. | ||
# It should be sufficient for gnome apps like pidgin and kde apps | ||
# like konqueror. Firefox seems to pay attention to the gnome | ||
# settings at least to the degree that it recognizes links of the | ||
# form rvlink://blah as hot-links, but it may still ask you to | ||
# select the application the first time you click on one. | ||
# | ||
# We (tweak) are not expert on this stuff, so if you have ideas | ||
# about how to do this better or more completely, please let us | ||
# know ! ([email protected]) | ||
# We (tweak) are not expert on this stuff, so if you have ideas | ||
# about how to do this better or more completely, please let us | ||
# know ! ([email protected]) | ||
# | ||
|
||
if (! $?RV_HOME) then | ||
pushd `dirname $0` >& /dev/null | ||
setenv RV_HOME `dirname ${cwd}` | ||
popd >& /dev/null | ||
endif | ||
if [ -z "$RV_HOME" ]; then | ||
canonicalName=$(readlink -f "$0") | ||
binName=$(dirname "$canonicalName") | ||
homeName=$(dirname "$binName") | ||
export RV_HOME="$homeName" | ||
fi | ||
|
||
set rv = "$RV_HOME/bin/rv" | ||
export rv="$RV_HOME/bin/rv" | ||
|
||
# | ||
# Gnome: register rv as rvlink protocol handler | ||
# | ||
echo "Installing rvlink protocol handler for Gnome." | ||
|
||
set gconfTool = "`which gconftool-2`" | ||
|
||
if ($status == 0) then | ||
if which gconftool-2; then | ||
gconftool-2 --set --type=string /desktop/gnome/url-handlers/rvlink/command $rv' "%s"' | ||
gconftool-2 --set --type=bool /desktop/gnome/url-handlers/rvlink/enabled true | ||
gconftool-2 --set --type=bool /desktop/gnome/url-handlers/rvlink/need-terminal false | ||
else | ||
echo "WARNING: gconftool-2 not found: skipping gnome url-handler registration." | ||
endif | ||
fi | ||
|
||
# | ||
# KDE: register rv as rvlink protocol handler | ||
# If you want to install this system wide copy the rvlink.protocol file to /usr/share/kde4/services/ | ||
# | ||
# If you want to install this system wide copy the rvlink.protocol file to /usr/share/kde4/services/ | ||
echo "Installing rvlink protocol handler for KDE." | ||
|
||
set kdeProtoDir = ~/.kde/share/services | ||
if ( -e ~/.kde4/share/services ) then | ||
set kdeProtoDir = ~/.kde4/share/services | ||
endif | ||
if (${?KDEDIR}) then | ||
set kdeProtoDir = ${KDEDIR}/share/services | ||
endif | ||
kdeProtoDir="$HOME/.kde/share/services" | ||
if [ -e "$HOME/.kde4/share/services" ]; then | ||
kdeProtoDir="$HOME/.kde4/share/services" | ||
fi | ||
if [ -n "$KDEDIR" ]; then | ||
kdeProtoDir="$KDEDIR/share/services" | ||
fi | ||
|
||
if ( ! -e $kdeProtoDir) then | ||
mkdir -p $kdeProtoDir | ||
endif | ||
if [ ! -e "$kdeProtoDir" ]; then | ||
mkdir -p "$kdeProtoDir" | ||
fi | ||
|
||
if ( -e $kdeProtoDir) then | ||
set kdeProtoFile = $kdeProtoDir/rvlink.protocol | ||
rm -f $kdeProtoFile | ||
cat > $kdeProtoFile << EOF | ||
if [ -e "$kdeProtoDir" ]; then | ||
kdeProtoFile="$kdeProtoDir/rvlink.protocol" | ||
rm -f "$kdeProtoFile" | ||
cat > "$kdeProtoFile" << EOF | ||
[Protocol] | ||
exec=$rv "%u" | ||
protocol=rvlink | ||
|
@@ -72,30 +65,25 @@ writing=false | |
makedir=false | ||
deleting=false | ||
EOF | ||
echo "Successfully created ${kdeProtoFile}" | ||
echo "Successfully created $kdeProtoFile" | ||
else | ||
echo "WARNING: can't find or create KDE protocol directory: ${kdeProtoDir}: skipping KDE url-handler registration." | ||
endif | ||
echo "WARNING: Can't find or create KDE protocol directory: $kdeProtoDir. Skipping KDE url-handler registration." | ||
fi | ||
|
||
# | ||
# Gnome part 2 for xdg/Chrome: register rv as rvlink protocol handler | ||
# If you want to install this system wide run the desktop-file-install as sudo/root | ||
# and remove the --dir= bit. | ||
# | ||
# If you want to install this system wide run the desktop-file-install as sudo/root | ||
# and remove the --dir= bit. | ||
echo "Installing rvlink protocol handler for XDG" | ||
|
||
set desktopInstall = "`which desktop-file-install`" | ||
|
||
if ($status == 0) then | ||
set xdgDir = $HOME/.local/share/applications | ||
if ( ! -e $xdgDir ) then | ||
mkdir -p $xdgDir | ||
endif | ||
if which desktop-file-install; then | ||
xdgDir=$HOME/.local/share/applications | ||
if [ ! -e "$xdgDir" ]; then | ||
mkdir -p "$xdgDir" | ||
fi | ||
|
||
if ( -e $xdgDir) then | ||
set xdgFile = $xdgDir/rv.desktop | ||
rm -f $xdgFile | ||
cat > $xdgFile << EOF | ||
if [ ! -e "$xdgDir" ]; then | ||
xdgFile="$xdgDir/rv.desktop" | ||
rm -f "$xdgFile" | ||
cat > "$xdgFile" << EOF | ||
[Desktop Entry] | ||
Name=RVLink | ||
Type=Application | ||
|
@@ -105,14 +93,14 @@ Categories=AudioVideo;Viewer;Player; | |
MimeType=x-scheme-handler/rvlink; | ||
NoDisplay=true | ||
EOF | ||
echo "Successfully created ${xdgFile}" | ||
echo "Successfully created $xdgFile" | ||
else | ||
echo "WARNING: can't find or create XDG directory: ${xdgDir}: skipping XDG url-handler registration." | ||
endif | ||
echo "WARNING: Can't find or create XDG directory: $xdgDir. Skipping XDG url-handler registration." | ||
fi | ||
|
||
desktop-file-install $xdgFile --rebuild-mime-info-cache --dir=$xdgDir | ||
desktop-file-install "$xdgFile" --rebuild-mime-info-cache --dir="$xdgDir" | ||
else | ||
echo "WARNING: desktop-file-install not found: skipping xdg-handler registration." | ||
endif | ||
echo "WARNING: desktop-file-install not found: Skipping xdg-handler registration." | ||
fi | ||
|
||
echo "Done." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,58 @@ | ||
#!/bin/tcsh -f | ||
# | ||
#!/bin/sh | ||
|
||
# | ||
# This script attempts to register RV as the protocol hander for | ||
# links that look like rvlink://blah. | ||
# This script attempts to register RV as the protocol hander for | ||
# links that look like rvlink://blah. | ||
# | ||
# It should be sufficient for gnome apps like pidgin and kde apps | ||
# like konqueror. Firefox seems to pay attention to the gnome | ||
# settings at least to the degree that it recognizes links of the | ||
# form rvlink://blah as hot-links, but it may still ask you to | ||
# select the application the first time you click on one. | ||
# It should be sufficient for gnome apps like pidgin and kde apps | ||
# like konqueror. Firefox seems to pay attention to the gnome | ||
# settings at least to the degree that it recognizes links of the | ||
# form rvlink://blah as hot-links, but it may still ask you to | ||
# select the application the first time you click on one. | ||
# | ||
# We (tweak) are not expert on this stuff, so if you have ideas | ||
# about how to do this better or more completely, please let us | ||
# know ! ([email protected]) | ||
# We (tweak) are not expert on this stuff, so if you have ideas | ||
# about how to do this better or more completely, please let us | ||
# know ! ([email protected]) | ||
# | ||
|
||
if (! $?RV_HOME) then | ||
pushd `dirname $0` >& /dev/null | ||
setenv RV_HOME `dirname ${cwd}` | ||
popd >& /dev/null | ||
endif | ||
if [ -z "$RV_HOME" ]; then | ||
canonicalName=$(readlink -f "$0") | ||
binName=$(dirname "$canonicalName") | ||
homeName=$(dirname "$binName") | ||
export RV_HOME="$homeName" | ||
fi | ||
|
||
set rvpush = "$RV_HOME/bin/rvpush" | ||
export rvpush="$RV_HOME/bin/rvpush" | ||
|
||
# | ||
# Gnome: register rv as rvlink protocol handler | ||
# | ||
echo "Installing rvlink protocol handler for Gnome." | ||
|
||
set gconfTool = "`which gconftool-2`" | ||
|
||
if ($status == 0) then | ||
gconftool-2 --set --type=string /desktop/gnome/url-handlers/rvlink/command $rvpush' -tag rvlink url "%s"' | ||
if which gconftool-2; then | ||
gconftool-2 --set --type=string /desktop/gnome/url-handlers/rvlink/command $rv' "%s"' | ||
gconftool-2 --set --type=bool /desktop/gnome/url-handlers/rvlink/enabled true | ||
gconftool-2 --set --type=bool /desktop/gnome/url-handlers/rvlink/need-terminal false | ||
else | ||
echo "WARNING: gconftool-2 not found: skipping gnome url-handler registration." | ||
endif | ||
fi | ||
|
||
# | ||
# KDE: register rv as rvlink protocol handler | ||
# If you want to install this system wide copy the rvlink.protocol file to /usr/share/kde4/services/ | ||
# | ||
# If you want to install this system wide copy the rvlink.protocol file to /usr/share/kde4/services/ | ||
echo "Installing rvlink protocol handler for KDE." | ||
|
||
set kdeProtoDir = ~/.kde/share/services | ||
if ( -e ~/.kde4/share/services ) then | ||
set kdeProtoDir = ~/.kde4/share/services | ||
endif | ||
if (${?KDEDIR}) then | ||
set kdeProtoDir = ${KDEDIR}/share/services | ||
endif | ||
kdeProtoDir="$HOME/.kde/share/services" | ||
if [ -e "$HOME/.kde4/share/services" ]; then | ||
kdeProtoDir="$HOME/.kde4/share/services" | ||
fi | ||
if [ -n "$KDEDIR" ]; then | ||
kdeProtoDir="$KDEDIR/share/services" | ||
fi | ||
|
||
if ( ! -e $kdeProtoDir) then | ||
mkdir -p $kdeProtoDir | ||
endif | ||
if [ ! -e "$kdeProtoDir" ]; then | ||
mkdir -p "$kdeProtoDir" | ||
fi | ||
|
||
if ( -e $kdeProtoDir) then | ||
set kdeProtoFile = $kdeProtoDir/rvlink.protocol | ||
rm -f $kdeProtoFile | ||
cat > $kdeProtoFile << EOF | ||
if [ -e "$kdeProtoDir" ]; then | ||
kdeProtoFile="$kdeProtoDir/rvlink.protocol" | ||
rm -f "$kdeProtoFile" | ||
cat > "$kdeProtoFile" << EOF | ||
[Protocol] | ||
exec=$rvpush -tag rvlink url "%u" | ||
protocol=rvlink | ||
|
@@ -72,30 +65,25 @@ writing=false | |
makedir=false | ||
deleting=false | ||
EOF | ||
echo "Successfully created ${kdeProtoFile}" | ||
echo "Successfully created $kdeProtoFile" | ||
else | ||
echo "WARNING: can't find or create KDE protocol directory: ${kdeProtoDir}: skipping KDE url-handler registration." | ||
endif | ||
echo "WARNING: Can't find or create KDE protocol directory: $kdeProtoDir. Skipping KDE url-handler registration." | ||
fi | ||
|
||
# | ||
# Gnome part 2 for xdg/Chrome: register rv as rvlink protocol handler | ||
# If you want to install this system wide run the desktop-file-install as sudo/root | ||
# and remove the --dir= bit. | ||
# | ||
# If you want to install this system wide run the desktop-file-install as sudo/root | ||
# and remove the --dir= bit. | ||
echo "Installing rvlink protocol handler for XDG" | ||
|
||
set desktopInstall = "`which desktop-file-install`" | ||
|
||
if ($status == 0) then | ||
set xdgDir = $HOME/.local/share/applications | ||
if ( ! -e $xdgDir ) then | ||
mkdir -p $xdgDir | ||
endif | ||
if which desktop-file-install; then | ||
xdgDir=$HOME/.local/share/applications | ||
if [ ! -e "$xdgDir" ]; then | ||
mkdir -p "$xdgDir" | ||
fi | ||
|
||
if ( -e $xdgDir) then | ||
set xdgFile = $xdgDir/rv.desktop | ||
rm -f $xdgFile | ||
cat > $xdgFile << EOF | ||
if [ ! -e "$xdgDir" ]; then | ||
xdgFile="$xdgDir/rv.desktop" | ||
rm -f "$xdgFile" | ||
cat > "$xdgFile" << EOF | ||
[Desktop Entry] | ||
Name=RVLink | ||
Type=Application | ||
|
@@ -105,14 +93,14 @@ Categories=AudioVideo;Viewer;Player; | |
MimeType=x-scheme-handler/rvlink; | ||
NoDisplay=true | ||
EOF | ||
echo "Successfully created ${xdgFile}" | ||
echo "Successfully created $xdgFile" | ||
else | ||
echo "WARNING: can't find or create XDG directory: ${xdgDir}: skipping XDG url-handler registration." | ||
endif | ||
echo "WARNING: Can't find or create XDG directory: $xdgDir. Skipping XDG url-handler registration." | ||
fi | ||
|
||
desktop-file-install $xdgFile --rebuild-mime-info-cache --dir=$xdgDir | ||
desktop-file-install "$xdgFile" --rebuild-mime-info-cache --dir="$xdgDir" | ||
else | ||
echo "WARNING: desktop-file-install not found: skipping xdg-handler registration." | ||
endif | ||
echo "WARNING: desktop-file-install not found: Skipping xdg-handler registration." | ||
fi | ||
|
||
echo "Done." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.