diff --git a/debian/changelog b/debian/changelog index 889aa879..59ee5983 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,12 @@ byobu (2.63) unreleased; urgency=low - * UNRELEASED + * etc/byobu/socketdir, usr/bin/byobu-config, usr/bin/byobu-janitor, + usr/bin/byobu-select-profile: increase portability to other distros, + create socketdir conffile and SOCKETDIR variable for users who don't + use /var/run/screen as the socket directory, LP: #535378 + * usr/bin/byobu-config: change a sample reference from "bash" to "shell" + again for portability, LP: #xxxxxx + -- Dustin Kirkland Tue, 09 Mar 2010 14:53:10 -0600 diff --git a/etc/byobu/socketdir b/etc/byobu/socketdir new file mode 100644 index 00000000..e3596a24 --- /dev/null +++ b/etc/byobu/socketdir @@ -0,0 +1,10 @@ +# Set the location of the socket directory that byobu will use. +# On Debian/Ubuntu systems, this is in /var/run/screen, but on +# other distros, it might be elsewhere, such as /tmp +# +# This file will be sourced by both shell scripts and python code, +# so please ensure that: +# * the variable name is SOCKETDIR +# * there is no space around the "=" +# * and that the path value is quoted +SOCKETDIR="/var/run/screen" diff --git a/usr/bin/byobu-config b/usr/bin/byobu-config index 46bfaa03..2aa0a837 100755 --- a/usr/bin/byobu-config +++ b/usr/bin/byobu-config @@ -37,7 +37,13 @@ if not os.path.exists(DOC): DOC = "%s/.%s/%s" % (HOME, PKG, DOC) DEF_ESC="A" RELOAD = "If you are using the default set of keybindings, press\n or to activate these changes.\n\nOtherwise, exit this screen session and start a new one." -RELOAD_FLAG="/var/run/screen/S-"+USER+"/"+PKG+".reload-required" +SOCKETDIR="/var/run/screen" +if os.path.exists("/etc/%s/socketdir" % PKG): + try: + execfile(i) + except: + SOCKETDIR="/var/run/screen" +RELOAD_FLAG="%s/S-%s/%s.reload-required" % (SOCKETDIR, USER, PKG) RELOAD_CMD="screen -X at 0 source $HOME/."+PKG+"/profile" ESC = '' snack.hotkeys[ESC] = ord(ESC) @@ -183,9 +189,9 @@ def switch_keybindings(set): commands.getoutput("sed -i -e 's:^source .*$:source "+SHARE+"/keybindings/"+set+":' "+HOME+"/."+PKG+"/keybindings") def newwindow(screen, size): - title=Entry(8, text="bash", returnExit=1) + title=Entry(8, text="shell", returnExit=1) titlel=Label(_("Title: ")) - command=Entry(20, text="/bin/bash", returnExit=1) + command=Entry(20, text="/bin/sh", returnExit=1) commandl=Label(_("Command: ")) rl=Label(_("Presets: ")) diff --git a/usr/bin/byobu-janitor b/usr/bin/byobu-janitor index 3648f35c..11444c38 100755 --- a/usr/bin/byobu-janitor +++ b/usr/bin/byobu-janitor @@ -20,7 +20,8 @@ # along with this program. If not, see . PKG="byobu" -RUN="/var/run/screen/S-$USER" +[ -r "/etc/$PKG/socketdir" ] && . "/etc/$PKG/socketdir" || SOCKETDIR="/var/run/screen" +RUN="$SOCKETDIR/S-$USER" FLAG="$RUN/$PKG.reload-required" # Exit immediately, if we're not forced, and there is no reload flag diff --git a/usr/bin/byobu-select-profile b/usr/bin/byobu-select-profile index 6ceeeb9d..7daf3dd6 100755 --- a/usr/bin/byobu-select-profile +++ b/usr/bin/byobu-select-profile @@ -23,6 +23,7 @@ # ./debian/rules get-po PKG="byobu" +[ -r "/etc/$PKG/socketdir" ] && . "/etc/$PKG/socketdir" || SOCKETDIR="/var/run/screen" TEXTDOMAIN="$PKG" @@ -175,7 +176,7 @@ setcolor() { fi [ "$MONOCHROME" = "1" ] || MONOCHROME=0 printf "FOREGROUND=$FOREGROUND\nBACKGROUND=$BACKGROUND\nMONOCHROME=$MONOCHROME" > $FILE - touch "/var/run/screen/S-$USER/$PKG.reload-required" + touch "$SOCKETDIR/S-$USER/$PKG.reload-required" } if [ $# -eq 0 ]; then