Skip to content

Instantly share code, notes, and snippets.

@nalipaz
Last active April 12, 2016 10:12
Show Gist options
  • Save nalipaz/dc48e84525c5260ca496521d45a69715 to your computer and use it in GitHub Desktop.
Save nalipaz/dc48e84525c5260ca496521d45a69715 to your computer and use it in GitHub Desktop.
Tomoko's computer setup
#!/usr/bin/perl
# obmenu-generator - schema file
=for comment
item: add an item inside the menu {item => ["command", "label", "icon"]},
cat: add a category inside the menu {cat => ["name", "label", "icon"]},
sep: horizontal line separator {sep => undef}, {sep => "label"},
pipe: a pipe menu entry {pipe => ["command", "label", "icon"]},
raw: any valid Openbox XML string {raw => q(xml string)},
begin_cat: begin of a category {begin_cat => ["name", "icon"]},
end_cat: end of a category {end_cat => undef},
obgenmenu: generic menu settings {obgenmenu => ["label", "icon"]},
exit: default "Exit" action {exit => ["label", "icon"]},
=cut
# NOTE:
# * Keys and values are case sensitive. Keep all keys lowercase.
# * ICON can be a either a direct path to an icon or a valid icon name
# * Category names are case insensitive. (X-XFCE and x_xfce are equivalent)
require "$ENV{HOME}/.config/obmenu-generator/config.pl";
## Text editor
my $editor = $CONFIG->{editor};
our $SCHEMA = [
{item => ['gmrun', 'Run Program', 'gmrun']},
{sep => undef},
{item => ['x-terminal-emulator', 'Terminal', 'terminal']},
{item => ['x-www-browser', 'Web Browser', 'web-browser']},
{item => ['bl-file-manager', 'File Manager', 'file-manager']},
{item => ['bl-text-editor', 'Text Editor', 'text-editor']},
{item => ['bl-media-player', 'Media Player', 'media-player']},
{sep => undef},
{cat => ['utility', 'Accessories', 'applications-utilities']},
{cat => ['development', 'Development', 'applications-development']},
{cat => ['education', 'Education', 'applications-science']},
{cat => ['graphics', 'Graphics', 'applications-graphics']},
{cat => ['audiovideo', 'Multimedia', 'applications-multimedia']},
{cat => ['network', 'Network', 'applications-internet']},
{cat => ['office', 'Office', 'applications-office']},
{cat => ['other', 'Other', 'applications-other']},
{sep => undef},
{obgenmenu => ['Openbox Settings', 'openbox']},
{sep => undef},
{pipe => ['bl-places-pipemenu', 'Places', 'places']},
{pipe => ['bl-recent-files-pipemenu', 'Recent Files', 'recent-files']},
{cat => ['settings', 'Settings', 'applications-accessories']},
{cat => ['system', 'System', 'applications-system']},
{sep => undef},
{raw => q(<menu id="preferences" label="Preferences"> <menu id="obConfig" label="Openbox"> <item label="Edit menu.xml"> <action name="Execute"> <command> bl-text-editor ~/.config/openbox/menu.xml </command> </action> </item> <item label="Edit rc.xml"> <action name="Execute"> <command> bl-text-editor ~/.config/openbox/rc.xml </command> </action> </item> <item label="Edit autostart"> <action name="Execute"> <command> bl-text-editor ~/.config/openbox/autostart </command> </action> </item> <separator/> <item label="GUI Menu Editor"> <action name="Execute"> <command> obmenu </command> </action> </item> <item label="GUI Config Tool"> <action name="Execute"> <command> obconf </command> </action> </item> <item label="How to Edit Menu"> <action name="Execute"> <command> yad --button="OK":0 --center --window-icon=distributor-logo-bunsenlabs --text-info --title=&quot;How to Edit the Menu&quot; --filename=&quot;/usr/share/bunsen/bunsen-docs/helpfile-menu.txt&quot; --width=900 --height=700 --fontname=Monospace </command> </action> </item> <separator/> <item label="Reconfigure"> <action name="Reconfigure"/> </item> <item label="Restart"> <action name="Restart"/> </item> </menu> <menu execute="bl-compositor" id="CompositingPipeMenu" label="Compositor"/> <menu execute="bl-conky-pipemenu" id="pipe-conkymenu" label="Conky"/> <menu execute="bl-tint2-pipemenu" id="pipe-tint2menu" label="Tint2"/> <item label="Appearance"> <action name="Execute"> <command> lxappearance </command> </action> </item> <item label="Choose Wallpaper"> <action name="Execute"> <command> nitrogen </command> </action> </item> <item label="Notifications"> <action name="Execute"> <command>xfce4-notifyd-config</command> </action> </item> <item label="Power Management"> <action name="Execute"> <command> xfce4-power-manager-settings </command> </action> </item> <menu id="dmenuconfig" label="dmenu"> <item label="Edit Start-up Script"> <action name="Execute"> <command> bl-text-editor ~/.config/dmenu/dmenu-bind.sh </command> </action> </item> <separator label="Help?"/> <item label="man page"> <action name="Execute"> <command> x-terminal-emulator -T 'man dmenu' -e man dmenu </command> </action> </item> </menu> <menu id="gmrunconfig" label="gmrun"> <item label="Edit Config File"> <action name="Execute"> <command> bl-text-editor ~/.gmrunrc </command> </action> </item> <separator label="Help?"/> <item label="man page"> <action name="Execute"> <command> x-terminal-emulator -T 'man gmrun' -e man gmrun </command> </action> </item> </menu> <menu id="DisplaySettings" label="Display"> <item label="ARandR Screen Layout Editor"> <action name="Execute"> <command> arandr </command> </action> </item> <separator label="Help?"/> <item label="man xrandr"> <action name="Execute"> <command> x-terminal-emulator -T 'man xrandr' -e man xrandr </command> </action> </item> </menu> </menu>)},
{item => ['bl-lock', 'Lock Screen', 'lock-screen']},
{item => ['bl-exit', 'Exit', 'exit']},
]
<opt>
<general app_version="0.92Rev.1269" as_help_active="1" asel_h="0" asel_w="0" asel_x="0" asel_y="0" ask_on_delete="" ask_on_fs_delete="" autofs="1" autofs_min="1" autofs_not="" autohide="1" autohide_time="400" autoshape_active="" border="1" bordereffect="2" bordereffect_active="" bordereffect_col="#000000" close_at_close="1" current_monitor_active="" cursor="" delay="0" delete_on_close="" filename="$name_%NNN" filetype="1" fname_autocopy="" folder="/home/tomoko/Pictures/screenshots" ftp_mode="0" ftp_password="" ftp_uri="ftp://host:port/path" ftp_username="" ftp_wurl="http://example.com/screenshots" im_colors="2" im_colors_active="" image_autocopy="" last_profile="-1" last_profile_name="" menu_delay="10" menu_waround="1" no_autocopy="1" notify_after="1" notify_agent="1" notify_ptimeout="1" notify_timeout="1" present_after="1" prog="Built-in Editor" prog_active="1" quality="9" save_ask="" save_auto="1" save_no="" session_asc="" session_asc_combo="1" session_desc="1" session_desc_combo="1" thumbnail="50" thumbnail_active="" trans_backg="" trans_check="1" trans_custom="" trans_custom_col="#000000" visible_windows="" web_width="2" winresize_active="" winresize_h="500" winresize_w="500" zoom_active="1" />
<gui btoolbar_active="" />
<plugins name="/usr/share/shutter/resources/system/plugins/perl/spbardistortion" binary="/usr/share/shutter/resources/system/plugins/perl/spbardistortion/spbardistortion" category="Effect" lang="perl" name_plugin="Barrel Distortion" tooltip="Apply a distortion effect to your screenshot" />
<plugins name="/usr/share/shutter/resources/system/plugins/perl/spnegate" binary="/usr/share/shutter/resources/system/plugins/perl/spnegate/spnegate" category="Effect" lang="perl" name_plugin="Negate" tooltip="Invert the colors of the image" />
<plugins name="/usr/share/shutter/resources/system/plugins/perl/sppolaroid" binary="/usr/share/shutter/resources/system/plugins/perl/sppolaroid/sppolaroid" category="Effect" lang="perl" name_plugin="Polaroid" tooltip="Make your screenshot look like a polaroid photo, add a caption, and even rotate it a little" />
<plugins name="/usr/share/shutter/resources/system/plugins/perl/spresize" binary="/usr/share/shutter/resources/system/plugins/perl/spresize/spresize" category="Tool" lang="perl" name_plugin="Resize" tooltip="Resize your screenshot" />
<plugins name="/usr/share/shutter/resources/system/plugins/perl/spsepia" binary="/usr/share/shutter/resources/system/plugins/perl/spsepia/spsepia" category="Effect" lang="perl" name_plugin="Sepia" tooltip="Add sepia color toning to the image" />
<plugins name="/usr/share/shutter/resources/system/plugins/perl/spshadow" binary="/usr/share/shutter/resources/system/plugins/perl/spshadow/spshadow" category="Effect" lang="perl" name_plugin="Hard Shadow" tooltip="Add a shadow to the image on a transparent background" />
<plugins name="/usr/share/shutter/resources/system/plugins/perl/spwatermark" binary="/usr/share/shutter/resources/system/plugins/perl/spwatermark/spwatermark" category="Effect" lang="perl" name_plugin="Watermark" tooltip="Add a custom text watermark to your screenshot" />
<plugins name="/usr/share/shutter/resources/system/plugins/shell/spgrayscale" binary="/usr/share/shutter/resources/system/plugins/shell/spgrayscale/spgrayscale" category="Effect" lang="shell" name_plugin="Grayscale" tooltip="Turn the image into a grayscale image (256 shades)" />
<plugins name="/usr/share/shutter/resources/system/plugins/shell/spoffset" binary="/usr/share/shutter/resources/system/plugins/shell/spoffset/spoffset" category="Effect" lang="shell" name_plugin="Offset" tooltip="Give the picture an offset with itself as background" />
<plugins name="/usr/share/shutter/resources/system/plugins/shell/spraise" binary="/usr/share/shutter/resources/system/plugins/shell/spraise/spraise" category="Effect" lang="shell" name_plugin="Raise Border" tooltip="Raise a rectangular 3d-border" />
<plugins name="/usr/share/shutter/resources/system/plugins/shell/spsoftedges" binary="/usr/share/shutter/resources/system/plugins/shell/spsoftedges/spsoftedges" category="Effect" lang="shell" name_plugin="Soft Edges" tooltip="Add soft edges around the image" />
<plugins name="/usr/share/shutter/resources/system/plugins/shell/spsunk" binary="/usr/share/shutter/resources/system/plugins/shell/spsunk/spsunk" category="Effect" lang="shell" name_plugin="Sunk Border" tooltip="Add an inverted 3d border to the image" />
<plugins name="/usr/share/shutter/resources/system/plugins/shell/sptornedpaper" binary="/usr/share/shutter/resources/system/plugins/shell/sptornedpaper/sptornedpaper" category="Effect" lang="shell" name_plugin="Torned Paper" tooltip="Add a torn-like border to the image" />
<plugins name="/usr/share/shutter/resources/system/plugins/shell/sptrim" binary="/usr/share/shutter/resources/system/plugins/shell/sptrim/sptrim" category="Tool" lang="shell" name_plugin="Autocrop" tooltip="Remove empty borders from the image" />
<recent ruu_hosting="0" ruu_places="0" ruu_tab="0" />
</opt>
#!/bin/bash
# Setup bunsen labs latest
# Run the bunsen labs welcome script and go through all the steps after booting into machine
# Add sources for google chrome
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list'
# Fix volti volume applet which wants the wrong hdmi card
sed -i 's/card_index\s=\s0/card_index = 1/' ~/.config/volti/config
# Fix tint2 getting started twice on intel graphics cards
sudo mkdir -p /etc/X11/xorg.conf.d
sudo sh -c 'cat > /etc/X11/xorg.conf.d/20-intel.conf << "EOF"
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "AccelMethod" "uxa"
EndSection
EOF
'
sudo apt-get update
sudo apt-get install google-chrome-stable shutter vim xfdesktop4
# Setup shutter preferences
mkdir .shutter
curl -o .shutter/setting.xml -L https://gist.github.com/nalipaz/4f7445eea2d99aead8d9845c6cc5a3a0/raw/66270459613dd2c032330578869763a19a2d1a0e/settings.xml
# Setup thunar settings
# Setup tint2rc settings
# Make a tint2 faux start menu
sudo su
cat << 'EOD' > /usr/share/applications/menu.desktop
[Desktop Entry]
Encoding=UTF-8
Name=Tint2 Openbox Menu
Comment=Tint2 Openbox Menu Hack
X-GNOME-FullName=Openbox Menu
Exec=xdotool key super+space
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=/home/tomoko/Pictures/wallpapers/bl-logo-36.png
Categories=Menu;
MimeType=
StartupNotify=true
EOD
exit
# Setup desktop icons
sed -i 's@XDG_DESKTOP_DIR="$HOME/"@XDG_DESKTOP_DIR="$HOME/Desktop"@' .config/user-dirs.dirs
sed -i 's@nitrogen\s\-\-restore\s\&@\(sleep 4; xfdesktop\) \&@' .config/openbox/autostart
xfdesktop &
# set desktop background after editing settings in desktop right-click
# Setup virtualbox
sudo apt-get install build-essential linux-headers-`uname -r` dkms
curl -LO http://download.virtualbox.org/virtualbox/5.0.16/virtualbox-5.0_5.0.16-105871~Debian~jessie_amd64.deb
curl -LO http://download.virtualbox.org/virtualbox/5.0.16/Oracle_VM_VirtualBox_Extension_Pack-5.0.16-105871.vbox-extpack
dpk -i virtualbox-*.deb
VBoxManage extpack install --replace Oracle_VM_VirtualBox_Extension_Pack-*.vbox-extpack
# Symlink some known usb drives to the home folder so they are available in vbox, since we share home folder with vbox.
cd ~ && ln -s /media/tomoko/Elements && ln -s /media/tomoko/TOMOKO
# Add google chrome to startups as a background app
echo "(sleep 4 && /usr/bin/google-chrome-stable --no-startup-window) &" >> .config/openbox/autostart
# Make lightdm default the username to last logged in user
sudo sed -i 's@greeter\-hide\-users=true@greeter-hide-users=false@' /etc/lightdm/lightdm.conf
# Setup plymouth for a better login experience in lvm encrypted drives.
sudo aptitude install plymouth plymouth-themes
convert ~/Pictures/wallpapers/shared/bunsen/bunsen-images/bl-default/bl-login-1920x1200.png -resize $(xdpyinfo | echo $(grep 'dimensions:') | sed -E "s@dimensions:\s([0-9]+)x([0-9]+).*@\1x\2@")^ -gravity center -crop $(xdpyinfo | echo $(grep 'dimensions:') | sed -E "s@dimensions:\s([0-9]+)x([0-9]+).*@\1x\2@")+0+0 ~/Pictures/wallpapers/bl-grub-$(xdpyinfo | echo $(grep 'dimensions:') | sed -E "s@dimensions:\s([0-9]+)x([0-9]+).*@\1x\2@").png
sudo cp ~/Pictures/wallpapers/bl-grub-*.png /boot/grub/
sudo sed -i -E "s@GRUB_CMDLINE_LINUX_DEFAULT=\"([a-z\s0-9]+)\"@GRUB_CMDLINE_LINUX_DEFAULT=\"\1 splash loglevel=3 vga=current\"@" /etc/default/grub
sudo su
echo $(xdpyinfo | echo $(grep 'dimensions:') | sed -E "s@dimensions:\s([0-9]+)x([0-9]+).*@GRUB_GFXMODE=\1x\2@") >> /etc/default/grub
update-grub
if [[ $(lspci | echo $(grep -i -E 'vga|3d|2d') | sed -E 's@.*(intel|ati|nvidia)\s.*@\1@i') == 'Intel' ]]; then printf "# KMS\nintel_agp\ndrm\ni915 modeset=1" >> /etc/initramfs-tools/modules; fi
cd /tmp/ && wget https://github.com/nalipaz/bunsen-plymouth-theme/archive/master.zip && unzip master.zip && rm master.zip
mv bunsen-plymouth-theme-master/ /usr/share/plymouth/themes/bunsen
/usr/sbin/plymouth-set-default-theme bunsen
update-initramfs -u
exit
# Setup better menu with icons
sudo aptitude install cpanminus build-essential
wget https://github.com/trizen/obmenu-generator/archive/master.zip
<?xml version="1.0" encoding="UTF-8"?>
<channel name="thunar" version="1.0">
<property name="default-view" type="string" value="void"/>
<property name="last-compact-view-zoom-level" type="string" value="THUNAR_ZOOM_LEVEL_SMALLEST"/>
<property name="last-details-view-column-order" type="string" value="THUNAR_COLUMN_NAME,THUNAR_COLUMN_SIZE,THUNAR_COLUMN_TYPE,THUNAR_COLUMN_DATE_MODIFIED"/>
<property name="last-details-view-column-widths" type="string" value=""/>
<property name="last-details-view-fixed-columns" type="bool" value="false"/>
<property name="last-details-view-visible-columns" type="string" value="THUNAR_COLUMN_DATE_MODIFIED,THUNAR_COLUMN_NAME,THUNAR_COLUMN_SIZE,THUNAR_COLUMN_TYPE"/>
<property name="last-details-view-zoom-level" type="string" value="THUNAR_ZOOM_LEVEL_SMALLER"/>
<property name="last-icon-view-zoom-level" type="string" value="THUNAR_ZOOM_LEVEL_NORMAL"/>
<property name="last-location-bar" type="string" value="ThunarLocationButtons"/>
<property name="last-separator-position" type="int" value="170"/>
<property name="last-show-hidden" type="bool" value="false"/>
<property name="last-side-pane" type="string" value="ThunarShortcutsPane"/>
<property name="last-sort-column" type="string" value="THUNAR_COLUMN_NAME"/>
<property name="last-sort-order" type="string" value="GTK_SORT_ASCENDING"/>
<property name="last-statusbar-visible" type="bool" value="true"/>
<property name="last-view" type="string" value="ThunarIconView"/>
<property name="last-window-height" type="int" value="660"/>
<property name="last-window-width" type="int" value="600"/>
<property name="last-window-maximized" type="bool" value="false"/>
<property name="misc-volume-management" type="bool" value="true"/>
<property name="misc-case-sensitive" type="bool" value="false"/>
<property name="misc-date-style" type="string" value="THUNAR_DATE_STYLE_SIMPLE"/>
<property name="misc-folders-first" type="bool" value="true"/>
<property name="misc-horizontal-wheel-navigates" type="bool" value="false"/>
<property name="misc-recursive-permissions" type="string" value="THUNAR_RECURSIVE_PERMISSIONS_ASK"/>
<property name="misc-remember-geometry" type="bool" value="true"/>
<property name="misc-show-about-templates" type="bool" value="true"/>
<property name="misc-single-click" type="bool" value="false"/>
<property name="misc-single-click-timeout" type="uint" value="500"/>
<property name="misc-text-beside-icons" type="bool" value="false"/>
<property name="shortcuts-icon-emblems" type="bool" value="true"/>
<property name="shortcuts-icon-size" type="string" value="THUNAR_ICON_SIZE_SMALLER"/>
<property name="tree-icon-emblems" type="bool" value="true"/>
<property name="tree-icon-size" type="string" value="THUNAR_ICON_SIZE_SMALLEST"/>
<property name="misc-thumbnail-mode" type="string" value="THUNAR_THUMBNAIL_MODE_ONLY_LOCAL"/>
<property name="misc-middle-click-in-tab" type="bool" value="true"/>
</channel>
#---------------------------------------------
# TINT2 CONFIG FILE
#---------------------------------------------
# For more information about tint2, see:
# http://code.google.com/p/tint2/wiki/Welcome
#
# For more config file examples, see:
# http://bunsenlabs.org/topic/3232/my-tint2-config/
# Background definitions
# ID 1
rounded = 0
border_width = 0
background_color = #000000 40
border_color = #828282 0
# ID 2 - task active
rounded = 1
border_width = 0
background_color = #d8d8d8 30
border_color = #d8d8d8 30
# ID 3 - task
rounded = 1
border_width = 0
background_color = #000000 0
border_color = #000000 0
# ID 4
rounded = 1
border_width = 1
background_color = #888888 20
border_color = #ED2323 60
# ID 5 - taskbar
rounded = 0
border_width = 1
background_color = #000000 0
border_color = #000000 0
# ID 6 - active taskbar
rounded = 0
border_width = 1
background_color = #d8d8d8 8
border_color = #d8d8d8 0
# ID 7 - tooltip
rounded = 3
border_width = 0
background_color = #222222 90
border_color = #222222 90
# ID 8
rounded = 1
border_width = 1
background_color = #888888 20
border_color = #888888 20
# Panel
panel_monitor = all
panel_position = top center horizontal
panel_items = LTSC
panel_size = 100% 30
panel_margin = 0 -1
panel_padding = 0 0
panel_dock = 0
wm_menu = 1
panel_layer = bottom
panel_background_id = 1
# Panel Autohide
autohide = 0
autohide_show_timeout = 0.3
autohide_hide_timeout = 1.5
autohide_height = 6
strut_policy = follow_size
# Taskbar
taskbar_mode = multi_desktop
taskbar_padding = 6 0 6
taskbar_background_id = 5
taskbar_active_background_id = 6
taskbar_name = 0
taskbar_name_background_id = 0
taskbar_name_active_background_id = 0
taskbar_name_font = Sans 9
taskbar_name_font_color = #828282 100
taskbar_name_active_font_color = #828282 100
# Tasks
urgent_nb_of_blink = 20
task_icon = 1
task_text = 0
task_centered = 1
task_maximum_size = 40 40
task_padding = 2 2
task_background_id = 3
task_active_background_id = 2
task_urgent_background_id = 4
task_iconified_background_id = 3
# Task Icons
task_icon_asb = 80 0 0
task_active_icon_asb = 100 0 0
task_urgent_icon_asb = 100 0 0
task_iconified_icon_asb = 80 0 0
# Fonts
task_font = Sans 06_55 6
task_font_color = #828282 60
task_active_font_color = #828282 100
task_urgent_font_color = #FFFFFF 100
task_iconified_font_color = #d8d8d8 60
font_shadow = 0
# Launcher
launcher_padding = 8 4 4
launcher_background_id = 0
launcher_icon_size = 0
# decolorize launcher icons
#launcher_icon_asb = 100 -100 -5
launcher_tooltip = 1
# Specify icon theme names with launcher_icon_theme.
# if you have an XSETTINGS manager running (like xfsettingsd), tint2 will follow your current theme.
launcher_icon_theme = Faenza-Dark-Bunsen
# Each launcher_item_app must be a full path to a .desktop file
# this will have to be made:
launcher_item_app = /usr/share/applications/menu.desktop
launcher_item_app = /usr/share/applications/bl-www-browser.desktop
launcher_item_app = /usr/share/applications/bl-file-manager.desktop
launcher_item_app = /usr/share/applications/bl-text-editor.desktop
launcher_item_app = /usr/share/applications/bl-terminal-emulator.desktop
# System Tray
systray = 1
systray_padding = 4 2 3
systray_sort = right2left
systray_background_id = 0
systray_icon_size = 0
systray_icon_asb = 100 0 0
# Clock
time1_format = %a %l:%M %p %Z on %e %b %Y
time1_font = Sans bold 10
time2_format = %a %l:%M %p %Z on %e %b %Y
time2_font = Sans 9
time2_timezone = :Asia/Tokyo
clock_font_color = #b5b5b5 100
clock_padding = 12 4
clock_background_id = 0
clock_lclick_command = gsimplecal
clock_rclick_command = gsimplecal
# Tooltips
tooltip = 1
tooltip_padding = 2 2
tooltip_show_timeout = 0.0
tooltip_hide_timeout = 0.0
tooltip_background_id = 7
tooltip_font_color = #d8d8d8 100
tooltip_font = Sans normal 9.0
# Mouse
mouse_middle = none
mouse_right = toggle
mouse_scroll_up = toggle
mouse_scroll_down = iconify
# Battery
battery = 1
battery_low_status = 20
battery_low_cmd = notify-send "battery low"
battery_hide = 96
bat1_font = Monospace 8
bat2_font = Monospace 8
battery_font_color = #b5b5b5 100
battery_padding = 2 0
battery_background_id = 0
# End of config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment