Compare commits

...

2 Commits

Author SHA1 Message Date
Ian Adam Naval
f9135409a4 Add qtile config 2015-08-21 03:19:03 -04:00
Ian Adam Naval
0e11eaf4fd Update teiler config 2015-08-21 03:16:32 -04:00
7 changed files with 387 additions and 68 deletions

View File

@ -0,0 +1,213 @@
from libqtile.config import Key, Screen, Group, Drag, Click
from libqtile.command import lazy
from libqtile import layout, bar, widget, hook
mod = "mod4"
keys = [
# Switch between windows in current stack pane
Key([mod], "h", lazy.layout.left()),
Key([mod], "l", lazy.layout.right()),
Key([mod], "j", lazy.layout.down()),
Key([mod], "k", lazy.layout.up()),
Key([mod, "shift"], "h", lazy.layout.swap_left()),
Key([mod, "shift"], "l", lazy.layout.swap_right()),
Key([mod, "shift"], "j", lazy.layout.shuffle_down()),
Key([mod, "shift"], "k", lazy.layout.shuffle_up()),
Key([mod], "i", lazy.layout.grow()),
Key([mod], "m", lazy.layout.shrink()),
Key([mod], "n", lazy.layout.normalize()),
Key([mod], "o", lazy.layout.maximize()),
Key([mod, "shift"], "space", lazy.layout.flip()),
# Toggle floating
Key([mod], "space", lazy.window.toggle_floating()),
# Toggle fullscreen
Key([mod], "f", lazy.window.toggle_fullscreen()),
# Launch programs
Key([mod], "Return", lazy.spawn("urxvt")),
Key([mod], "d", lazy.spawn("rofi -show run")),
Key([], "XF86AudioMute", lazy.spawn("pactl set-sink-mute 1 toggle")),
Key([], "XF86AudioMicMute", lazy.spawn("amixer -c 1 set Capture toggle")),
Key([], "XF86Display", lazy.spawn("arandr")),
Key([], "XF86MonBrightnessUp", lazy.spawn("xbacklight -inc 5")),
Key([], "XF86MonBrightnessDown", lazy.spawn("xbacklight -dec 5")),
Key(["shift"], "XF86MonBrightnessUp", lazy.spawn("xbacklight -inc 1")),
Key(["shift"], "XF86MonBrightnessDown", lazy.spawn("xbacklight -dec 1")),
Key([], "XF86Tools", lazy.spawn("rofi -show ssh")),
Key([], "XF86Search", lazy.spawn("rofi -show fm -switchers 'fm:fmenu-rofi'")),
Key([], "XF86LaunchA", lazy.spawn("rofi -show window")),
Key([], "XF86Explorer", lazy.spawn("rofi -show run")),
Key([], "Print", lazy.spawn("teiler")),
# Toggle between different layouts as defined below
Key([mod], "Tab", lazy.next_layout()),
# Close current window
Key([mod], "q", lazy.window.kill()),
Key([mod, "shift"], "r", lazy.restart()),
Key([mod, "control"], "q", lazy.shutdown()),
Key([mod], "r", lazy.spawncmd()),
]
labels = list("1234567890")
groups = [Group(i) for i in labels]
for group in groups:
# mod1 + letter of group = switch to group
keys.append(
Key([mod], group.name, lazy.group[group.name].toscreen())
)
# mod1 + shift + letter of group = switch to & move focused window to group
keys.append(
Key([mod, "shift"], group.name, lazy.window.togroup(group.name))
)
layout_theme = {
'border_focus': "#215578",
'border_normal': "#252525",
'ratio': 0.618,
'border_width': 1,
'margin': 0,
}
layouts = [
layout.MonadTall(**layout_theme),
layout.Max(**layout_theme),
layout.RatioTile(**layout_theme),
]
widget_defaults = dict(
rounded=False,
font='Meslo LG S DZ',
fontsize=12,
padding=3,
borderwidth=2,
opacity=0.2,
)
class Battery(widget.Battery):
low_percentage = 0.1
not_charging_format = "{percent:2.01%}{char}"
format = not_charging_format + " @{power:.1f}W ({hour:d}:{min:02d})"
full_char = '='
charge_char = ''
discharge_char = ''
def _get_text(self):
info = self._get_info()
if info is False:
return 'Error'
percent = info['now'] / info['full']
# Set the charging character
try:
# hide the text when it's higher than threshold, but still
# display `full` when the battery is fully charged.
if self.hide_threshold and \
info['now'] / info['full'] * 100.0 >= \
self.hide_threshold and \
info['stat'] != 'Full':
return ''
elif info['stat'] == 'Discharging':
char = self.discharge_char
time = info['now'] / info['power']
elif info['stat'] == 'Charging':
char = self.charge_char
time = (info['full'] - info['now']) / info['power']
else:
char = self.full_char
return self.not_charging_format.format(
percent=percent,
char=char)
except ZeroDivisionError:
time = -1
# Calculate the battery percentage and time left
if time >= 0:
hour = int(time)
min = int(time * 60) % 60
else:
hour = -1
min = -1
if info['stat'] == 'Discharging' and percent < self.low_percentage:
self.layout.colour = self.low_foreground
else:
self.layout.colour = self.foreground
return self.format.format(
power=info['power'] / 1000000,
char=char,
percent=percent,
hour=hour,
min=min
)
sep = lambda: widget.Sep(linewidth=0, padding=8)
screens = [
Screen(
top=bar.Bar(
[
widget.GroupBox(),
widget.Prompt(),
widget.TaskList(max_title_width=1920),
widget.TextBox(""),
widget.Volume(),
sep(),
widget.TextBox(""),
Battery(battery_name="BAT0"),
sep(),
widget.TextBox(""),
Battery(battery_name="BAT1"),
sep(),
widget.CPUGraph(),
widget.MemoryGraph(),
sep(),
widget.TextBox(""),
widget.Clock(format='%a %Y-%m-%d %H:%M:%S'),
sep(),
widget.Systray(),
],
26,
background="#252525"
),
),
]
# Drag floating layouts.
mouse = [
Drag([mod], "Button1", lazy.window.set_position_floating(),
start=lazy.window.get_position()),
Drag([mod], "Button3", lazy.window.set_size_floating(),
start=lazy.window.get_size()),
Click([mod], "Button2", lazy.window.bring_to_front())
]
dgroups_key_binder = None
dgroups_app_rules = []
main = None
follow_mouse_focus = True
bring_front_click = True
cursor_warp = False
floating_layout = layout.Floating(border_focus="#215578")
auto_fullscreen = True
# XXX: Gasp! We're lying here. In fact, nobody really uses or cares about this
# string besides java UI toolkits; you can see several discussions on the
# mailing lists, github issues, and other WM documentation that suggest setting
# this string if your java app doesn't work correctly. We may as well just lie
# and say that we're a working one by default.
#
# We choose LG3D to maximize irony: it is a 3D non-reparenting WM written in
# java that happens to be on java's whitelist.
wmname = "LG3D"

View File

@ -2,103 +2,71 @@
# general variables
backend=rofi
slop_color="255,0,0"
slop_border=2
hidecursor=yes
# the path where images, videos and pastes should be saved
img_path=$HOME/Pictures/Screenshots
vid_path=$HOME/Videos/Screencasts
paste_path=$HOME/Pictures/Paste
# some distibutions rename the gdbar binary to dzen2-gdbar
# set it here, accordingly
gdbar=gdbar
# editor to be used
# set viewer for images and videos plus editor for images
viewer=feh
editor=gimp
player=vlc
# Uploading & archiving options
# Possible Choices for ul: fb, scp, s3, imgur (imgur does not support videos)
# Hitting Enter will upload
always_ul=1
# Uploading options
# Possible Choices for img_ul: fb, scp, s3, imgur
# Possible Choices for vid_ul: fb, scp, s3
# Possible Choices for paste_ul: fb, scp, ix
#
# If you don't want a local history of images/videos,
# set archive_img/archive_vid to "0"
# keep in mind, that imgur does not support videos
ul=scp
img_ul=scp
vid_ul=scp
paste_ul=scp
archive_vid=1
archive_img=1
archive_paste=0
upload_vid=0
# filebin history
# for filebin history to work, you need to set your host here:
filebin_host=https://host.example.com
# For scp you need to provide the actual path on your server
# where your files should be stored
# this path normally should be within a http domain.
# also set the actual URL to the directory
scp_host=ratte
scp_path_img=/srv/sites/ianonavy.com/files
scp_path_vid=/srv/sites/ianonavy.com/files
scp_path_paste=/srv/sites/ianonavy.com/files
http_img=http://files.ianonavy.com
http_vid=http://files.ianonavy.com
http_paste=http://files.ianonavy.com
# s3 options
# same as scp options. set an actual path within your bucket, where
# files should be stored. Also set the URL to your directories.
s3_bucket=
s3_path_img=path/to/images
s3_path_vid=path/to/videos
s3_path_paste=path/to/pastes
s3_http_img=http://rasi-teiler.s3-website-eu-west-1.amazonaws.com/path/to/images
s3_http_vid=http://rasi-teiler.s3-website-eu-west-1.amazonaws.com/path/to/videos
s3_http_paste=http://rasi-teiler.s3-website-eu-west-1.amazonaws.com/path/to/pastes
# Screencast options
# Resolution to change to when recording:
res=800x600
# Ffmpeg settings
# Possible encoder options: libav and ffmpeg
# set this to 1, if ffmpeg version is < 1.7.1
ffmpeg_compat=0
encoder=ffmpeg
encopts="-r 30 -vcodec libx264 -pix_fmt yuv420p -s $res -acodec libmp3lame"
rect_encopts="-r 30 -c:v libx264 -preset slow -crf 18 -c:a libvorbis"
ffaudio="-f alsa -ac 2 -i pulse"
# Profile to use for screencasts
# profiles are stored in $HOME/.config/teiler/profiles
# teiler ships with 2 profiles atm. mp4-pulse and mp4-noaudio
profile="mp4-pulse"
# record indicator
rec_text="capturing..."
rec_w=100
rec_x=3400
rec_y=0
rec_font=PragmataPro-10
rec_font=Sans Mono-10
rec_nf=\#FFFFFF
rec_sf=\#000000
# Normally you don't want to change anything here!
SCREENCAST_PIDFILE=/tmp/$USER-teiler-screencast.pid
INDICATOR_PIDFILE=/tmp/$USER-teiler-indicator.pid
time=1000
namekey=teiler
random_string=$(date +%s | sha256sum | base64 | head -c 4 ; echo)
img_filemask=$random_string
vid_filemask=$random_string
paste_filemask=$random_string
random_string=$(date +'%Y-%m-%d-%H%M%S')
img_filemask=img-$random_string.png
paste_filemask=txt-$random_string.txt
# video filemask is without extension, since it gets the extension
# from set profile
vid_filemask=vid-$random_string
help_color="#0C73C2"
slop_color="255,0,0"
slop_border=2
hidecursor=yes
# slop options
slop_border=1
slop_color="255,0,0"
hidecursor=yes
###### rofi options ######
# rofi options ######
# here you can override options for rofi. normally rofi options
# are read from ~/.Xresources, so setting options there is recommended.
# you can dump options for ~/.Xresources with "rofi -dump-xresources"
rofiopts="-lines 25"
# rofiopts="-border 2 -width 35 -lines 40 -padding 12"

View File

@ -0,0 +1,105 @@
##### teiler configuration file ######
# general variables
backend=rofi
slop_color="255,0,0"
slop_border=2
hidecursor=yes
# the path where images, videos and pastes should be saved
img_path=$HOME/Pictures/Screenshots
vid_path=$HOME/Videos/Screencasts
paste_path=$HOME/Pictures/Paste
# some distibutions rename the gdbar binary to dzen2-gdbar
# set it here, accordingly
gdbar=gdbar
# editor to be used
editor=gimp
# Uploading & archiving options
# Possible Choices for ul: fb, scp, s3, imgur (imgur does not support videos)
# Possible Choices for paste_ul: fb, scp, ix
#
# If you don't want a local history of images/videos,
# set archive_img/archive_vid to "0"
# keep in mind, that imgur does not support videos
img_ul=scp
vid_ul=scp
paste_ul=scp
archive_vid=1
archive_img=1
archive_paste=0
upload_vid=0
# filebin history
# for filebin history to work, you need to set your host here:
filebin_host=https://host.example.com
# For scp you need to provide the actual path on your server
# where your files should be stored
# this path normally should be within a http domain.
# also set the actual URL to the directory
scp_host=ratte
scp_path_img=/srv/sites/ianonavy.com/files
scp_path_vid=/srv/sites/ianonavy.com/files
scp_path_paste=/srv/sites/ianonavy.com/files
http_img=http://files.ianonavy.com
http_vid=http://files.ianonavy.com
http_paste=http://files.ianonavy.com
# s3 options
# same as scp options. set an actual path within your bucket, where
# files should be stored. Also set the URL to your directories.
s3_bucket=
s3_path_img=path/to/images
s3_path_vid=path/to/videos
s3_path_paste=path/to/pastes
s3_http_img=http://rasi-teiler.s3-website-eu-west-1.amazonaws.com/path/to/images
s3_http_vid=http://rasi-teiler.s3-website-eu-west-1.amazonaws.com/path/to/videos
s3_http_paste=http://rasi-teiler.s3-website-eu-west-1.amazonaws.com/path/to/pastes
# Screencast options
# Resolution to change to when recording:
res=800x600
# Ffmpeg settings
# Possible encoder options: libav and ffmpeg
encoder=ffmpeg
encopts="-r 30 -vcodec libx264 -pix_fmt yuv420p -s $res -acodec libmp3lame"
rect_encopts="-r 30 -c:v libx264 -preset slow -crf 18 -c:a libvorbis"
ffaudio="-f alsa -ac 2 -i pulse"
# record indicator
rec_text="capturing..."
rec_w=100
rec_x=3400
rec_y=0
rec_font=PragmataPro-10
rec_nf=\#FFFFFF
rec_sf=\#000000
# Normally you don't want to change anything here!
SCREENCAST_PIDFILE=/tmp/$USER-teiler-screencast.pid
INDICATOR_PIDFILE=/tmp/$USER-teiler-indicator.pid
time=1000
namekey=teiler
random_string=$(date +%s | sha256sum | base64 | head -c 4 ; echo)
img_filemask=${random_string}.png
vid_filemask=${random_string}.mp4
paste_filemask=${random_string}.txt
###### rofi options ######
# here you can override options for rofi. normally rofi options
# are read from ~/.Xresources, so setting options there is recommended.
# you can dump options for ~/.Xresources with "rofi -dump-xresources"
rofiopts="-lines 25"

View File

@ -0,0 +1,7 @@
# do not edit this file. instead make a copy under different name
# teiler will overwrite this file on start
encopts="-r 30 -vcodec libx264 -pix_fmt yuv420p -s $res -acodec libmp3lame"
rect_encopts="-r 30 -c:v libx264 -preset slow -crf 18 -c:a libvorbis"
ext="mp4"
ffaudio=""

View File

@ -0,0 +1,7 @@
# do not edit this file. instead make a copy under different name
# teiler will overwrite this file on start
encopts="-r 30 -vcodec libx264 -pix_fmt yuv420p -s $res -acodec libmp3lame"
rect_encopts="-r 30 -c:v libx264 -preset slow -crf 18 -c:a libvorbis"
ext="mp4"
ffaudio="-f alsa -ac 2 -i pulse"

View File

@ -0,0 +1,9 @@
#!/bin/bash
s3_bucket=
s3_path_img=path/to/images
s3_path_vid=path/to/videos
s3_path_paste=path/to/pastes
s3_http_img=http://S3_DOMAIN/path/to/images
s3_http_vid=http://S3_DOMAIN/path/to/videos
s3_http_paste=http://S3_DOMAIN/path/to/pastes

View File

@ -0,0 +1,10 @@
#!/bin/bash
scp_host=ratte
scp_path_img=/srv/sites/ianonavy.com/files
scp_path_vid=/srv/sites/ianonavy.com/files
scp_path_paste=/srv/sites/ianonavy.com/files
http_img=https://ianonavy.com/files
http_vid=https://ianonavy.com/files
http_paste=https://ianonavy.com/files