Restructing the entire dotfile repo!

This commit is contained in:
Derek Taylor
2019-01-15 15:27:01 -06:00
parent 57f834c56f
commit 2ff59758f1
131 changed files with 16150 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
tint2 &
compton &
nitrogen --restore &
rofi -show run &

755
.config/openbox/menu.xml Executable file
View File

@@ -0,0 +1,755 @@
<?xml version="1.0" encoding="utf-8"?>
<openbox_menu xmlns="http://openbox.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://openbox.org/ file:///usr/share/openbox/menu.xsd">
<menu id="root-menu" label="Openbox 3">
<menu id="root-menu-753414" label="Accessories">
<menu id="root-menu-753414-475139" label="Conky">
<menu id="root-menu-753414-475139-434521" label="Brownie">
<item label="Conky Darkness (Start)">
<action name="Execute">
<execute>/home/derek/.conky/conky_start_brownie</execute>
</action>
</item>
</menu>
<menu id="root-menu-753414-475139-87203" label="Rings">
<item label="Conky Rings (Start)">
<action name="Execute">
<execute>conky -c '/home/derek/.conky/Rings/.conkyrc'</execute>
</action>
</item>
<item label="Rings (Edit)">
<action name="Execute">
<execute>gedit /home/derek/.conky/Rings/.conkyrc</execute>
</action>
</item>
</menu>
<menu id="root-menu-753414-475139-195435" label="Electro">
<item label="Conky (start)">
<action name="Execute">
<execute>/home/derek/.conky/conky_start_electro</execute>
</action>
</item>
<item label="Conkyrc (edit)">
<action name="Execute">
<execute>geany ~/.conky/electro/electro-1366.conkyrc</execute>
</action>
</item>
</menu>
<item label="Conky (Kill All)">
<action name="Execute">
<execute>
killall conky
</execute>
</action>
</item>
</menu>
<item label="Archive Manager">
<action name="Execute">
<command>
<![CDATA[file-roller]]>
</command>
</action>
</item>
<item label="Calculator">
<action name="Execute">
<execute>galculator</execute>
</action>
</item>
<item label="Character Map">
<action name="Execute">
<execute>
gucharmap
</execute>
</action>
</item>
<item label="Font Viewer">
<action name="Execute">
<command>
<![CDATA[gnome-font-viewer]]>
</command>
</action>
</item>
<item label="Leafpad">
<action name="Execute">
<execute>leafpad</execute>
</action>
</item>
<item label="ProRealTime">
<action name="Execute">
<execute>java -jar '/home/derek/PRT_Launcher.jar'</execute>
</action>
</item>
<item label="Take Screenshot">
<action name="Execute">
<execute>scrot</execute>
</action>
</item>
<item label="Terminal">
<action name="Execute">
<execute>
x-terminal-emulator
</execute>
</action>
</item>
<item label="Thinkorswim">
<action name="Execute">
<execute>/bin/sh /home/derek/thinkorswim.desktop</execute>
</action>
</item>
<item label="Tint2 (start)">
<action name="Execute">
<execute>tint2</execute>
</action>
</item>
<item label="Tint2 (killall)">
<action name="Execute">
<execute>
killall tint2
</execute>
</action>
</item>
</menu>
<menu id="root-menu-703427" label="Games">
<menu execute="~/.config/openbox/pipemenus/steam.sh" id="steam" label="Steam"/>
<item label="0 A.D.">
<action name="Execute">
<execute>0ad</execute>
</action>
</item>
<item label="AisleRiot Solitaire">
<action name="Execute">
<execute>
/usr/games/sol
</execute>
</action>
</item>
<item label="Mahjongg">
<action name="Execute">
<command>
<![CDATA[gnome-mahjongg]]>
</command>
</action>
</item>
<item label="Mines">
<action name="Execute">
<command>
<![CDATA[gnome-mines]]>
</command>
</action>
</item>
<item label="Sudoku">
<action name="Execute">
<execute>
/usr/games/gnome-sudoku
</execute>
</action>
</item>
<item label="SuperTuxKart">
<action name="Execute">
<execute>supertuxkart</execute>
</action>
</item>
<item label="Xonotic">
<action name="Execute">
<execute>'/home/derek/Games/Xonotic/xonotic-linux64-glx'</execute>
</action>
</item>
</menu>
<menu id="root-menu-763440" label="Graphics">
<item label="Gimp">
<action name="Execute">
<execute>
gimp
</execute>
</action>
</item>
<item label="ImageMagick (display)">
<action name="Execute">
<command>
<![CDATA[/usr/bin/display.im6]]>
</command>
</action>
</item>
<item label="Image Viewer">
<action name="Execute">
<execute>ristretto</execute>
</action>
</item>
<item label="Inkscape">
<action name="Execute">
<execute>inkscape</execute>
</action>
</item>
<item label="LibreOffice Drawing">
<action name="Execute">
<execute>libreoffice -draw</execute>
</action>
</item>
<item label="LRF Viewer">
<action name="Execute">
<command>
<![CDATA[lrfviewer]]>
</command>
</action>
</item>
<item label="Shotwell Photo Manager">
<action name="Execute">
<execute>
shotwell
</execute>
</action>
</item>
<item label="Simple Scan">
<action name="Execute">
<execute>
simple-scan
</execute>
</action>
</item>
</menu>
<menu id="root-menu-273054" label="Internet">
<item label="Canto RSS Reader">
<action name="Execute">
<execute>termite -e 'canto-curses' -t 'Canto RSS Reader' </execute>
</action>
</item>
<item label="Deluge">
<action name="Execute">
<execute>deluge</execute>
</action>
</item>
<item label="Discord">
<action name="Execute">
<execute>discord</execute>
</action>
</item>
<item label="Dropbox">
<action name="Execute">
<execute>dropbox start -i</execute>
</action>
</item>
<item label="FileZilla">
<action name="Execute">
<execute>
filezilla
</execute>
</action>
</item>
<item label="Firefox">
<action name="Execute">
<execute>
firefox
</execute>
</action>
</item>
<item label="Irssi IRC">
<action name="Execute">
<execute>termite -e 'irssi' -t 'irssi'</execute>
</action>
</item>
<item label="Lynx">
<action name="Execute">
<execute>termite -e 'lynx www.google.com' -t 'lynx web browser'</execute>
</action>
</item>
<item label="Mutt Email">
<action name="Execute">
<execute>termite -e 'mutt' -t 'mutt email'</execute>
</action>
</item>
<item label="TeamViewer">
<action name="Execute">
<execute>teamviewer</execute>
</action>
</item>
<item label="Thunderbird">
<action name="Execute">
<execute>
thunderbird
</execute>
</action>
</item>
</menu>
<menu id="root-menu-47033" label="Programming">
<item label="Geany">
<action name="Execute">
<execute>geany</execute>
</action>
</item>
<item label="Netbeans">
<action name="Execute">
<execute>/bin/sh '/home/derek/netbeans-8.0.2/bin/netbeans'</execute>
</action>
</item>
<item label="phpMyAdmin">
<action name="Execute">
<execute>sensible-browser http://localhost/phpmyadmin/</execute>
</action>
</item>
<item label="Python3 in Terminal">
<action name="Execute">
<execute>x-terminal-emulator -e python3</execute>
</action>
</item>
</menu>
<menu id="root-menu-135857" label="Office">
<item label="Calibre">
<action name="Execute">
<command>
<![CDATA[calibre]]>
</command>
</action>
</item>
<item label="Document Viewer">
<action name="Execute">
<command>
<![CDATA[evince]]>
</command>
</action>
</item>
<item label="LibreOffice Calc">
<action name="Execute">
<command>
<![CDATA[libreoffice --calc]]>
</command>
</action>
</item>
<item label="LibreOffice Draw">
<action name="Execute">
<command>
<![CDATA[libreoffice --draw]]>
</command>
</action>
</item>
<item label="LibreOffice Impress">
<action name="Execute">
<command>
<![CDATA[libreoffice --impress]]>
</command>
</action>
</item>
<item label="LibreOffice Math">
<action name="Execute">
<command>
<![CDATA[libreoffice --math]]>
</command>
</action>
</item>
<item label="LibreOffice Writer">
<action name="Execute">
<command>
<![CDATA[libreoffice --writer]]>
</command>
</action>
</item>
</menu>
<menu id="root-menu-943454" label="Sound &amp; Video">
<item label="AlsaMixer">
<action name="Execute">
<execute>termite -e 'alsamixer' -t 'alsamixer'</execute>
</action>
</item>
<item label="Anoise ">
<action name="Execute">
<execute>anoise</execute>
</action>
</item>
<item label="Audacity">
<action name="Execute">
<execute>audacity</execute>
</action>
</item>
<item label="Deadbeef">
<action name="Execute">
<execute>deadbeef</execute>
</action>
</item>
<item label="Guvcview">
<action name="Execute">
<execute>guvcview</execute>
</action>
</item>
<item label="K3b Burner">
<action name="Execute">
<execute>
k3b
</execute>
</action>
</item>
<item label="Kdenlive">
<action name="Execute">
<execute>kdenlive</execute>
</action>
</item>
<item label="Open Broadcaster Software">
<action name="Execute">
<execute>obs</execute>
</action>
</item>
<item label="Pulse Audio Volume Control">
<action name="Execute">
<execute>pavucontrol</execute>
</action>
</item>
<item label="Pithos">
<action name="Execute">
<execute>pithos</execute>
</action>
</item>
<item label="Simple Screen Recorder">
<action name="Execute">
<execute>simplescreenrecorder</execute>
</action>
</item>
<item label="VLC">
<action name="Execute">
<execute>
vlc
</execute>
</action>
</item>
</menu>
<!-- This requires the presence of the 'menu' package to work -->
<separator/>
<menu id="root-menu-151830" label="Places">
<item label="Home">
<action name="Execute">
<execute>pcmanfm -n ~/</execute>
</action>
</item>
<item label="Desktop">
<action name="Execute">
<execute>pcmanfm -n ~/Desktop</execute>
</action>
</item>
<item label="File System">
<action name="Execute">
<execute>pcmanfm -n /</execute>
</action>
</item>
<separator/>
<item label="Backgrounds">
<action name="Execute">
<execute>pcmanfm -n ~/Backgrounds</execute>
</action>
</item>
<item label="Documents">
<action name="Execute">
<execute>pcmanfm -n ~/Documents</execute>
</action>
</item>
<item label="Downloads">
<action name="Execute">
<execute>pcmanfm -n ~/Downloads</execute>
</action>
</item>
<item label="Dropbox">
<action name="Execute">
<execute>pcmanfm -n ~/Dropbox</execute>
</action>
</item>
<item label="Music">
<action name="Execute">
<execute>pcmanfm -n ~/Music</execute>
</action>
</item>
<item label="Pictures">
<action name="Execute">
<execute>pcmanfm -n ~/Pictures</execute>
</action>
</item>
<item label="Videos">
<action name="Execute">
<execute>pcmanfm -n ~/Videos</execute>
</action>
</item>
<separator/>
<item label="Computer">
<action name="Execute">
<execute>pcmanfm -n computer:///</execute>
</action>
</item>
<item label="Network">
<action name="Execute">
<execute>pcmanfm -n network:///</execute>
</action>
</item>
<item label="Trash">
<action name="Execute">
<execute>pcmanfm -n trash:///</execute>
</action>
</item>
</menu>
<menu id="client-list-menu"/>
<menu execute="~/.config/openbox/pipemenus/obrecent.sh" id="recent" label="Recent Files"/>
<separator/>
<menu id="root-menu-454721" label="Administration">
<menu id="root-menu-454721-901149" label="System Monitoring">
<item label="Glances">
<action name="Execute">
<execute>termite -e 'glances' -t 'glances'</execute>
</action>
</item>
<item label="Htop">
<action name="Execute">
<execute>termite -e 'htop' -t 'htop'</execute>
</action>
</item>
<item label="Nmon">
<action name="Execute">
<execute>termite -e 'nmon' -t 'nmon'</execute>
</action>
</item>
<item label="Stacer">
<action name="Execute">
<execute>stacer</execute>
</action>
</item>
<item label="Stress Terminal UI">
<action name="Execute">
<execute>termite -e 's-tui' -t 'Stress Terminal UI'</execute>
</action>
</item>
</menu>
<item label="Network Connections">
<action name="Execute">
<command>
<![CDATA[nm-connection-editor]]>
</command>
</action>
</item>
<item label="Nvidia Settings">
<action name="Execute">
<execute>/usr/bin/nvidia-settings</execute>
</action>
</item>
<item label="Octopi">
<action name="Execute">
<execute>gksu octopi</execute>
</action>
</item>
<item label="Openbox Config">
<action name="Execute">
<execute>
obconf
</execute>
</action>
</item>
<item label="Openbox Menu">
<action name="Execute">
<execute>
obmenu
</execute>
</action>
</item>
<item label="Printing">
<action name="Execute">
<execute>
system-config-printer
</execute>
</action>
</item>
<item label="Ranger">
<action name="Execute">
<execute>termite -e 'ranger' -t 'ranger file manager'</execute>
</action>
</item>
<item label="Startup Disk Creator">
<action name="Execute">
<execute>
usb-creator-gtk
</execute>
</action>
</item>
<item label="SUSE Studio Imagewriter">
<action name="Execute">
<execute>imagewriter %f</execute>
</action>
</item>
<item label="Timeshift">
<action name="Execute">
<execute>gksu timeshift-launcher</execute>
</action>
</item>
<item label="Xdiagnose">
<action name="Execute">
<execute>gksu pkexec xdiagnose</execute>
</action>
</item>
<item label="Users and Groups">
<action name="Execute">
<execute>
users-admin
</execute>
</action>
</item>
</menu>
<menu id="root-menu-604715" label="Preferences">
<item label="Activity Log Manager">
<action name="Execute">
<command>
<![CDATA[activity-log-manager]]>
</command>
</action>
</item>
<item label="Appearance">
<action name="Execute">
<execute>
lxappearance
</execute>
</action>
</item>
<item label="Backups">
<action name="Execute">
<command>
<![CDATA[deja-dup-preferences]]>
</command>
</action>
</item>
<item label="Disk Usage Analyzer">
<action name="Execute">
<execute>
baobab
</execute>
</action>
</item>
<item label="Disks Utility">
<action name="Execute">
<command>
<![CDATA[gnome-disks]]>
</command>
</action>
</item>
<item label="Font Viewer">
<action name="Execute">
<execute>gnome-font-viewer</execute>
</action>
</item>
<item label="IBus Preferences">
<action name="Execute">
<execute>
ibus-setup
</execute>
</action>
</item>
<item label="Input Method">
<action name="Execute">
<execute>im-config</execute>
</action>
</item>
<item label="Main Menu">
<action name="Execute">
<execute>
alacarte
</execute>
</action>
</item>
<item label="Nitrogen Wallpaper">
<action name="Execute">
<execute>nitrogen</execute>
</action>
</item>
<item label="Passwords and Keys">
<action name="Execute">
<execute>/usr/bin/seahorse</execute>
</action>
</item>
<item label="Personal File Sharing">
<action name="Execute">
<execute>
gnome-file-share-properties
</execute>
</action>
</item>
<item label="Remote Desktop Preferences">
<action name="Execute">
<execute>
vino-preferences
</execute>
</action>
</item>
<item label="Rofi Theme Selector">
<action name="Execute">
<execute>rofi-theme-selector</execute>
</action>
</item>
<item label="Screensaver">
<action name="Execute">
<execute>xscreensaver-demo</execute>
</action>
</item>
</menu>
<menu id="root-menu-46598" label="Config Files">
<item label="Bash RC">
<action name="Execute">
<execute>termite -e 'vim ~/.bashrc' -t 'Bash RC'</execute>
</action>
</item>
<item label="Canto Conf">
<action name="Execute">
<execute>termite -e 'vim ~/.config/canto/conf' -t 'Canto Conf'</execute>
</action>
</item>
<item label="Compton">
<action name="Execute">
<execute>termite -e 'vim ~/.config/compton/compton.conf' -t 'Compton Conf'</execute>
</action>
</item>
<item label="Irssi">
<action name="Execute">
<execute>termite -e 'vim ~/.irssi/config' -t 'Irssi Conf'</execute>
</action>
</item>
<item label="Qtile Config">
<action name="Execute">
<execute>termite -e 'vim ~/.config/qtile/config.py' -t 'qtile config.py'</execute>
</action>
</item>
<item label="Termite Config">
<action name="Execute">
<execute>termite -e 'vim ~/.config/termite/config' -t 'Termite Config'</execute>
</action>
</item>
<item label="Xmonad Config">
<action name="Execute">
<execute>termite -e 'vim ~/.xmonad/xmonad.hs' -t 'xmonad.hs'</execute>
</action>
</item>
<item label="Xresources">
<action name="Execute">
<execute>termite -e 'vim ~/.Xresources' -t 'Xresrouces'</execute>
</action>
</item>
<item label="Zsh RC">
<action name="Execute">
<execute>termite -e 'vim ~/.zshrc' -t 'Zsh RC'</execute>
</action>
</item>
</menu>
<separator/>
<menu execute="~/.config/openbox/pipemenus/deadbeef.sh" id="Music Player" label="Music Player"/>
<separator/>
<menu execute="~/.config/openbox/pipemenus/shell-color-scripts.sh" id="shell-color-scripts" label="Color Scripts"/>
<menu execute="~/.config/openbox/pipemenus/sysinfo.py" id="sysinfo" label="System Info"/>
<menu execute="~/.config/openbox/pipemenus/date-menu.py" id="datetime" label="Time and Date"/>
<menu execute="~/.config/openbox/pipemenus/virtualbox.sh" id="virtualbox" label="VirtualBox"/>
<separator/>
<item label="Rofi">
<action name="Execute">
<execute>rofi -show drun</execute>
</action>
</item>
<item label="Terminal">
<action name="Execute">
<execute>termite</execute>
</action>
</item>
<item label="Web Browser">
<action name="Execute">
<execute>firefox</execute>
</action>
</item>
<item label="Exit">
<action name="Exit"/>
</item>
</menu>
</openbox_menu>

View File

@@ -0,0 +1,42 @@
#!/usr/bin/env python3
#
# DATE-MENU by Derek Taylor (DistroTube)
# A simple python script that creates an openbox pipemenu that displays time and date.
# This program is free software: you can redistribute it and/or modify it under the terms of
# the GNU General Public License version 3 as published by the Free Software Foundation.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see: http://www.gnu.org/licenses
# Copy this file somewhere on your path and make it executable.
# Add the following line somewhere to your /.config/openbox/menu.xml
# <menu execute="/PATH/TO/date-menu.py" id="datetime" label="Time and Date"/>
# Be sure to change the PATH/TO to the correct path to this file.
# Reconfigure openbox.
# SETTINGS
import datetime
dt = datetime.datetime.now()
theDate = dt.strftime('%A, %B %d, %Y')
theTime = dt.strftime('%I:%M %p %Z')
theDay = dt.strftime('%j')
theWeek = dt.strftime('%U')
# OPENBOX PIPEMENU
print ('<?xml version=\"1.0\" encoding=\"UTF-8\"?>')
print ('<openbox_pipe_menu>')
print ('<separator />')
print ('<item label="DATE AND TIME" />')
print ('<separator />')
print ('<item label="'+theTime+'"/>')
print ('<item label="'+theDate+'"/>')
print ('<item label="'+'Day '+theDay+'"/>')
print ('<item label="'+'Week '+theWeek+'"/>')
print ('</openbox_pipe_menu>')

View File

@@ -0,0 +1,51 @@
#! /bin/bash
#
# DEADBEEF by Derek Taylor (DistroTube)
# A simple script that creates an openbox pipemenu that controls the deadbeef music player.
#
# This program is free software: you can redistribute it and/or modify it under the terms of
# the GNU General Public License version 3 as published by the Free Software Foundation.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see: http://www.gnu.org/licenses
#
# Copy this file somewhere on your path and make it executable.
# Add the following line somewhere to your /.config/openbox/menu.xml
# <menu execute="/PATH/TO/deadbeef.sh" id="Music Player" label="Music Player"/>
# Be sure to change the PATH/TO to the correct path to this file.
#
# Reconfigure openbox.
#
# REQUIRES the Deadbeef music player to be installed on your computer.
nowplaying=`deadbeef --nowplaying "%n %a - %t - %b - %y" | sed -n '1p' | tr -d '"'`
tracktime=`deadbeef --nowplaying "%l" | sed -n '1p'`
playlist_dir=`/home/derek/.config/deadbeef/playlists/`
playlist_num=`ls -l /home/derek/.config/deadbeef/playlists/* | wc -l | sed -n '1p'`
echo "<openbox_pipe_menu>"
echo "<menu id=\"root-menu-325671\" label=\""Track Info"\">"
echo "<item label=\""$nowplaying"\"><action name=\"Execute\"><execute>deadbeef</execute></action></item>"
echo "<item label=\"Total Runtime: "$tracktime"\"><action name=\"Execute\"><execute>deadbeef</execute></action></item>"
echo "<separator/>"
echo "<item label=\"Open Music Player\"><action name=\"Execute\"><execute>deadbeef</execute></action></item>"
echo "</menu>"
echo "<menu id=\"root-menu-325676\" label=\"Playlists ($playlist_num)\">"
for file in $(ls /home/derek/.config/deadbeef/playlists/*.dbpl -1v); do
NAME=$(echo "$file" | rev | cut -d"/" -f1 | rev)
echo "<item label=\"$NAME\"><action name=\"Execute\"><execute>deadbeef $file</execute></action></item>"
done
echo "</menu>"
echo "<separator/>"
echo "<item label=\"Play\"><action name=\"Execute\"><execute>deadbeef --play</execute></action></item>"
echo "<item label=\"Pause\"><action name=\"Execute\"><execute>deadbeef --pause</execute></action></item>"
echo "<item label=\"Stop\"><action name=\"Execute\"><execute>deadbeef --stop</execute></action></item>"
echo "<item label=\"Next\"><action name=\"Execute\"><execute>deadbeef --next</execute></action></item>"
echo "<item label=\"Previous\"><action name=\"Execute\"><execute>deadbeef --prev</execute></action></item>"
echo "<separator/>"
echo "<item label=\"Quit\"><action name=\"Execute\"><execute>deadbeef --quit</execute></action></item>"
echo "</openbox_pipe_menu>"

View File

@@ -0,0 +1,97 @@
#!/usr/bin/env python3
#
# GMUISCBROWSER by Derek Taylor (DistroTube)
# A simple script that creates an openbox pipemenu that controls gmusicbrowser.
#
# This program is free software: you can redistribute it and/or modify it under the terms of
# the GNU General Public License version 3 as published by the Free Software Foundation.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see: http://www.gnu.org/licenses
#
# Copy this file somewhere on your path and make it executable.
# Add the following line somewhere to your /.config/openbox/menu.xml
# <menu execute="/PATH/TO/gmusicbrowser.sh" id="gmusicbrowser" label="gmusicbrowser"/>
# Be sure to change the PATH/TO to the correct path to this file.
#
# Reconfigure openbox.
#
# REQUIRES the gmusicbrowser music player to be installed on your computer.
# The playlist submenu is designed to pull all .m3u files from the ~home/$USER/.config/gmusicbrowser/ directory.
# Therefore, you must create this folder and export your playlists to this folder.
# To enable song information to display, you must enable the NOW PLAYHING plugin in gmusicbrowser.
# Add this to "command for when playing song changed": tee /home/$USER/.config/gmusicbrowser/nowplaying.info
# Change $USER to your actual username. Tick the checkbox for send title/artist/album in standard input.
# You also should go to Preferences > Misc. and tick the checkbox for remember playing position between sessions.
# This allows gmusicbrowser to remember the song it was playing within the playlist upon exit.
# SETTING
import subprocess
import os
playlistDir = '/home/derek/.config/gmusicbrowser/'
cmd1 = "cat /home/derek/.config/gmusicbrowser/*.info | sed -n -e 's/^.*Title=//p' | tr -d '\"'"
process = subprocess.Popen(cmd1, stdout=subprocess.PIPE, shell=True)
songTitle = process.communicate()[0].decode("utf-8").rstrip()
cmd2 = "cat /home/derek/.config/gmusicbrowser/*.info | sed -n -e 's/^.*Artist=//p' | tr -d '\"'"
process = subprocess.Popen(cmd2, stdout=subprocess.PIPE, shell=True)
songArtist = process.communicate()[0].decode("utf-8").rstrip()
cmd3 = "cat /home/derek/.config/gmusicbrowser/*.info | sed -n -e 's/^.*Album=//p' | tr -d '\"'"
process = subprocess.Popen(cmd3, stdout=subprocess.PIPE, shell=True)
songAlbum = process.communicate()[0].decode("utf-8").rstrip()
cmd4 = "cat /home/derek/.config/gmusicbrowser/*.info | sed -n -e 's/^.*Length=//p' | tr -d '\"'"
process = subprocess.Popen(cmd4, stdout=subprocess.PIPE, shell=True)
songLength = process.communicate()[0].decode("utf-8").rstrip()
cmd5 = "cat /home/derek/.config/gmusicbrowser/*.info | sed -n -e 's/^.*Year=//p' | tr -d '\"'"
process = subprocess.Popen(cmd5, stdout=subprocess.PIPE, shell=True)
songYear = process.communicate()[0].decode("utf-8").rstrip()
cmd6 = "cat /home/derek/.config/gmusicbrowser/*.info | sed -n -e 's/^.*Track=//p' | tr -d '\"'"
process = subprocess.Popen(cmd6, stdout=subprocess.PIPE, shell=True)
songTrack = process.communicate()[0].decode("utf-8").rstrip()
cmd7 = "ls -l /home/derek/.config/gmusicbrowser/*m3u | wc -l | sed -n '1p'"
process = subprocess.Popen(cmd7, stdout=subprocess.PIPE, shell=True)
playlistNum = process.communicate()[0].decode("utf-8").rstrip()
# OPENBOX PIPEMENU
print ('<?xml version=\"1.0\" encoding=\"UTF-8\"?>')
print ('<openbox_pipe_menu>')
print ('<menu id=\"root-menu-325671\" label=\"Track Info\">')
print ('<item label="'+songTitle+' - '+songArtist+' - '+songAlbum+' ('+songYear+')'+'"><action name=\"Execute\"><execute>gmusicbrowser -cmd PlayPause</execute></action></item>')
print ('<item label="'+'Total Runtime: '+songLength+'"><action name=\"Execute\"><execute>gmusicbrowser -cmd PlayPause</execute></action></item>')
print ('<separator/>')
print ('<item label=\"Open gmusicbrowser\"><action name=\"Execute\"><execute>gmusicbrowser -cmd</execute></action></item>')
print ('</menu>')
print ('<menu id=\"root-menu-325676\" label=\"Playlists ('+playlistNum+')\">')
for filename in os.listdir('/home/derek/.config/gmusicbrowser/'):
plist = "echo "+filename+" | rev | cut -d\"/\" -f1 | rev"
process = subprocess.Popen(plist, stdout=subprocess.PIPE, shell=True)
playlist = process.communicate()[0].decode("utf-8").rstrip()
if playlist.endswith(".m3u"):
print ('<item label="'+playlist+'"><action name=\"Execute\"><execute>gmusicbrowser '+playlistDir+filename+'</execute></action></item>')
print ('</menu>')
print ('<separator/>')
print ('<item label=\"Play\"><action name=\"Execute\"><execute>gmusicbrowser -cmd Play</execute></action></item>')
print ('<item label=\"Pause\"><action name=\"Execute\"><execute>gmusicbrowser -cmd Pause</execute></action></item>')
print ('<item label=\"Stop\"><action name=\"Execute\"><execute>gmusicbrowser -cmd Stop</execute></action></item>')
print ('<item label=\"Next\"><action name=\"Execute\"><execute>gmusicbrowser -cmd NextSong</execute></action></item>')
print ('<item label=\"Previous\"><action name=\"Execute\"><execute>gmusicbrowser -cmd PrevSong</execute></action></item>')
print ('<separator/>')
print ('<item label=\"Volume Up\"><action name=\"Execute\"><execute>gmusicbrowser -cmd IncVolume</execute></action></item>')
print ('<item label=\"Volume Down\"><action name=\"Execute\"><execute>gmusicbrowser -cmd DecVolume</execute></action></item>')
print ('<separator/>')
print ('<item label=\"Show/Hide\"><action name=\"Execute\"><execute>gmusicbrowser -cmd ShowHide</execute></action></item>')
print ('<item label=\"Quit\"><action name=\"Execute\"><execute>gmusicbrowser -cmd Quit</execute></action></item>')
print ('</openbox_pipe_menu>')

View File

@@ -0,0 +1,95 @@
#!/bin/sh
# mpcob - control mpc in your openbox menu
# 02/03/10 - supulton - vrfeight3@gmail.com
# chmod +x mpcob.sh, and place:
# "<menu id="pipe-mpc-menu" label="music" execute="/path/to/script/mpcob.sh" />"
# somewhere in your menu.
# replace "urxvtc" with your preferred terminal
set_term=`echo urxvt`
# gui mpd preference?
set_player=`echo ncmpcpp`
#set variables
playing=`mpc -f "%track%. %artist% - %title%" | sed -n '1p'`
nowstatus=`mpc | sed -n '2p' | cut -d ' ' -f1`
repeat=`mpc | tail -n 1 | cut -c 15-25`
random=`mpc | tail -n 1 | cut -c 29-39`
single=`mpc | tail -n 1 | cut -c 43-53`
consume=`mpc | tail -n 1 | cut -c 57-`
# tell when mpc is stopped
if [ "$nowstatus" != "[Playing]" -a "$nowstatus" != "[Paused]" ]
then
export nowstatus=`echo "[Stopped]"`
fi
if [ "$nowstatus" = "[Stopped]" ]
then
export Playing=`echo Play`
fi
# convert reserved XML characters '&', '<', '>', '"' for songs containing characters
if [[ $playing =~ '&' ]]
then
export playing=${playing//\&/\&amp\;}
fi
if [[ $playing =~ '<' ]]
then
export playing=${playing//\</\&lt\;}
fi
if [[ $playing =~ '>' ]]
then
export playing=${playing//\>/\&gt\;}
fi
if [[ $playing =~ '"' ]]
then
export playing=${playing//\"/\&quot\;}
fi
# echo menu
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
echo "<openbox_pipe_menu>"
echo " <menu id=\"mpcob-playing\" label=\"$nowstatus\">"
echo " <item label=\"$playing\"> "
echo " <action name=\"Execute\"><execute>mpc toggle</execute></action>"
echo " </item>"
echo " <separator />"
echo " <item label=\"$set_player\"> "
echo " <action name=\"Execute\"><execute>urxvt -e ncmpcpp</execute></action>"
echo " </item>"
echo " </menu>"
echo " <separator />"
echo " <item label=\"Play/Pause\">"
echo " <action name=\"Execute\"><execute>mpc toggle</execute></action>"
echo " </item>"
echo " <item label=\"Prev\">"
echo " <action name=\"Execute\"><execute>mpc prev</execute></action>"
echo " </item>"
echo " <item label=\"Next\">"
echo " <action name=\"Execute\"><execute>mpc next</execute></action>"
echo " </item>"
echo " <item label=\"Stop\">"
echo " <action name=\"Execute\"><execute>mpc stop</execute></action>"
echo " </item>"
echo " <separator />"
echo " <menu id=\"mpcob-options\" label=\"Options\">"
echo " <item label=\"$random\">"
echo " <action name=\"Execute\"><execute>mpc random</execute></action>"
echo " </item>"
echo " <item label=\"$repeat\">"
echo " <action name=\"Execute\"><execute>mpc repeat</execute></action>"
echo " </item>"
echo " <item label=\"$consume\">"
echo " <action name=\"Execute\"><execute>mpc consume</execute></action>"
echo " </item>"
echo " <item label=\"$single\">"
echo " <action name=\"Execute\"><execute>mpc single</execute></action>"
echo " </item>"
echo " <separator />"
echo " <item label=\"Update\">"
echo " <action name=\"Execute\"><execute>mpc update</execute></action>"
echo " </item>"
echo " </menu>"
echo "</openbox_pipe_menu>"

View File

@@ -0,0 +1,68 @@
#! /bin/bash
# MPD/MPC by olshrimpeyes
nowplaying=`mpc -f "%track%. %artist% - %title%" | sed -n '1p'`
playing=`mpc | grep playing `
nowstatus=`mpc | sed -n '2p' | cut -d ' ' -f1`
echo "<openbox_pipe_menu>"
# <menu icon="/home/derek/.config/openbox/circle-filled.png" id="root-menu-151830" label="Places">
# <item icon="/home/derek/.config/openbox/square-open.png" label="Home">
# <action name="Execute">
# <execute>pcmanfm -n ~/</execute>
# </action>
# </item>
# </menu>
if [[ -z $nowplaying ]]
then
echo "<item label=\"Not Playing\"><action name=\"Execute\"><execute>mpc</execute></action></item>"
else
echo "<menu icon=\"/home/derek/.config/openbox/circle-filled.png\" id=\"root-menu-325671\" label=\""$nowstatus"\">"
echo "<item label=\""$nowplaying"\"><action name=\"Execute\"><execute>mpc</execute></action></item>"
echo "<item label=\""$playing"\"><action name=\"Execute\"><execute>mpc</execute></action></item>"
echo "<separator/>"
echo "<item label=\"Open Music Player\"><action name=\"Execute\"><execute>urxvt -e ncmpcpp</execute></action></item>"
echo "</menu>"
# if [[ -z $playing ]]
# then
# echo "<item label=\"Paused\"><action name=\"Execute\"><execute>mpc</execute></action></item>"
# else
# echo "<item label=\""$playing"\"><action name=\"Execute\"><execute>mpc</execute></action></item>"
# fi
fi
echo "<separator/>"
if [[ -z $playing ]]
then
echo "<item label=\"Play\"><action name=\"Execute\"><execute>mpc play</execute></action></item>"
else
echo "<item label=\"Pause\"><action name=\"Execute\"><execute>mpc pause</execute></action></item>"
echo "<item label=\"Stop\"><action name=\"Execute\"><execute>mpc stop</execute></action></item>"
fi
echo "<item label=\"Next\"><action name=\"Execute\"><execute>mpc next</execute></action></item>"
echo "<item label=\"Previous\"><action name=\"Execute\"><execute>mpc prev</execute></action></item>"
echo "<item label=\"Volume\"><action name=\"Execute\"><execute>urxvt -e alsamixer</execute></action></item>"
echo "</openbox_pipe_menu>"

View File

@@ -0,0 +1,22 @@
From Openbox
Jump to: navigation, search
#!/bin/sh
echo "<openbox_pipe_menu>"
files=$(
cat ~/.local/share/recently-used.xbel | grep file:/// | tail -n15 | cut -d "\"" -f 2 | tac | while read line;
do
file=$(echo "$line")
name=$(echo -en "$file" | sed 's,.*/,,' | sed 's/%20/ /g')
echo "<item label=\"$name\">
<action name=\"Execute\"><command>xdg-open $line</command></action>
</item>"
done);
echo "$files"
echo "<separator />"
echo "<item label=\"Clear Recent Documents\">
<action name=\"Execute\"><command>rm ~/.local/share/recently-used.xbel</command></action>
</item>"
echo "</openbox_pipe_menu>"

View File

@@ -0,0 +1,183 @@
#!/bin/sh
# cb-places-pipemenu - a places openbox pipe menu
# Copyright (C) 2010 John Crawley
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# Version 2012/09/27-cb
# Ported to #!++ <https://crunchbangplusplus.org>
# by Ben Young <computermouth@crunchbangplusplus.org>
# Ported to Manjaro <https://manjaro.github.io/>
# by Daniel Napora <napcok@gmail.com>
# NB The shell, not bash, is invoked in the hope that
# dash will be used, as it is much faster.
# Usage: add
# <menu id="places" label="Places" execute="/path/to/mabox-places-pipemenu ~/" />
# to your .config/openbox/menu.xml
# or, if you want the "recent files" menu incorporated at the top, use:
# <menu id="places" label="Places" execute="/path/to/mabox-places-pipemenu --recent ~/" />
# make sure you have mabox-recent-files-pipemenu somewhere, and enter its path below.
# path to your "recent files" script, if you want to incorporate it:
recent_script=/usr/bin/mabox-recent-files-pipemenu
# Command to open folders at "Browse here..." - any file manager
open_folder_cmd=pcmanfm
# Default command to open files with - others might be xdg-open, gnome-open, pcmanfm...
default_open_cmd=exo-open # exo-open comes with thunar
# Text editor of choice
text_editor=geany
# function to open files with default open command, or alternative command for certain files
# - add other conditions to choice
open_file() {
[ -x "$1" ] && exec "$text_editor" "$1" # comment out this line if you don't want to edit executables instead of executing
#[ -x "$1" ] && exec "terminator -e" "$1" # uncomment this and comment out previous line to run executables in terminal instead of editing
[ "${1##*.}" = desktop ] && exec "$text_editor" "$1" # comment out this line if you don't want to edit .desktop files instead of executing
exec "$default_open_cmd" "$1" # use default open command if above conditions not satisfied
}
# extra dotfiles to display in HOME folder (dotfiles are hidden by default)
# edit the list (space separated, surrounded by single quotes) or comment this line out, to taste:
shown_dotfiles='.config .local'
# By default, this script will display directories separately, before files.
# To change this behaviour, see NOTE1, NOTE2 and NOTE3 below, near end of page.
#######################################################################
case $1 in
# if "--open" option is sent as $1, open file ($2) instead of generating menu
--open)
open_file "$2"
echo "$0 : failed to open $2" >&2
exit;; # in case exec command fails
# if "--recent" option is sent, incorporate "recent files" menu
--recent)
shift
output='<openbox_pipe_menu>
'
if [ -x "$recent_script" ]
then
output="$output"'<separator label="Ostatnio otwierane..." />
<menu execute="'"$recent_script"'" id="recent" label="files" />
'
else
echo "$0 : cannot find executable script $recent_script" >&2
fi;;
*)
output='<openbox_pipe_menu>
';;
esac
path="${1:-$HOME}" # default starting place is ~, otherwise $1
path="$( echo "${path}"/ | tr -s '/' )" # ensure one final slash
[ -d "$path" ] || { echo "$0 : $path is not a directory" >&2; exit 1; }
case "$path" in # only escape if string needs it
*\&*|*\<*|*\>*|*\"*|*\'*) pathe=$(sed "s/\&/\&amp;/g;s/</\&lt;/g;s/>/\&gt;/g;s/\"/\&quot;/g;s/'/\&apos;/g;" <<XXX
$path
XXX
)
;;
*)pathe=$path;;
esac
case "$pathe" in
*\&apos\;*) pathe_apos=$(sed 's/\&apos;/\&apos;\&quot;\&apos;\&quot;\&apos;/g;'<<XXX
$pathe
XXX
)
;;
*) pathe_apos=$pathe;;
esac
# output="$output"'<separator label="'$pathe'" />
output="$output"'<separator />
<item label="Go to '"$pathe"'...">
<action name="Execute">
<command>
&apos;'"$open_folder_cmd"'&apos; &apos;'"$pathe_apos"'&apos;
</command>
</action>
</item>
<separator />
'
unset extra_entries directories_menu files_menu
[ "$path" = "$HOME"/ ] && extra_entries="$shown_dotfiles"
for i in "$path"* $extra_entries
do
[ -e "$i" ] || continue # only output code if file exists
shortname="${i##*/}"
case $shortname in
*\&*|*\<*|*\>*|*\"*|*\'*) shortnamee=$(sed "s/\&/\&amp;/g;s/</\&lt;/g;s/>/\&gt;/g;s/\"/\&quot;/g;s/'/\&apos;/g;" <<XXX
$shortname
XXX
)
;;
*) shortnamee=$shortname;;
esac
case $shortnamee in
*\&apos\;*) shortnamee_apos=$(sed 's/\&apos;/\&apos;\&quot;\&apos;\&quot;\&apos;/g;'<<XXX
$shortnamee
XXX
)
;;
*) shortnamee_apos=$shortnamee;;
esac
case $shortnamee in
*_*) shortnamee_label=$(sed 's/_/__/g;'<<XXX
$shortnamee
XXX
)
;;
*) shortnamee_label=$shortnamee;;
esac
[ -d "$i" ] && {
# NOTE1 If you want directories and files listed together
# change next line (directories_menu="$directories_menu"') to read: files_menu="$files_menu"' (note the one single quote at the end)
directories_menu="$directories_menu"'
<menu id="'"${pathe_apos}${shortnamee_apos}"'" label="'"$shortnamee_label"'" execute="&apos;'"$0"'&apos; &apos;'"${pathe_apos}${shortnamee_apos}"'&apos;" />'; continue; }
files_menu="$files_menu"'
<item label="'"$shortnamee_label"'">
<action name="Execute">
<command>
&apos;'"$0"'&apos; --open &apos;'"${pathe_apos}${shortnamee_apos}"'&apos;
</command>
</action>
</item>'
done
[ -n "$directories_menu" ] && {
# NOTE2 comment out next 2 lines if you don't want "Directories" label
# output="${output}"'<item label="Directories" />
# '
# output="${output}"'<separator />
# '
output="${output}${directories_menu}"'
'; }
# [ -n "$files_menu" ] && {
# NOTE3 comment out next 2 lines if you don't want "Files" label
# output="${output}"'<item label="Files" />
# '
# output="${output}"'<separator />
# '
# output="${output}${files_menu}"'
#'; }
output="${output}"'</openbox_pipe_menu>
'
printf '%s' "$output"
exit

View File

@@ -0,0 +1,97 @@
#! /bin/bash
#
# SHELL-COLOR-SCRIPTS by Derek Taylor (DistroTube)
# A simple script that creates an openbox pipemenu that runs shell-color-scripts
# (https://github.com/dwt1/shell-color-scripts) in a terminal window.
#
# shell-color-scripts was forked from Color-Scripts (https://github.com/stark/Color-Scripts)
#
# This program is free software: you can redistribute it and/or modify it under the terms of
# the GNU General Public License version 3 as published by the Free Software Foundation.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see: http://www.gnu.org/licenses
#
# Copy this file somewhere on your path and make it executable.
# Add the following line somewhere to your /.config/openbox/menu.xml
# <menu execute="/PATH/TO/shell-color-scripts.sh" id="shell-color-scripts" label="Shell Color Scripts"/>
# Be sure to change the PATH/TO to the correct path to this file.
#
# Reconfigure openbox.
# output the initial menu
# NOTE: If you do not use the "termite" terminal program or the "ranger" file manager, edit the <command> below.
cat <<EOF
<openbox_pipe_menu>
<item label="Color Scripts">
<action name="Execute">
<command>
termite -e 'ranger ~/color-scripts'
</command>
</action>
</item>
EOF
# seperate the main command from the virtuals
echo " <separator/>"
echo " <menu id=\"color-scripts-01-15\" label=\"01-15\">"
# each color script listed in the menu
for file in $(ls ~/shell-color-scripts/* | head -15); do
NAME=$(echo "$file" | rev | cut -d"/" -f1 | rev)
echo " <menu id=\"$NAME\" label=\"$NAME\">"
# NOTE: If you do not use the "termite" terminal program, then change "termite" to your preferred terminal (ex. xterm, urxvt, etc.)
echo "<item label=\"Run in terminal\"><action name=\"Execute\"><execute>termite -e '$file' -t '$file'</execute></action></item>"
# NOTE: If you do not use the "vim" text editor, then change "vim" to your preferred editor (ex. nano, geany, etc.)
echo "<item label=\"Edit in vim\"><action name=\"Execute\"><execute>termite -e 'vim $file'</execute></action></item>"
echo " </menu>"
done
echo " </menu>"
echo " <menu id=\"color-scripts-16-30\" label=\"16-30\">"
# each color script listed in the menu
for file in $(ls ~/shell-color-scripts/* | tail -37 | head -15); do
NAME=$(echo "$file" | rev | cut -d"/" -f1 | rev)
echo " <menu id=\"$NAME\" label=\"$NAME\">"
# NOTE: If you do not use the "termite" terminal program, then change "termite" to your preferred terminal (ex. xterm, urxvt, etc.)
echo "<item label=\"Run in terminal\"><action name=\"Execute\"><execute>termite -e '$file' -t '$file'</execute></action></item>"
# NOTE: If you do not use the "vim" text editor, then change "vim" to your preferred editor (ex. nano, geany, etc.)
echo "<item label=\"Edit in vim\"><action name=\"Execute\"><execute>termite -e 'vim $file'</execute></action></item>"
echo " </menu>"
done
echo " </menu>"
echo " <menu id=\"color-scripts-31-45\" label=\"31-45\">"
# each color script listed in the menu
for file in $(ls ~/shell-color-scripts/* | tail -22 | head -15); do
NAME=$(echo "$file" | rev | cut -d"/" -f1 | rev)
echo " <menu id=\"$NAME\" label=\"$NAME\">"
# NOTE: If you do not use the "termite" terminal program, then change "termite" to your preferred terminal (ex. xterm, urxvt, etc.)
echo "<item label=\"Run in terminal\"><action name=\"Execute\"><execute>termite -e '$file' -t '$file'</execute></action></item>"
# NOTE: If you do not use the "vim" text editor, then change "vim" to your preferred editor (ex. nano, geany, etc.)
echo "<item label=\"Edit in vim\"><action name=\"Execute\"><execute>termite -e 'vim $file'</execute></action></item>"
echo " </menu>"
done
echo " </menu>"
echo " <menu id=\"color-scripts-46+\" label=\"46+\">"
# each color script listed in the menu
for file in $(ls ~/shell-color-scripts/* | tail -7 | head -15); do
NAME=$(echo "$file" | rev | cut -d"/" -f1 | rev)
echo " <menu id=\"$NAME\" label=\"$NAME\">"
# NOTE: If you do not use the "termite" terminal program, then change "termite" to your preferred terminal (ex. xterm, urxvt, etc.)
echo "<item label=\"Run in terminal\"><action name=\"Execute\"><execute>termite -e '$file' -t '$file'</execute></action></item>"
# NOTE: If you do not use the "vim" text editor, then change "vim" to your preferred editor (ex. nano, geany, etc.)
echo "<item label=\"Edit in vim\"><action name=\"Execute\"><execute>termite -e 'vim $file'</execute></action></item>"
echo " </menu>"
done
echo " </menu>"
# and finally...
echo "</openbox_pipe_menu>"

View File

@@ -0,0 +1,31 @@
#!/bin/bash
#
# STEAM by Derek Taylor (DistroTube)
# A simple script that creates an openbox pipemenu that launches Steam games.
#
# This program is free software: you can redistribute it and/or modify it under the terms of
# the GNU General Public License version 3 as published by the Free Software Foundation.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see: http://www.gnu.org/licenses
#
# Copy this file somewhere on your path and make it executable.
# Add the following line somewhere to your /.config/openbox/menu.xml
# <menu execute="/PATH/TO/steam.sh" id="steam" label="Steam"/>
# Be sure to change the PATH/TO to the correct path to this file.
#
# Reconfigure openbox.
STEAMAPPS=~/.steam/steam/steamapps
echo '<openbox_pipe_menu>'
echo '<item icon="/home/derek/.config/openbox/square-open.png" label="Steam"><action name="Execute"><execute>steam</execute></action></item>'
echo '<separator/>'
for file in $(ls $STEAMAPPS/*.acf -1v); do
ID=$(cat "$file" | grep '"appID"' | head -1 | sed -r 's/[^"]*"appID"[^"]*"([^"]*)"/\1/')
NAME=$(cat "$file" | grep '"name"' | head -1 | sed -r 's/[^"]*"name"[^"]*"([^"]*)"/\1/')
echo "<item icon=\"/home/derek/.config/openbox/square-open.png\" label=\"$NAME\"><action name=\"Execute\"><execute>steam steam://run/$ID</execute></action></item>"
done
echo '</openbox_pipe_menu>'

View File

@@ -0,0 +1,177 @@
#!/usr/bin/env python3
#
# SYSTEMINFO by Derek Taylor (DistroTube)
# A simple script that creates an openbox pipemenu that displays system information.
# My root partition is on /dev/sda1 and my swap is /dev/sda5. Edit these is your partitioning is different.
#
# This program is free software: you can redistribute it and/or modify it under the terms of
# the GNU General Public License version 3 as published by the Free Software Foundation.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see: http://www.gnu.org/licenses
#
# Copy this file somewhere on your path and make it executable.
# Add the following line somewhere to your /.config/openbox/menu.xml
# <menu execute="/PATH/TO/sysinfo.py" id="sysinfo" label="System Info"/>
# Be sure to change the PATH/TO to the correct path to this file.
#
# Reconfigure openbox.
#
# REQUIRES net-tools (for ifconfig) to be installed on your computer.
# SETTINGS
import subprocess
# SETTINGS - SYSTEM
syst1 = "whoami"
process = subprocess.Popen(syst1, stdout=subprocess.PIPE, shell=True)
user = process.communicate()[0].decode("utf-8").rstrip()
syst2 = "uname -n"
process = subprocess.Popen(syst2, stdout=subprocess.PIPE, shell=True)
host = process.communicate()[0].decode("utf-8").rstrip()
syst3 = "uname -s"
process = subprocess.Popen(syst3, stdout=subprocess.PIPE, shell=True)
system = process.communicate()[0].decode("utf-8").rstrip()
syst4 = "uname -r"
process = subprocess.Popen(syst4, stdout=subprocess.PIPE, shell=True)
release = process.communicate()[0].decode("utf-8").rstrip()
syst5 = "uname -m"
process = subprocess.Popen(syst5, stdout=subprocess.PIPE, shell=True)
arch = process.communicate()[0].decode("utf-8").rstrip()
syst6 = "uptime | sed 's/.* up //' | sed 's/[0-9]* us.*//' | sed 's/ day, / day /' | sed 's/ days, / days /' | sed 's/:/ hours /' | sed 's/ min//'| sed 's/,/ min/' | sed 's/ / /'"
process = subprocess.Popen(syst6, stdout=subprocess.PIPE, shell=True)
uptime = process.communicate()[0].decode("utf-8").rstrip()
# SETTINGS - CPU
cpu1 = "cat /proc/cpuinfo | grep 'model name' | sed 's/.*: //' | sed -n '1p'"
process = subprocess.Popen(cpu1, stdout=subprocess.PIPE, shell=True)
CPUmodel = process.communicate()[0].decode("utf-8").rstrip()
cpu2 = "cat /proc/cpuinfo | grep -m 1 'cpu MHz' | sed 's/.*: //'"
process = subprocess.Popen(cpu2, stdout=subprocess.PIPE, shell=True)
CPUfreq = process.communicate()[0].decode("utf-8").rstrip()
cpu3 = "cat /proc/cpuinfo | grep -m 1 'cache size' | sed 's/.*: //'"
process = subprocess.Popen(cpu3, stdout=subprocess.PIPE, shell=True)
CPUcache = process.communicate()[0].decode("utf-8").rstrip()
# SETTINGS - MEM
mem1 = "echo 'scale = 2; ('$(cat /proc/meminfo | grep MemTotal: | awk '{print $2}' | sed 's/k//')' /1024)' | bc"
process = subprocess.Popen(mem1, stdout=subprocess.PIPE, shell=True)
memTotal = process.communicate()[0].decode("utf-8").rstrip()
mem2 = "echo 'scale = 2; ('$(cat /proc/meminfo | grep MemFree: | awk '{print $2}' | sed 's/k//')' /1024) + ('$(cat /proc/meminfo | grep grep -m 1 Cached: | awk '{print $2}' | sed 's/k//')' /1024)' | bc"
process = subprocess.Popen(mem2, stdout=subprocess.PIPE, shell=True)
memFree = process.communicate()[0].decode("utf-8").rstrip()
mem3 = "echo 'scale = 2; ('$(cat /proc/meminfo | grep MemTotal: | awk '{print $2}' | sed 's/k//')' /1024) - (('$(cat /proc/meminfo | grep MemFree: | awk '{print $2}' | sed 's/k//')' /1024) + ('$(cat /proc/meminfo | grep -m 1 Cached: | awk '{print $2}' | sed 's/k//')' /1024))' | bc"
process = subprocess.Popen(mem3, stdout=subprocess.PIPE, shell=True)
memUsed = process.communicate()[0].decode("utf-8").rstrip()
mem4 = "echo 'scale = 2; (('$(cat /proc/meminfo | grep MemTotal: | awk '{print $2}' | sed 's/k//')' /1024) - (('$(cat /proc/meminfo | grep MemFree: | awk '{print $2}' | sed 's/k//')' /1024) + ('$(cat /proc/meminfo | grep -m 1 Cached: | awk '{print $2}' | sed 's/k//')' /1024))) / ('$(cat /proc/meminfo | grep MemTotal: | awk '{print $2}' | sed 's/k//')' /1024) *100' | bc"
process = subprocess.Popen(mem4, stdout=subprocess.PIPE, shell=True)
memUsedPercent = process.communicate()[0].decode("utf-8").rstrip()
# SETTINGS - DISKS
disk1 = "df -HlT | grep /dev/sda1 | sed -r 's/ / /g' | sed -r 's/ / /g' | cut -d ' ' -f 1"
process = subprocess.Popen(disk1, stdout=subprocess.PIPE, shell=True)
rootPart = process.communicate()[0].decode("utf-8").rstrip()
disk2 = "df -HlT | grep /dev/sda1 | sed -r 's/ / /g' | sed -r 's/ / /g' | cut -d ' ' -f 2"
process = subprocess.Popen(disk2, stdout=subprocess.PIPE, shell=True)
fileSys = process.communicate()[0].decode("utf-8").rstrip()
disk3 = "df -HlT | grep /dev/sda1 | sed -r 's/ / /g' | sed -r 's/ / /g' | cut -d ' ' -f 3"
process = subprocess.Popen(disk3, stdout=subprocess.PIPE, shell=True)
diskTotal = process.communicate()[0].decode("utf-8").rstrip()
disk4 = "df -HlT | grep /dev/sda1 | sed -r 's/ / /g' | sed -r 's/ / /g' | cut -d ' ' -f 4"
process = subprocess.Popen(disk4, stdout=subprocess.PIPE, shell=True)
diskUsed = process.communicate()[0].decode("utf-8").rstrip()
disk5 = "df -HlT | grep /dev/sda1 | sed -r 's/ / /g' | sed -r 's/ / /g' | cut -d ' ' -f 5"
process = subprocess.Popen(disk5, stdout=subprocess.PIPE, shell=True)
diskFree = process.communicate()[0].decode("utf-8").rstrip()
# SETTINGS - SWAP
swap1 = "cat /proc/swaps | grep /dev/sda5 | sed -r 's/ / /g' | sed -r 's/ / /g' | cut -d ' ' -f 1"
process = subprocess.Popen(swap1, stdout=subprocess.PIPE, shell=True)
swapPart = process.communicate()[0].decode("utf-8").rstrip()
swap2 = "echo 'scale = 2; ('$(cat /proc/meminfo | grep SwapTotal: | awk '{print $2}' | sed 's/k//')' /1024)' | bc"
process = subprocess.Popen(swap2, stdout=subprocess.PIPE, shell=True)
swapTotal = process.communicate()[0].decode("utf-8").rstrip()
swap3 = "echo 'scale = 2; ('$(cat /proc/meminfo | grep SwapFree: | awk '{print $2}' | sed 's/k//')' /1024)' | bc"
process = subprocess.Popen(swap3, stdout=subprocess.PIPE, shell=True)
swapFree = process.communicate()[0].decode("utf-8").rstrip()
swap4 = "echo 'scale = 2; ('$(cat /proc/meminfo | grep SwapTotal: | awk '{print $2}' | sed 's/k//')' /1024) - ('$(cat /proc/meminfo | grep SwapFree: | awk '{print $2}' | sed 's/k//')' /1024)' | bc"
process = subprocess.Popen(swap4, stdout=subprocess.PIPE, shell=True)
swapUsed = process.communicate()[0].decode("utf-8").rstrip()
swap5 = "echo 'scale = 2; (('$(cat /proc/meminfo | grep SwapTotal: | awk '{print $2}' | sed 's/k//')' /1024) - ('$(cat /proc/meminfo | grep SwapFree: | awk '{print $2}' | sed 's/k//')' /1024)) / ('$(cat /proc/meminfo | grep SwapTotal: | awk '{print $2}' | sed 's/k//')' /1024) *100' | bc"
process = subprocess.Popen(swap5, stdout=subprocess.PIPE, shell=True)
swapUsedPercent = process.communicate()[0].decode("utf-8").rstrip()
# SETTINGS - NET
net1 = "/sbin/ifconfig 'enp3s0' | grep 'inet ' | sed 's/.*inet //' | sed 's/netmask.*//'"
process = subprocess.Popen(net1, stdout=subprocess.PIPE, shell=True)
netIP = process.communicate()[0].decode("utf-8").rstrip()
net2 = "/sbin/ifconfig 'enp3s0' | grep 'RX packets' | sed 's/.*bytes [0-9]* (//' | sed 's/iB).*)*//' | sed 's/b).*)*//' | sed 's/).*)*//'"
process = subprocess.Popen(net2, stdout=subprocess.PIPE, shell=True)
netDown = process.communicate()[0].decode("utf-8").rstrip()
net3 = "/sbin/ifconfig 'enp3s0' | grep 'TX packets' | sed 's/.*bytes [0-9]* (//' | sed 's/iB).*)*//' | sed 's/b).*)*//' | sed 's/).*)*//'"
process = subprocess.Popen(net3, stdout=subprocess.PIPE, shell=True)
netUp = process.communicate()[0].decode("utf-8").rstrip()
# OPENBOX PIPEMENU
print ('<?xml version=\"1.0\" encoding=\"UTF-8\"?>')
print ('<openbox_pipe_menu>')
print ('<separator />')
print ('<item label="SYSTEM" />')
print ('<separator />')
print ('<item label="'+'User @ Host: '+user+' @ '+host+'"/>')
print ('<item label="'+'Kernel: '+system+' '+release+' '+arch+'"/>')
print ('<item label="'+'Uptime: '+uptime+'"/>')
print ('<separator />')
print ('<item label="CPU" />')
print ('<separator />')
print ('<item label="'+'CPU: '+CPUmodel+'"/>')
print ('<item label="'+'CPU FREQ: '+CPUfreq+' MHz"/>')
print ('<item label="'+'CPU Cache: '+CPUcache+'"/>')
print ('<separator />')
print ('<item label="MEM" />')
print ('<separator />')
print ('<item label="'+'RAM USED: '+memUsed+' MiB/'+memTotal+' MiB'+' ('+memUsedPercent+'%)'+'"/>')
print ('<separator />')
print ('<item label="DISKS" />')
print ('<separator />')
print ('<item label="'+'Root: '+rootPart+' ('+fileSys+')"/>')
print ('<item label="'+'Swap: '+swapPart+' ('+swapUsed+ ' MiB/'+swapTotal+' MiB)\"/>')
print ('<item label="'+'SSD: '+diskTotal+' ('+diskUsed+ ' USED/'+diskFree+' FREE)\"/>')
print ('<separator />')
print ('<item label="NET" />')
print ('<separator />')
print ('<item label="'+'NET IP: '+netIP+'"/>')
print ('<item label="'+'RX bytes: '+netDown+'"/>')
print ('<item label="'+'TX bytes: '+netUp+'"/>')
print ('</openbox_pipe_menu>')

View File

@@ -0,0 +1,82 @@
#!/bin/sh
#
# Copyright (C) 2009-2013 "isomorph"
# All Rights Reserved.
#
# BSD 3-Clause License
#
# ----
#
# OpenBox "VirtualBox" pipe-menu
# Outputs a menu roughly akin to:
#
# VirtualBox
# ----------
# <Virtual Machine>
# <Virtual Machine>
# <Virtual Machine>
# ...
#
# Usage:
#
# 1. Copy this file somewhere on your path and make it executable
# 2. Add the following line somewhere to your /.config/openbox/menu.xml
#
# <menu id="vms" label="Virtual Machines" execute="cb-virtual-machines-pipemenu" />
#
# 3. Reconfigure openbox
# make sure virtualbox itself exists
which "virtualbox" > /dev/null
if [ "$?" -ne "0" ]; then
cat <<EOF
<openbox_pipe_menu>
<item label="Virtualbox cannot be found"></item>
<item label="Click here to install Virtualbox">
<action name="Execute">
<command>x-www-browser https://www.virtualbox.org/wiki/Linux_Downloads</command>
</action></item>
</openbox_pipe_menu>
EOF
exit 1
fi
# output the initial menu
cat <<EOF
<openbox_pipe_menu>
<item label="VirtualBox">
<action name="Execute">
<command>
virtualbox -style gtk
</command>
</action>
</item>
EOF
# Check for the vboxmanage binary
which "vboxmanage" > /dev/null
if [ "$?" -ne "0" ]; then
echo "</openbox_pipe_menu>"
exit 0
fi
# seperate the main command from the virtuals
echo " <separator/>"
# output the list of virtual machines
vboxmanage list vms | cut -f 2 -d "\"" | sort -f | while read vm
do
cat <<EOF
<item label="$vm">
<action name="Execute">
<command>
vboxmanage startvm "$vm"
</command>
</action>
</item>
EOF
done;
# and finally...
echo "</openbox_pipe_menu>"

1090
.config/openbox/rc.xml Normal file

File diff suppressed because it is too large Load Diff