dotfiles

Luke's GNU/Linux dotfiles for i3, vim, ranger, bash, mpd, etc.
git clone git@git.lukesmith.xyz:dotfiles
Log | Files | Refs | README | LICENSE

commit eb6d0bd888dfdd4ce9845148fceec80883b17bcc
parent b57fa03b2f81d528d4bd86ddc50e193cd6c69078
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Wed, 18 Jul 2018 19:05:19 -0400

old scripts removed

Diffstat:
D.scripts/offlineimap-daemon.py | 93-------------------------------------------------------------------------------
D.scripts/offlineimap-daemonctl.sh | 41-----------------------------------------
D.scripts/screen.sh | 24------------------------
D.scripts/spawndl | 2--
R.scripts/tpb.sh -> .scripts/tpb | 0
D.scripts/transmission.sh | 7-------
D.scripts/welcome | 4----
7 files changed, 0 insertions(+), 171 deletions(-)

diff --git a/.scripts/offlineimap-daemon.py b/.scripts/offlineimap-daemon.py @@ -1,93 +0,0 @@ -#!/usr/bin/env python3 - -import subprocess -import signal -import threading -import sys - -import dbus -from dbus.mainloop.glib import DBusGMainLoop -from gi.repository import GLib - - -class OfflineimapCtl(object): - def __init__(self): - self.daemon_proc = None - self.run_ev = threading.Event() - self.run_daemon = False - - def run(self): - t = threading.Thread(target=self._watch_daemon, daemon=True) - t.start() - - def _watch_daemon(self): - while True: - self.run_ev.wait() - self.run_ev.clear() - if self.run_daemon: - self.is_running = True - print('offlineimap is being started') - self._spawn_daemon() - print('offlineimap has stopped') - self.run_ev.set() # check state and restart if needed - - def _spawn_daemon(self): - self.daemon_proc = subprocess.Popen(['offlineimap', '-u', 'basic'], shell=False) - self.daemon_proc.wait() - self.daemon_proc = None - - def start(self): - print('starting offlineimap') - self.run_daemon = True - self.run_ev.set() - - def stop(self): - print('stopping offlineimap') - self.run_daemon = False - if self.daemon_proc: - try: - self.daemon_proc.send_signal(signal.SIGUSR2) - except OSError: - print('Unable to stop offlineimap') - - def restart(self): - print('restarting offlineimap') - if self.run_daemon: - self.stop() - self.start() - - def onConnectivityChanged(self, state): - # 70 means fully connected - if state == 70: - self.start() - else: - self.stop() - -def main(): - oi_ctl = OfflineimapCtl() - oi_ctl.run() - - try: - bus = dbus.SystemBus(mainloop=DBusGMainLoop()) - network_manager = bus.get_object( - 'org.freedesktop.NetworkManager', - '/org/freedesktop/NetworkManager') - network = dbus.Interface(network_manager, - dbus_interface='org.freedesktop.NetworkManager') - - network.connect_to_signal('StateChanged', oi_ctl.onConnectivityChanged) - - # send current state as first event - state = network.state() - oi_ctl.onConnectivityChanged(state) - - except dbus.exceptions.DBusException: - print('Unable to connect to dbus') - sys.exit(3) - - # start receiving events from dbus - loop = GLib.MainLoop() - loop.run() - -if __name__ == '__main__': - main() diff --git a/.scripts/offlineimap-daemonctl.sh b/.scripts/offlineimap-daemonctl.sh @@ -1,40 +0,0 @@ -#!/bin/sh -# this script runs offline imap as daemon (configured to check periodically) - -LOG=~/.offlineimap/sync.log -PIDFILE=~/.offlineimap/pid - -# if not present on PATH, those vars must point to proper locations -THIS_SCRIPT=offlineimap-daemonctl.sh -PYTHON_DAEMON=offlineimap-daemon.py - -daemon(){ - $PYTHON_DAEMON 2>&1 | - # add timestamps to logs - (while read line; do - echo `date` "$line" >> $LOG - done) -} - -stop(){ - kill -USR2 `cat $PIDFILE` -} - -refresh(){ - kill -USR1 `cat $PIDFILE` -} - -case "$1" in - '--daemon' | '-d' ) - nohup $THIS_SCRIPT < /dev/null > /dev/null 2>&1 & - ;; - '--kill' | '-k' ) - stop - ;; - '--refresh' | '-r' ) - refresh - ;; - * ) - daemon - ;; -esac- \ No newline at end of file diff --git a/.scripts/screen.sh b/.scripts/screen.sh @@ -1,24 +0,0 @@ -#!/bin/bash - -#Feed this script either: -# "l" for laptop screen only, -# "v" for vga screen only, -# or "d" for dual vga/laptop. - -d() { if [[ $(xrandr -q | grep VGA1\ con) ]] - then param $1 - else echo "No VGA input detected." - fi ;} -dual() { xrandr --output LVDS1 --auto --output VGA1 --auto --right-of LVDS1 ;} -laptop() { xrandr --output LVDS1 --auto --output VGA1 --off ;} -vga() { xrandr --output VGA1 --auto --output LVDS1 --off ;} -#mirror() { xrandr --addmode VGA1 $lapres && xrandr --output LVDS1 --mode $lapres --output VGA1 --mode $lapres ;} - -param() { -case $1 in - d) dual ;; - v) vga ;; - l) laptop ;; - *) echo -e "Invalid parameter. Add one of the following:\n\"d\" for dualscreen laptop and VGA.\n\"l\" for laptop only\n\"v\" for VGA only." ;; -esac ;} -d $1 diff --git a/.scripts/spawndl b/.scripts/spawndl @@ -1,2 +0,0 @@ -#!/bin/bash -i3 exec "st -n dl -e youtube-dl $1" diff --git a/.scripts/tpb.sh b/.scripts/tpb diff --git a/.scripts/transmission.sh b/.scripts/transmission.sh @@ -1,7 +0,0 @@ -#!/bin/bash -if [ -f $(pgrep transmission) ]; - then - urxvt -e transmission-remote-cli - else - transmission-daemon && urxvt -e transmission-remote-cli -fi diff --git a/.scripts/welcome b/.scripts/welcome @@ -1,4 +0,0 @@ -#!/bin/bash -dialog --title "Welcome to LARBS!" --msgbox "If you're new to the system, hold down the Windows key and press F1 for a full tutorial! - -(This infobox will greet you at each login until you run the command \"hello-larbs\" in the terminal.)" 10 60