1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 | # == Options
set :step, 5
set :snap, 10
set :gravity, :top_left
set :urgent, false
set :resize, false
set :tiling, false
#set :separator, "||"
# == Screen
screen 1 do
top [ :title, :center, :views, :center, :spacer, :mpd, :clock ]
end
# == Styles
term_bg = "#1c1c1c"
term_white = "#ccccc6"
term_green = "#6eb047"
term_red = "#b94b64"
term_blue = "#4e89b0"
style :all do
background term_bg
border "#303030", 0
padding 0, 3
font "xft:inconsolata:size=14:antialias=false"
end
style :views do
foreground "#757575"
style :focus do
foreground term_green
end
style :urgent do
foreground term_red
end
style :occupied do
foreground term_white
end
end
style :sublets do
foreground "#757575"
end
style :separator do
foreground "#757575"
end
style :title do
foreground term_blue
end
style :clients do
active "#303030", 2
inactive "#202020", 2
margin 0
width 50
end
style :subtle do
margin 0, 0, 0, 0
panel term_bg
#background "#3d3d3d"
stipple "#757575"
end
# == Gravities
gravity :top_left, [ 0, 0, 50, 50 ]
gravity :top_left66, [ 0, 0, 50, 67 ]
gravity :top_left33, [ 0, 0, 50, 33 ]
gravity :top, [ 0, 0, 100, 50 ]
gravity :top66, [ 0, 0, 100, 66 ]
gravity :top33, [ 0, 0, 100, 33 ]
gravity :top_right, [ 50, 0, 50, 50 ]
gravity :top_right66, [ 50, 0, 50, 67 ]
gravity :top_right33, [ 50, 0, 50, 33 ]
gravity :left, [ 0, 0, 50, 100 ]
gravity :left66, [ 0, 0, 67, 100 ]
gravity :left33, [ 0, 0, 33, 100 ]
gravity :center, [ 0, 0, 100, 100 ]
gravity :center66, [ 17, 17, 66, 66 ]
gravity :center33, [ 33, 33, 33, 33 ]
gravity :right, [ 50, 0, 50, 100 ]
gravity :right66, [ 33, 0, 67, 100 ]
gravity :right33, [ 67, 50, 33, 100 ]
gravity :bottom_left, [ 0, 50, 50, 50 ]
gravity :bottom_left66, [ 0, 33, 50, 67 ]
gravity :bottom_left33, [ 0, 67, 50, 33 ]
gravity :bottom, [ 0, 50, 100, 50 ]
gravity :bottom66, [ 0, 34, 100, 66 ]
gravity :bottom33, [ 0, 67, 100, 33 ]
gravity :bottom_right, [ 50, 50, 50, 50 ]
gravity :bottom_right66, [ 50, 33, 50, 67 ]
gravity :bottom_right33, [ 50, 67, 50, 33 ]
gravity :misc_top, [ 67, 0, 33, 50 ]
gravity :misc_top66, [ 67, 0, 33, 67 ]
gravity :misc_top33, [ 67, 0, 33, 33 ]
gravity :misc_cent, [ 67, 33, 33, 34 ]
gravity :misc_bot, [ 67, 50, 33, 50 ]
gravity :misc_bot66, [ 67, 33, 33, 67 ]
gravity :misc_bot33, [ 67, 67, 33, 33 ]
gravity :gimp_image, [ 10, 0, 80, 100 ]
gravity :gimp_toolbox, [ 0, 0, 10, 100 ]
gravity :gimp_dock, [ 90, 0, 10, 100 ]
# == Grabs
grab "W-1", :ViewJump1
grab "W-2", :ViewJump2
grab "W-3", :ViewJump3
grab "W-4", :ViewJump4
grab "W-5", :ViewJump5
grab "W-Return", :ViewNext
grab "W-BackSpace", :ViewPrev
grab "W-C-r", :SubtleReload
grab "W-C-S-r", :SubtleRestart
grab "W-C-q", :SubtleQuit
grab "W-B1", :WindowMove
grab "W-B3", :WindowResize
grab "W-f", :WindowFloat
grab "W-space", :WindowFull
grab "W-t", :WindowStick
grab "KP_Add", :WindowRaise
grab "KP_Subtract", :WindowLower
grab "W-h", :WindowLeft
grab "W-j", :WindowDown
grab "W-k", :WindowUp
grab "W-l", :WindowRight
grab "W-S-k", :WindowKill
# Gravity grabs
grab "W-q", [ :top_left, :top_left66, :top_left33 ]
grab "W-w", [ :top, :top66, :top33 ]
grab "W-e", [ :top_right, :top_right66, :top_right33 ]
grab "W-a", [ :left, :left66, :left33 ]
grab "W-s", [ :center, :center66, :center33 ]
grab "W-d", [ :right, :right66, :right33 ]
grab "W-z", [ :bottom_left, :bottom_left66, :bottom_left33 ]
grab "W-x", [ :bottom, :bottom66, :bottom33 ]
grab "W-c", [ :bottom_right, :bottom_right66, :bottom_right33 ]
grab "W-S-e", [ :misc_top, :misc_top66, :misc_top33 ]
grab "W-S-d", [ :misc_cent ]
grab "W-S-c", [ :misc_bot, :misc_bot66, :misc_bot33 ]
# Application grabs
grab "A-Home", <<SCRIPT
urxvtc -pe tabbed
if [ $? -eq 2 ]; then
urxvtd -q -o -f
urxvtc -pe tabbed
fi
SCRIPT
grab "A-Escape", "dmenu_run -i -fn 'xft:inconsolata:pixelsize=13' -nf '#ccccc6' -sf '#ccccc6' -sb '#6eb047'"
grab "A-n", "urxvtc -name ncmpcpp -e ncmpcpp"
grab "A-S-i", "rxvt -name screen -e screen irssi"
grab "A-i", "urxvtc -name screen -e screen -raAd"
grab "A-f", "urxvtc -name ranger -e ranger"
grab "A-S-e", "rxvt -name emacs -e emacs -nw"
grab "A-S-v", "urxvtc -pe tabbed -name vim -e vim"
#grab "A-t", "urxvtc -name transmission -e python2 /usr/bin/transmission-remote-cli.py"
grab "S-Return", "rxvt"
# Media bindings
grab "XF86AudioRaiseVolume", "amixer set Master 5+ toggle unmute"
grab "XF86AudioLowerVolume", "amixer set Master 5- toggle unmute"
grab "XF86AudioMute", "amixer set Master toggle"
grab "XF86AudioPlay", "ncmpcpp toggle"
grab "XF86AudioNext", "ncmpcpp next"
grab "XF86AudioPrev", "ncmpcpp prev"
# Misc
grab "A-Tab" do
Subtlext::Client.recent[1].focus
end
# == Tags
tag "urxvt" do
match :instance => "urxvt"
gravity :top_left
end
tag "brlcad" do
match :class => "TopLevel"
float true
end
tag "browser" do
match "nightly|chromium|firefox"
gravity :left66
end
tag "filezilla" do
match "filezilla"
gravity :right
end
tag "zathura" do
match "zathura"
gravity :right
end
tag "thunderbird" do
match "thunderbird"
gravity :left
end
tag "wine" do
match :class => "explorer.exe|Wine"
resize true
float true
end
tag "racket" do
match "drracket"
gravity :left66
end
tag "ncmpcpp" do
match :instance => "ncmpcpp"
gravity :top_left
end
tag "irssi" do
match :instance => "screen"
gravity :right
end
tag "mplayer" do
match "MPlayer"
float true
stick true
end
tag "feh" do
match "feh"
float true
end
# Gimp
tag "gimp_image" do
match :role => "gimp-image-window"
gravity :gimp_image
end
tag "gimp_toolbox" do
match :role => "gimp-toolbox$"
gravity :gimp_toolbox
end
tag "gimp_dock" do
match :role => "gimp-dock"
gravity :gimp_dock
end
# == Views
view "terms", "urxvt|zathura|brlcad"
view "net", "browser|filezilla"
view "media", "wine|ncmpcpp"
view "chat", "thunderbird|irssi"
view "misc", "default|racket|gimp_image|gimp_toolbox|gimp_dock|gimp_misc"
# == Sublets
col_red = Subtlext::Color.new("#b94b64")
col_blue = Subtlext::Color.new("#4e89b0")
coffee = Subtlext::Color.new("#c0ffee")
sublet :clock do
interval 30
format_string "#{col_blue}%l:%M#{coffee}"
end
sublet :mpd do
interval 10
show_icons false
format_string "#{coffee}%note%#{col_red}%artist% - %title%"
end
# == Hooks
on :start do
# start up processes
Subtlext::Subtle.spawn("sh $HOME/scripts/autostart.sh")
# Create default tags
views = Subtlext::View.all.map { |v| v.name }
tags = Subtlext::Tag.all.map { |t| t.name }
views.each do |v|
unless tags.include?(v)
t = Subtlext::Tag.new(v)
t.save
end
end
end
on :reload do
# Preserve default tags
views = Subtlext::View.all.map { |v| v.name }
tags = Subtlext::Tag.all.map { |t| t.name }
views.each do |v|
unless tags.include?(v)
t = Subtlext::Tag.new(v)
t.save
end
end
end
on :client_create do |c|
view = Subtlext::View.current
tags = c.tags.map { |t| t.name }
# Add tag to current view
view.tag(view.name) unless view.tags.include?(view.name)
# Assign tag to clients with default tag only
if tags.include?("default") and tags.size == 1
c.tags = [ view.name ]
c.gravity = :top_right
c.focus
end
end
# Focus client if tagged in current view
on :client_create do |c|
c.views.find { |view| c.focus if Subtlext::View.current == view }
end
#
|
x