Skip to content

Instantly share code, notes, and snippets.

@maxmeyer
Last active March 20, 2018 19:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxmeyer/4547961 to your computer and use it in GitHub Desktop.
Save maxmeyer/4547961 to your computer and use it in GitHub Desktop.
conky vs. subtle wm
#####
# conky behaviour
background yes
own_window yes # window for conky
own_window_class conky-system #
own_window_type normal # normal window
TEXT
% subtler -l -c
>>> ERROR: No geometry given
/usr/lib/ruby/site_ruby/1.9.1/subtle/subtler/runner.rb:282:in `gravity'
/usr/lib/ruby/site_ruby/1.9.1/subtle/subtler/runner.rb:282:in `printer'
/usr/lib/ruby/site_ruby/1.9.1/subtle/subtler/runner.rb:256:in `call_or_print'
/usr/lib/ruby/site_ruby/1.9.1/subtle/subtler/runner.rb:264:in `block in handle_result'
/usr/lib/ruby/site_ruby/1.9.1/subtle/subtler/runner.rb:263:in `each'
/usr/lib/ruby/site_ruby/1.9.1/subtle/subtler/runner.rb:263:in `handle_result'
/usr/lib/ruby/site_ruby/1.9.1/subtle/subtler/runner.rb:239:in `handle_command'
/usr/lib/ruby/site_ruby/1.9.1/subtle/subtler/runner.rb:171:in `run'
/usr/bin/subtler:17:in `<main>'
# encoding: utf-8
#
# == Load enhancements
# == Options
# Window move/resize steps in pixel per keypress
set :increase_step, 5
set :border_snap, 10
#set :default_gravity, :top_left
set :urgent_dialogs, false
set :honor_size_hints, true
set :gravity_tiling, false
set :click_to_focus, false
set :skip_pointer_warp, false
set :skip_urgent_warp, false
set :wmname, "LG3D"
#
# == Screen
screen 1 do
#stipple Subtlext::Icon.new("~/stipple.xbm")
top [ :views, :title, :tray , :clock]
bottom []
end
# == Styles
all_background = "#202020"
all_icon = "#b8b8b8"
all_border = [ "#303030", 0 ]
all_padding = [ 0, 3 ]
all_font = "xft:sans-11"
views_foreground = "#757575"
views_font = "xft:sans-13"
views_padding = [ 3, 3 ]
focus_foreground = "#fecf35"
urgent_foreground = "#ff9800"
occupied_foreground = "#b8b8b8"
sublets_foreground = "#757575"
separator_foreground = "#757575"
separator_symbol = "|"
title_foreground = "#fecf35"
clients_active = [ "#ff0000", 10 ]
clients_inactive = [ "#202020", 0 ]
clients_margin = [ 0 ]
clients_width = 50
subtle_margin = [ 0, 0, 0, 0 ]
subtle_panel = "#202020"
subtle_background = "#3d3d3d"
subtle_stipple = "#757575"
style :all do
background all_background
icon all_icon
border *all_border
padding *all_padding
font all_font
end
# Style for the all views
style :views do
foreground views_foreground
font views_font
padding *views_padding
# Style for the active views
style :focus do
foreground focus_foreground
end
# Style for urgent window titles and views
style :urgent do
foreground urgent_foreground
end
# Style for occupied views (views with clients)
style :occupied do
foreground occupied_foreground
end
end
# Style for sublets
style :sublets do
foreground sublets_foreground
end
# Style for separator
style :separator do
foreground separator_foreground
separator separator_symbol
end
# Style for focus window title
style :title do
foreground title_foreground
end
# Style for active/inactive windows
style :clients do
active *clients_active
inactive *clients_inactive
margin *clients_margin
width clients_width
end
# Style for subtle
style :subtle do
margin *subtle_margin
panel subtle_panel
background subtle_background
stipple subtle_stipple
end
# Top left
gravity :top_left, [ 0, 0, 50, 50 ]
gravity :top_left66, [ 0, 0, 50, 66 ]
gravity :top_left33, [ 0, 0, 50, 34 ]
# Top
gravity :top, [ 0, 0, 100, 50 ]
gravity :top75, [ 0, 0, 100, 75 ]
gravity :top66, [ 0, 0, 100, 66 ]
gravity :top33, [ 0, 0, 100, 34 ]
# Top right
gravity :top_right, [ 50, 0, 50, 50 ]
gravity :top_right66, [ 50, 0, 50, 66 ]
gravity :top_right33, [ 50, 0, 50, 33 ]
# Left
gravity :left, [ 0, 0, 50, 100 ]
gravity :left66, [ 0, 0, 66, 100 ]
gravity :left33, [ 0, 0, 33, 100 ]
# Center
gravity :center, [ 0, 0, 100, 100 ]
gravity :center66, [ 17, 17, 66, 66 ]
gravity :center33, [ 33, 33, 33, 33 ]
gravity :center_hwide33, [ 0, 34, 100, 33 ]
gravity :center_vwide33, [ 33, 0, 34, 100 ]
# Right
gravity :right, [ 50, 0, 50, 100 ]
gravity :right66, [ 34, 0, 66, 100 ]
gravity :right33, [ 67, 0, 33, 100 ]
# Bottom left
gravity :bottom_left, [ 0, 50, 50, 50 ]
gravity :bottom_left25, [ 0, 75, 50, 25 ]
gravity :bottom_left66, [ 0, 34, 50, 66 ]
gravity :bottom_left33, [ 0, 67, 50, 33 ]
# Bottom
gravity :bottom, [ 0, 50, 100, 50 ]
gravity :bottom66, [ 0, 34, 100, 66 ]
gravity :bottom33, [ 0, 67, 100, 33 ]
# Bottom right
gravity :bottom_right, [ 50, 50, 50, 50 ]
gravity :bottom_right25, [ 50, 75, 50, 25 ]
gravity :bottom_right66, [ 50, 34, 50, 66 ]
gravity :bottom_right33, [ 50, 67, 50, 33 ]
# Gimp
gravity :gimp_image, [ 10, 0, 80, 100 ]
gravity :gimp_toolbox, [ 0, 0, 10, 100 ]
gravity :gimp_dock, [ 90, 0, 10, 100 ]
# == Grabs
modkey = "W"
gravkeys = [ "q", "w", "e", "a", "s", "d", "y", "x", "c" ]
# Views and screens
(1..6).each do |i|
grab modkey + "-#{i}", "ViewSwitch#{i}".to_sym
grab modkey + "-S-#{i}", "ViewJump#{i}".to_sym
grab modkey + "-F#{i}", "ScreenJump#{i}".to_sym
end
# Windows
# Movement
{
WindowLeft: [ "Left", "h" ], WindowDown: [ "Down", "j" ],
WindowUp: [ "Up", "k" ], WindowRight: [ "Right", "l" ]
}.each do |k, v|
grab "%s-%s" % [ modkey, v.first ], k
grab "%s-%s" % [ modkey, v.last ], k
end
# Reload/restart
grab modkey + "-C-q", :SubtleQuit
grab modkey + "-C-r", :SubtleReload
grab modkey + "-C-A-r", :SubtleRestart
# Gravity keys and focus
gravities = [
[:top_left, :top_left33, :top_left66],
[:top, :top33, :top66, :top75],
[:top_right, :top_right33, :top_right66],
[:left, :left33, :left66],
[:center, :center33, :center66],
[:right, :right33, :right66],
[:bottom_left, :bottom_left25, :bottom_left33, :bottom_left66],
[:bottom, :bottom33, :bottom66],
[:bottom_right, :bottom_right25, :bottom_right33, :bottom_right66]
]
gravities.each_index do |i|
# Set gravities
grab "%s-%s" % [ modkey, gravkeys[i] ], gravities[i]
end
grab modkey + "-Return", "xterm"
# Tabbing clients
grab modkey + "-Tab" do
Subtlext::Client.recent[1].focus
end
grab "A-Tab" do
clients = Subtlext::Client.visible
clients.last.instance_eval do
focus
raise
end
end
grab "A-S-Tab" do
clients = Subtlext::Client.visible
clients.first.instance_eval do
focus
lower
end
end
#grab "XF86Battery", ""
#grab "XF86WakeUp", ""
#grab "XF86WLAN", ""
#grab "XF86TouchpadToggle", ""
#grab "XF86MonBrightnessDown", ""
#grab "XF86MonBrightnessUp", ""
#== TAGs
#view placement
tag "terms" do
match "xterm"
gravity :center66
end
tag "maintenance:left" do
match class: "conky-daily"
gravity :left33
end
tag "maintenance:right" do
#match class: "conky-system"
match "Conky"
gravity :right33
end
view "1" do
match "terms"
end
view "2" do
match "^maintenance:"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment