[SOLVED] SABnzbd rc.d Script

I'm having trouble getting  the sabnzbd daemon script to run. I'm trying to run the default one that came with the AUR but it keeps failing while running it from /opt/sabnzbd/SABnzbd.py works. Yes, I have copied over the ini file to /opt/sabnzbd/. Below is the /etc/rc.d/sabnzbd shell script. I'm a real newbie so I don't really know how to troubleshoot what's going on at all . It just says [FAIL] dies.
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
SABNZBD_USER="sabnzbd"
SABNZBD_CONF="/opt/sabnzbd/sabnzbd.ini"
PID=`pidof -o %PPID -x SABnzbd.py`
case "$1" in
start)
stat_busy "Starting SABnzbd"
[ -z "$PID" ] && su - $SABNZBD_USER -c "/opt/sabnzbd/SABnzbd.py -f $SABNZBD_CONF -d" -s /bin/sh
if [ $? -gt 0 ]; then
stat_fail
else
add_daemon sabnzbd
stat_done
fi
stop)
stat_busy "Stopping SABnzbd"
[ "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon sabnzbd
stat_done
fi
restart)
$0 stop
sleep 1
$0 start
echo "usage: $0 {start|stop|restart}"
esac
exit 0
Last edited by DONDON (2008-12-23 02:30:02)

So, I figured it out. I removed every file that was associated with SABnzbd and started over. Below are a list of things that I learned on my way that I hope will help other true newbies get their daemons working:
1. Write your access rules so that the user your daemon runs under is in the same group as your user account if you've manually made your download/incomplete/cache/log folders.
2. Make sure to not use ~/ to designate your home directory with the SABnzbd config file. Instead use /home/usernamehere/
3. When you move sabnzbd.ini over to /opt/sabnzbd/ chown it back to the user designated in the /etc/rc.d/sabnzbd script
4. When you chown the a file make sure you're changing the group AND owner.
5. ls -al is your friend.
6. If your config file gets too messy, just remove it and start over.
These are all really newbie mistakes that I made. I hope they help someone else avoid them .

Similar Messages

  • [solved] sabnzbd (no module named filters.gzipfilter)

    I tried installing sabnzbd from aur, and I managed to track down the dependencies in aur or the regular repository and its all installed but when I try and run SABnzbd.py I get this
    Traceback (most recent call last):
    File "/usr/bin/SABnzbd.py", line 44, in <module>
    from sabnzbd.interface import *
    File "/usr/lib/python2.5/site-packages/sabnzbd/interface.py", line 31, in <module>
    from cherrypy.filters.gzipfilter import GzipFilter
    ImportError: No module named filters.gzipfilter
    Last edited by Zepp (2007-06-14 20:19:53)

    soylent_green_is_hamster wrote:
    Hi Zepp
    I have the same problem, did installing cherrypy 2.2 fix things for you?
    Not sure exactly how I install 2.2, is there a PKGBUILD for it, or did you just go to download.cherrypy.org, download the 2.2.1 tarball and run the setup script?
    cheers!
    Yes it fixed my problem. If I recall correctly I just went and downloaded the tar ball from the cherrypy website and used the setup.py to install it. I didn't see a PKGBUILD for it anywhere either, and I figured one package not installed through pacman wouldn't cause to much a pain in the ass later on .
    Last edited by Zepp (2008-07-03 17:37:50)

  • [solv]Can't upload script in "SQL Scripts": Empty contents in Script editor

    When I try to upload a script via Home->SQL->SQL Scripts->Upload->Browse->Upload I get an icon on the Home->SQL->SQL Scripts page. When I click this icon, however, to view its contents I get an empty field on the Script editor page. The problem occurs regardless which file I upload or if I login as the system user.
    Anybody knows a solution?
    Message was edited by:
    user590050

    See if this thread helps:
    Re: Creating Script using Script Editor It helped. Problem is solved for firefox AND netscape!
    (konqueror support would be big time, but arguably won't ever come...)

  • [Solved]32bit chroot install script installs 64bit libs IDK why though

    Ive been though this script with a fine tooth comb and I still cant figure out for the life of me why its still grabbing stuff from the 64bit repo instead of the 32bit repo. when I chroot into /opt/arch32 and issue "uname -m" it still tells me that the arch is x86_64. Even when its downloading stuff from pacman I can see that a lot of the packages have x86_64 at the end of them too.
    edit:
    the mystery is solved, my stage 2 install script copies a preconfigured pacman.conf that doesnt reference the mirrorlist file at all, the repositories were listed in pacman.conf instead.
    Last edited by brando56894 (2009-06-25 02:10:21)

  • [SOLVED] SSH Log check script, what am i doing wrong?

    wow linux, you never cease to amaze me
    cat /var/log/auth.log | grep -vP "(209\.94\.131.\65|216\.204\.172\.218)" | grep Accepted | awk '{ print $1, $2, $11 }'
    --- the rest is immaterial --
    disclaimer: i am a horrible scripter; i'm just learning; there's probably a better way to do this
    what i'm trying to do: cat through /var/log/auth.log for accepted ssh connections, filter out my home and work ip's, place any filtered ip's in a log file with date.
    i'm having some trouble when checking for inequality between two ip strings (xx.xx.xx.xx).  this script:
    #!/bin/bash
    homeip=`whatismyip`
    workip="216.204.172.218"
    log=${HOME}/Documents/ssh_log
    logip=`cat /var/log/auth.log |
    \grep Accepted.*patrick |
    \awk '{ print $11 }'`
    if [ "$logip" != "$homeip" ]; then
    if [ "$logip" != "$workip" ]; then
    echo -e "$logip \n"
    #cat /var/log/auth.log | grep "$logip" | awk '{ print $1 " " $2 " " $11 }' > $log
    fi
    fi
    echo Home\:\ $homeip
    echo Work\:\ $workip
    exit 0
    outputs this:
    216.204.172.218
    216.204.172.218
    216.204.172.218
    216.204.172.218
    216.204.172.218
    192.168.0.7
    192.168.0.7
    192.168.0.7
    216.204.172.218
    216.204.172.218
    216.204.172.218
    216.204.172.218
    216.204.172.218
    216.204.172.218
    216.204.172.218
    216.204.172.218
    216.204.172.218
    68.37.60.140
    68.37.60.140
    68.37.60.140
    68.37.60.140
    68.37.60.140
    68.37.60.140
    68.37.60.140
    68.37.60.140
    216.204.172.218
    216.204.172.218
    216.204.172.218
    216.204.172.218
    216.204.172.218
    216.204.172.218
    192.168.0.7
    216.204.172.218
    209.94.131.65
    209.94.131.65
    216.204.172.218
    209.94.131.65
    216.204.172.218
    Home: 209.94.131.65
    Work: 216.204.172.218
    i have it just echoing the ip's it finds in the log, then showing which ones _should've_ been filtered out, to debug.
    what gives?
    i'm sure it's trivial, any help would be appreciated.
    Last edited by brisbin33 (2009-01-13 17:10:10)

    pointone,
    yes, you're exactly right, i was thinking one grepped line at a time, not the whole string... that'll require a rewrite
    rson,
    grep -vP and awk should do what i want w/o any scripting required... think i'd learn by now, RTFM right?

  • [solved] XFCE: bind custom script to backlight keys, including Notify?

    Hello, the situation is as follows:
    My (Toshiba Z30) backlight keys toggle the XFCE-brightness control popup, but they don't control the display brightness.
    I found out why: they control /sys/class/backlight/toshiba/brightness instead of /sys/class/backlight/intel_backlight/brightness. I wasn't able to change that, although testing the kernel parameters acpi_backlight=vendor and acpi_osi='!Windows 2012'. That tip (bottom of the page) given in the arch wiki had no effect OR didn't even let me boot when I tried to adjust the BusID to the output of lspci...
    So I got another solution, these selfmade scripts:
    /usr/local/bin/darker
    #!/bin/bash
    CURR=`cat /sys/class/backlight/intel_backlight/brightness`
    MIN=3
    NEW=$(($CURR-50))
    if [ $NEW -lt 5 ]
    then
    NEW=5
    fi
    echo $NEW > /sys/class/backlight/intel_backlight/brightness
    and
    /usr/local/bin/brighter
    #!/bin/bash
    CURR=`cat /sys/class/backlight/intel_backlight/brightness`
    MAX=`cat /sys/class/backlight/intel_backlight/max_brightness`
    NEW=$(($CURR+50))
    if [ $NEW -gt $MAX ]
    then
    NEW=$MAX
    fi
    echo $NEW > /sys/class/backlight/intel_backlight/brightness
    which work.
    Assigning these scripts to keys also works with "sudo darker" / "sudo brighter" and adding them via visudo.
    The only thing missing to make it perfect, is the combination:
    Using the default brightness keys including the XFCE onscreen notification/popup binded to those scripts. (Just assigning to the brightness keys would make me lose the on screen notifiaction/popup...)
    So how is that possible, has anyone an idea?
    Last edited by Carl Karl (2014-10-14 15:21:14)

    Thanks, that's quite good, except that multiple key-presses lead to multiple notification popups which is not sooo nice bad acceptable. (And as this is run by root, a sudo xfce4-notifyd-config is necessary to configure the notification.)
    for reference:
    /usr/local/bin/brighter
    #!/bin/bash
    CURR=`cat /sys/class/backlight/intel_backlight/brightness`
    MAX=`cat /sys/class/backlight/intel_backlight/max_brightness`
    NEW=$(($CURR+20))
    if [ $NEW -gt $MAX ]
    then
    NEW=$MAX
    fi
    echo $NEW > /sys/class/backlight/intel_backlight/brightness
    notify-send "Backlight $(($NEW*100/$MAX)) %"
    /usr/local/bin/darker
    #!/bin/bash
    CURR=`cat /sys/class/backlight/intel_backlight/brightness`
    MIN=3
    MAX=`cat /sys/class/backlight/intel_backlight/max_brightness`
    NEW=$(($CURR-20))
    if [ $NEW -lt 5 ]
    then
    NEW=5
    fi
    echo $NEW > /sys/class/backlight/intel_backlight/brightness
    notify-send "Backlight $(($NEW*100/$MAX)) %"
    So any idea how to avoid these multiple notifications? notify-send --help wasn't helpful for me.

  • [SOLVED] Start process or script as a non root user on boot

    This is my first time posting here, I installed arch last week and have been able to firgure almost everything out. The wiki pages (very well written) and the forums have been a big help. However this is one question that I haven't been able to find the answer to.
    "How do I start a process or script as a user other then root at boot?"
    My guess is my inability to find an answer is mostly from my relitivly small understanding of bash scripting. If someone could point me to a guide or write down an example themselves I would greatly apriceate it.
    Thank you,
    Tim
    Edit: spelling
    Last edited by tpolich (2009-08-07 05:26:36)

    tpolich wrote:One more quick question, is rc.local run the backround or say if I asked for input would the system boot hang?
    Yes, rc.local itself would hang, but if you background the process inside rc.local using the '&' symbol at the end of the command, then that command will be backgrounded and rc.local can continue.

  • [Solved] Simple auto-suspend script?

    I'm looking for a simple solution to auto-suspend (ram/disk) a system after a certain time of inactivity. I can find surprisingly little info for this for linux (or perhaps i'm not looking in the right places), while windows for instance has this built in for years already.
    The idea is simple but maybe tricky in practice; if there is no user input for x seconds, no video/audio playing or continuous disk/network usage, suspend the system. Basically the system just needs to be idle for a certain amount of time.
    Does anyone know or have a working script or utility for this, or is writing one myself the only solution? The simplest approach i can think of is a combination of checking user idle time (with 'w') and sysload, though it might be necessary to determine a threshold for the latter to avoid simple jobs (cron etc.) producing a 0.01 sysload and thus preventing suspend.
    Any other thoughts or suggestions about this?
    Last edited by litemotiv (2010-05-07 11:03:55)

    Sorry for hijacking your thread but I tryed sleepd to suspend and lock my screen after a certain amount of time. So far it's working smoothly except when I am watching something with xbmc.
    So I just set --load=1 in /etc/conf.d/sleepd but it still goes to suspend. And I verified with the key o in xbmc that the cpu load is higher than 1%. I also added "-N" as sometime I let my computer download stuff for me in the background.
    PARAMS=("--unused=600" "--ac-unused=600" "--load=1" "-N" "--sleep-command=su lymphatik -c slock & dbus-send --system --print-reply --dest=org.freedesktop.Hal /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Suspend int32:0" "--battery=2" "--hibernate-command=dbus-send --system --print-reply --dest=org.freedesktop.Hal /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Hibernate int32:0")
    Last edited by lymphatik (2010-05-01 12:56:42)

  • [solved] Running a systemd script as root on startup

    Hello,
    I wrote following shell script in order to restart vsftpd when my dynamic wan ip adress changes:
    #!/bin/bash
    oldip=`xxxdyndns.com +short`
    while :
    do
    newip=`dig xxxdyndns.com +short`
    if [ $newip != $oldip ]; then
    echo "renewd ip. new ip: $newip"
    oldip=$newip
    systemctl restart vsftpd.service
    fi
    sleep 5m
    done
    exit 0
    The script needs to be run with root privileges (due to the systemctl restart line).
    I want the script to be run when my system starts, so I thought about writing a systemd service file. Unfortunately, I could not find out how to tell systemd that it shall run the script as root. I'm sure that this is a very novice question, but my board and google search did not tun out to be successful.
    Last edited by vibee (2014-01-16 15:42:02)

    Have you tried a service with
    User=root
    similar to e.g. https://wiki.archlinux.org/index.php/Sy … ces#Gitlab ?
    Last edited by karol (2014-01-16 15:28:37)

  • [SOLVED] dbus notification shell script

    EDIT: https://github.com/nowrep/notify-desktop
    I need a one line command for shell for dbus to show a notification.
    I'm using this python script for now:
    #!/usr/bin/env python
    # -*- coding: utf8 -*-
    """This is a python script that creates a notification using dbus."""
    import os, dbus
    item = ('org.freedesktop.Notifications')
    path = ('/org/freedesktop/Notifications')
    interface = ('org.freedesktop.Notifications')
    datum = os.popen("date +%X").read()
    icon = '/home/mladen/.irssi/irssitop.png'
    array = ''
    hint = ''
    time = 3 # Use seconds x 1000, 0 means wait for confirmation
    app_name = ('irssi')
    title = ('irssi обавјештење')
    body = ('Неко вас је споменуо\n\nВријеме:\t'+str(datum))
    bus = dbus.SessionBus()
    notif = bus.get_object(item, path)
    notify = dbus.Interface(notif, interface)
    notify.Notify(app_name, 0, icon, title, body, array, hint, time)
    os.popen("ogg123 -q /usr/share/sounds/KDE-Im-Irc-Event.ogg &>/dev/null &").read()
    But the problem is that I would prefer a one line command, if possible, and I'm not familliar with coding in python, so I'm unable to adapt it to suit my needs.
    Last edited by Demon (2014-01-11 20:52:30)

    1. dict needs to be in the format 'dict:string:string:' not 'dict:string:'
    2. You didn't specify the function (org.freedesktop.Notifications.Notify instead of org.freedesktop.Notifications).
    dbus-send --session --print-reply --dest=org.freedesktop.Notifications --type=method_call --reply-timeout=10000 /org/freedesktop/Notifications org.freedesktop.Notifications.Notify string:'Test Application' uint32:0 string: string:'NOTIFICATION TEST' string:'This is a test of the notification system via DBus.' array:string: dict:string:string: int32:10000

  • [SOLVED]Cannot get panel script to load(bspwm)

    Hi all, I am new to arch linux and just started using bspwm, have used xmonad for a few months or so. I am trying to base my desktop on windelicato's config (which is incredible imo and you can see it at his github) but am having trouble using the scripts from it. In particular, I don't get the panel that I can see in  his screenshot. I will post all relevant files that I know of, tell me if I have missed some!
    ~/.xinitrc
    if [ -d /etc/X11/xinit/xinitrc.d ]; then
    for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
    done
    unset f
    fi
    udisksvm &
    #udiskie &
    #exec openbox-session
    #/usr/bin/start-pulseaudio-x11 &
    #razercfg -r 1:3 &
    xset m 0 0 &
    #dhcpcd net1 &
    #~/.conky/loadconky.sh &
    #steam &
    #compton --config ~/.config/compton.conf -cGb &
    #(sleep 2s && tint2)
    xrandr --output DFP17 --output DFP18 --right-of DFP17 &
    #setxkbmap -option terminate:ctrl_alt_bksp &
    bash ~/.fehbg &
    #stalonetray &
    #redshiftgui &
    xsetroot -cursor_name left_ptr &
    mpd ~/.mpd/mpd.conf &
    autocutsel -fork &
    autocutsel -selection PRIMARY -fork &
    #bash ~/.xmonad/workspaces/master
    #stalonetray -i 20 -geometry 1x1+1390+0 --sticky --skip-taskbar --no-shrink &
    #exec ~/.cabal/bin/xmonad
    #sxhkd -c ~/.config/sxhkd/sxhkdrc &
    #exec bspwm
    DEFAULT_SESSION=xmonad
    case $2 in
    xmonad)
    stalonetray &
    compton --config ~/.config/compton.conf -cGb &
    exec xmonad
    openbox)
    exec openbox-session
    bspwm|*)
    sxhkd &
    [ -e "$PANEL_FIFO" ] && rm "$PANEL_FIFO"
    mkfifo "$PANEL_FIFO"
    exec bspwm -c /home/jordan/.config/bspwm/bspwmrc -s "$PANEL_FIFO" -p W
    esac
    ~/.config/bspwm/bspwmrc
    #! /bin/sh
    FIRST_DESK_MAIN=i
    REMAINING_DESKS_MAIN="ii iii iv v vi vii viii ix x"
    FIRST_DESK_SECONDARY=I
    REMAINING_DESKS_SECONDARY="II III IV V VI VII VIII IX X"
    #if [[ -z `xrandr | grep " connected" | grep 'VGA'` ]]; then
    # echo "No monitor connected"
    # bspc desktop Desktop01 -n $FIRST_DESK_MAIN
    # bspc monitor -a $REMAINING_DESKS_MAIN
    # bspc monitor -p 14 0 0 0
    #else
    bspc desktop Desktop01 -n $FIRST_DESK_MAIN
    bspc monitor -a $REMAINING_DESKS_MAIN
    bspc monitor -p 14 0 0 0
    bspc monitor -f next
    bspc desktop Desktop02 -n $FIRST_DESK_SECONDARY
    bspc monitor -a $REMAINING_DESKS_SECONDARY
    bspc monitor -p 0 0 0 0
    #fi
    bspc config split_ratio 0.52
    bspc config border_width 2
    bspc config window_gap 4
    bspc config borderless_monocle true
    bspc config gapless_monocle true
    bspc config focus_follows_pointer true
    bspc config auto_alternate true
    bspc config focused_border_color #646a6d
    bspc config normal_border_color #322d29
    bspc rule -a Thunar --floating
    bspc rule -a Skype --floating
    bspc rule -a Transmission --floating
    bspc rule -a feh --floating
    bspc rule -a Gimp -d Eight --floating
    panel &
    /home/jordan/.xmonad/status_bar "#d6c3b6" "#181512" "-*-nu-*-*-*-*-*-*-*-*-*-*-*-*" &
    ~/scripts/panel (added to path in ~/.profile)
    #! /bin/sh
    flavor=${1:-bar}
    bspc control --put-status
    xtitle -sf 'T%s' > "$PANEL_FIFO" &
    clock -sf 'S%a %H:%M' > "$PANEL_FIFO" &
    case "$flavor" in
    bar)
    cat "$PANEL_FIFO" | /home/jordan/scripts/panel_bar | bar
    dzen2)
    PANEL_HEIGHT=24
    FONT_FAMILY='DejaVu Sans'
    FONT_SIZE=11
    cat "$PANEL_FIFO" | panel_dzen2 -f "$FONT_FAMILY" -s "$FONT_SIZE" | dzen2 -h $PANEL_HEIGHT -dock -ta l -title-name panel -fn "${FONT_FAMILY}:pixelsize=${FONT_SIZE}" -fg "$COLOR_FOREGROUND" -bg "$COLOR_BACKGROUND"
    esac
    ~/.xmonad/status_bar
    #!/bin/bash
    foreground=$1
    background=$2
    font=$3
    conky -qc /home/jordan/.xmonad/.conky_dzen | dzen2 -x '500' -w '1420' -h '14' -ta 'r' -fg $foreground -bg $background -y '0' -fn $font
    ~/scripts/panel_bar
    #! /bin/sh
    # Example panel for LemonBoy's bar
    while read -r line ; do
    case $line in
    S*)
    sys_infos="\\r\\f5${line#?}\\fr"
    T*)
    title="\\c${line#?}"
    W*)
    wm_infos=""
    IFS=':'
    set -- ${line#?}
    while [ $# -gt 0 ] ; do
    item=$1
    name=${item#?}
    case $item in
    u*)
    # urgent desktop
    wm_infos="$wm_infos\\ f3 ${name}\\fr\\br"
    [DU]*)
    # active desktop
    wm_infos="$wm_infos\\u9\\f1 ${name} \\fr\\br\\ur"
    d*)
    # inactive but occupied desktop
    wm_infos="$wm_infos\\f2 ${name} \\fr"
    E*)
    # inactive desktop
    wm_infos="$wm_infos\\f0 ${name} \\fr"
    # L*)
    # # layout
    # layout=$(printf "%s" "${name}" | sed 's/\(.\).*/\U\1/')
    # wm_infos="$wm_infos \\b4\\f0$layout\\br\\fr"
    esac
    shift
    done
    esac
    printf "%s\n" "$wm_infos $title $sys_infos"
    done
    ~/scripts/panel_dzen2
    #! /bin/sh
    # Example panel for dzen2
    font_family='sans-serif'
    font_size=11
    . panel_colors
    adaptive_centering=0
    screen_width=$(sres -W)
    NORMIFS=$IFS
    FIELDIFS=':'
    PADDING=' '
    while getopts 'af:s:' opt ; do
    case "$opt" in
    a)
    adaptive_centering=1
    f)
    font_family=$OPTARG
    s)
    font_size=$OPTARG
    esac
    done
    shift $((OPTIND - 1))
    while read -r line ; do
    case $line in
    S*)
    # system informations
    sys_infos="^fg($COLOR_STATUS_FG)^bg($COLOR_STATUS_BG)^ca(1, bspc control --toggle-visibility)${PADDING}${line#?}${PADDING}^ca()^fg()^bg()${PADDING}"
    T*)
    # focused window title
    title="^fg($COLOR_TITLE_FG)^bg($COLOR_TITLE_BG)^ca(1, bspc window -t floating)^ca(2, bspc window -t locked)^ca(3, bspc window -c)${PADDING}${line#?}${PADDING}^ca()^ca()^ca()"
    W*)
    # window manager informations
    wm_infos="$PADDING"
    IFS=$FIELDIFS
    set -- ${line#?}
    while [ $# -gt 0 ] ; do
    item=$1
    case $item in
    [DdEUu]*)
    # desktops
    name=${item#?}
    case $item in
    u*)
    # urgent (inactive) desktop
    FG=$COLOR_URGENT_FG
    BG=$COLOR_URGENT_BG
    [DU]*)
    # active desktop
    FG=$COLOR_ACTIVE_FG
    BG=$COLOR_ACTIVE_BG
    d*)
    # inactive desktop
    FG=$COLOR_INACTIVE_FG
    BG=$COLOR_INACTIVE_BG
    E*)
    # empty desktop
    FG=$COLOR_EMPTY_FG
    BG=$COLOR_EMPTY_BG
    esac
    wm_infos="${wm_infos}^fg(${FG})^bg(${BG})^ca(1, bspc desktop -f ${name})^ca(2, bspc window -d ${name})^ca(3, bspc window -d ${name} -f)${PADDING}${name}${PADDING}^ca()^ca()^ca()"
    L*)
    # layout
    layout=$(printf "%s" "${item#?}" | sed 's/^\(.\).*/\U\1/')
    wm_infos="${wm_infos}^fg()^bg()${PADDING}${PADDING}^fg($COLOR_LAYOUT_FG)^bg($COLOR_LAYOUT_BG)^ca(1, bspc desktop -l next)^ca(2, bspc desktop -B)${PADDING}$layout${PADDING}^ca()^ca()"
    esac
    shift
    done
    IFS=$NORMIFS
    esac
    set -- $(printf '%s\0%s\0%s' "$wm_infos" "$title" "$sys_infos" | sed 's/\^[a-z]\+([^)]*)//g' | xargs -0 txtw -f "$font_family" -s "$font_size")
    left_width=$1
    center_width=$2
    right_width=$3
    left_indent=0
    right_indent=$((screen_width - right_width))
    available_center=$((screen_width - (left_width + right_width)))
    if [ $available_center -lt $center_width ] ; then
    center_indent=$((left_indent + left_width))
    else
    if [ $adaptive_centering -eq 1 ] ; then
    center_indent=$((left_width + (available_center - center_width) / 2))
    else
    center_indent=$(( (screen_width - center_width) / 2 ))
    fi
    fi
    printf "%s\n" "^pa($center_indent)$title^pa($left_indent)$wm_infos^pa($right_indent)$sys_infos"
    done
    ~/.bashrc
    # ~/.bashrc
    # If not running interactively, don't do anything
    [[ $- != *i* ]] && return
    alias ls='ls --color=auto'
    alias dir='dir --color=auto'
    alias vdir='vdir --color=auto'
    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
    pathdirs=(
    ~/scripts
    for dir in $pathdirs; do
    if [ -d $dir ]; then
    path+=$dir
    fi
    done
    export EDITOR="vim"
    PS1='[\u@\h \W]\$ '
    PROMPT_COMMAND='history -a'
    export LANGUAGE="en_AU:en_GB:en"
    alias n4="go-mtpfs /media/nexus"
    alias n4dc="sudo umount /media/nexus"
    Last edited by instantepiphany (2013-09-05 01:43:25)

    added that line to xinitrc, logged out and in and the bar starts now, and displays this
    The uppercase roman numerals should be on my second monitor, which is on the right(not pictured). The bar extends the whole way across both monitors, which it should, but as I said the uppercase numbers should be on the righthand monitor, and the current window title should be in the middle of each monitor(or just the one with an active/selected window, I am not sure which but I know it shouldn't be stretched across both).
    Also, if I try to run the dzen2 part of the case instance, I get
    [jordan@jordanpc-linux ~]$ panel dzen2
    /home/jordan/scripts/panel: line 6: : No such file or directory
    /home/jordan/scripts/panel: line 7: : No such file or directory
    cat: : No such file or directory
    dzen: error, cannot allocate color ''
    Making it the default within the file causes bspwm to start without a bar at all. I don't really mind whether I end up using bar or dzen2, as long as one works. I would however appreciate fixing both so I can learn why they aren't working.
    Last edited by instantepiphany (2013-09-04 14:07:45)

  • [Solved] Conky stock ticker script?

    Does anyone have a stock ticker script for Conky?
    Orjanp
    Last edited by orjanp (2009-01-29 22:07:24)

    Why not add an rss feed into conky, here's a link for that. http://howto.wikia.com/wiki/Howto_add_a … nky-rss.sh
    I'm sure there are plenty of stock feeds in rss format around.

  • [SOLVED] Getting a Shell Script to Email Me

    Hello everyone, I'm playing around with shell scripts trying to get the hang of getting them to email me. I'm playing around with this on my laptop, eventually I am going to try to have my server automate some tasks using cron and email me the status. As an experiment I'm just trying to get something simple like a list of packages emailed to myself. I googled around to come up with this script. I also installed postfix and set up the daemon to run. Here is my test script:
    #!/bin/bash
    # script to send simple email
    pacman -Qe > /tmp/packages.txt
    # email subject
    SUBJECT="Test subject"
    # Email To ?
    EMAIL="my.email.address"
    # Email text/message
    EMAILMESSAGE="/tmp/packages.txt"
    echo "This is an email message test"> $EMAILMESSAGE
    echo "This is email text" >>$EMAILMESSAGE
    # send an email using /bin/mail
    mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE
    rm /tmp/packages.txt
    However, I don't receive an email.
    Note: I withheld my email address above so I don't get spam, but it is in the script.
    Last edited by jlacroix (2011-04-11 17:43:01)

    discon wrote:I personally use "sendEmail" (http://aur.archlinux.org/packages.php?ID=7335) so I don't have to setup postfix etc. You may want to try with that to determine if it's a problem with your script or with your postfix installation.
    Thank you for that! I installed it and reviewed the documentation and was successful. If it helps anyone else, here is the code I used (after installing the package) to send myself an email of installed packages, which I can surely use to send myself any report I want:
    #!/bin/bash
    pacman -Qe > /tmp/packages.txt
    sendEmail -f [email protected] -t smtpusername -u Installed Packages on Computer Name -m These packages are currently installed: -a /tmp/packages.txt -s smtp.server.net:25 -xu smtpusername -xp smtppassword
    rm /tmp/packages.txt

  • [Solved] Change shell in script and keep child processes in new shell?

    Hi all,
    I have been trying to replicate the following in a script:
    # optirun bash
    # wine steam
    I have tried using
    optirun bash -c "command"
    but apparently wine spawns programs as a child process and then terminates which exits the bash shell with optirun on it.  Is there a way to keep the child processes inside the same shell too?
    Thanks!
    Last edited by b4bblefish (2013-03-04 00:50:45)

    Don't think so.  I have tried the nvidia fix for it, but it doesn't work, but that might be because i'm using the bumblebee-nvidia package
    https://wiki.archlinux.org/index.php/Bu … display_:8
    https://github.com/Bumblebee-Project/Bu … leshooting
    Last edited by b4bblefish (2013-03-03 20:19:08)

  • [SOLVED] Can't execute scripts with Thunar/XFCE. (Runs OK in terminal)

    Until recently, I could double-click a script (or link to a script) in Thunar or on the XFCE desktop, and it would execute
    Now, however, when I double-click a script, it opens in Leafpad (my text editor).  I've browsed the wiki and searched the forum and web, but can't find any clues as to what has changed or why this is happening.
    I can right-click in Thunar and use the "Open With>" option to set the script to open with another application, but there's no obvious option to run a script.  Opening with a terminal emulator results in a brief hourglass, then nothing.
    The script I'm testing with (the Tor Browser Bundle startup script) is in my /home/myname directory, has -rwx------ permissions (with me as the owner), and the file type in Thunar shows "shell script".  It runs fine if I execute it in a terminal with "sh /path/to/script" -- just not via Thunar or the XFCE desktop.
    Can anyone suggest anything I could check?
    Last edited by esuhl (2015-03-08 09:49:52)

    foutrelis wrote:
    This is an intended change in Thunar 1.6.5: https://bugzilla.xfce.org/show_bug.cgi?id=7596#c15
    Thunar 1.6.6 has a hidden option to restore the old behavior: http://git.xfce.org/xfce/thunar/commit/?id=b385bcf
    The option is called misc-exec-shell-scripts-by-default and can be set using xfce4-settings-editor or by following the instructions here:
    http://docs.xfce.org/xfce/thunar/hidden-settings
    Thanks so much for the explanation!
    I tried creating "misc-exec-shell-scripts-by-default" in the Settings Editor, set to true, but it didn't seem to have any effect.  So I tried this in a terminal, also to no effect:
    xfconf-query --channel thunar --property /misc-exec-shell-scripts-by-default --create --type bool --set true
    If I right-click on a script, the top item on the menu is still "Open with Leafpad".  Do I somehow need to change the default behaviour to "execute script"...?  I've searched but I can't seem to find any further information.
    I guess it's not a big deal, but it would be nice to restore the default behaviour.

Maybe you are looking for

  • Custom report and encrypted fields

    Hi, I am writing a report that display all the Database IT resources in OIM system along with their connection URL, there is no input to the report and the output is just the name of the It resource and URL. The report works fine but the result is en

  • Safari not displaying Arabic font

    In Firefox I am able to change the Fonts and Colors (Preferences>Content>Fonts and Colors) so Firefox will use an Arabic font (e.g. Geeza Pro) that works on pages with mixed English and Arabic text. I can't find how to do this in Safari. Right now it

  • Drop Box Question: Can you preserve the Creation/Mod Date when dropping?

    I transfer files across a 3-computer network and would like to preserve the dates, rather than having them reset to the current date and time when dropped. Is there a way to preserve this info?

  • Wirless connection has gotten slow

    My wireless has for the past week or so started to get significantly slow, measured decrease around 10x slower actually. Here's my setup: - Apple LED Cinema Display 24" running in clamshell mode (just got this screen last week) - Wireless Keyboard an

  • Streamed podcasts,itunes to ipod nano

    can you record a streamed download onto itunes in order to sync it to ipod nano