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 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 | # Author:: s__C
#
# == General options {{{
#
require "socket"
# Border size in pixel of the windows
# Window move/resize steps in pixel per keypress
set :step, 3
# Window screen border snapping
set :snap, 0
# Default starting gravity for windows (0 = gravity of last client)
set :gravity, :center
# Make transient windows urgent
set :urgent, false
# Enable respecting of size hints globally
set :resize, false
# Java
set :wmname, "LG3D"
# Font string either take from e.g. xfontsel or use xft
set :font, "-misc-fixed-medium-r-*-*-12-*-*-*-*-*-iso10646-*"
#set :font, "xft:HeldustryFTVBasic Black:pixelsize=10"
#set :font, "xft:Mensch-8"
#set :font, "xft:M+\ 2m-9"
#set :font, "xft:Luxi\ Mono-8"
#set :font, "xft:Drift-8"
#set :font, "xft:Arial\ Black-10"
# Separator between sublets
set :separator, ""
# }}}
#
# == Screen {{{
#
screen 1 do
# Add stipple to panels
stipple false
# Content of the top panel
top [ :title, :spacer, :clock, :spacer, :mpd, :volume, :battery, :wifi, :tray, :views ]
# Content of the bottom panel
bottom [ ]
end
# }}}
#
# == Styles {{{
#
style :title do
padding 2, 10, 2, 4
foreground "#909090"
background "#151515"
end
style :views do
padding 2, 4, 6, 4
style :focus do
border_bottom "#bdf13d", 2
foreground "#bdf13d"
background "#151515"
end
style :unoccupied do
border_bottom "#151515", 2
foreground "#303030"
background "#151515"
end
style :urgent do
border_bottom "#151515", 2
foreground "#151515"
background "#ff8f00"
end
style :occupied do
border_bottom "#606060", 2
foreground "#606060"
background "#151515"
end
end
style :sublets do
padding 2, 10, 2, 4
background "#151515"
style :clock do
foreground "#5496ff"
end
style :volume do
foreground "#bdf13d"
end
style :wifi do
foreground "#ff8f00"
end
style :battery do
foreground "#b50077"
end
style :mpd do
foreground "#ff6767"
end
end
style :separator do
padding 2, 4, 2, 4
foreground "#505050"
background "#151515"
end
style :clients do
active "#606060", 2
inactive "#151515", 2
margin 2
end
style :subtle do
padding 2
panel_top "#151515"
panel_bottom "#151515"
launcher_top "#202020"
launcher_bottom "#ff0000"
stipple "#757575"
end
# }}}
#
# == Gravities {{{
#
# Gravities
gravity :top_left, [0, 0, 50, 50]
gravity :top_left75, [0, 0, 50, 75]
gravity :top, [50, 0, 100, 50]
gravity :top75, [0, 0, 100, 75]
gravity :top_right, [50, 0, 50, 50]
gravity :top_right75, [50, 0, 50, 75]
gravity :left, [0, 0, 50, 100]
gravity :center, [0, 0, 100, 100]
gravity :right, [50, 0, 50, 100]
gravity :bottom_left, [0, 50, 50, 50]
gravity :bottom_left25, [0, 75, 50, 25]
gravity :bottom, [0, 50, 100, 50]
gravity :bottom25, [0, 75, 100, 25]
gravity :bottom_right, [50, 50, 50, 50]
gravity :bottom_right25, [50, 75, 50, 25]
# Gimp
gravity :gimp_image, [ 10, 0, 80, 100 ]
gravity :gimp_toolbox, [ 0, 0, 10, 100 ]
gravity :gimp_dock, [ 90, 0, 10, 100 ]
# Scratchpad
gravity :scratch, [ 25, 45, 50, 20 ]
# }}}
#
# == Grabs {{{
#
# Launcher+Selector
begin
require "#{ENV["HOME"]}/subtle-contrib/ruby/launcher.rb"
# Set fonts
Subtle::Contrib::Launcher.fonts = ["-misc-fixed-medium-r-*-*-14-*-*-*-*-*-iso10646-*"]
Subtle::Contrib::Launcher.paths = [
"/usr/bin"
]
rescue LoadError => error
puts error
end
begin
require "#{ENV["HOME"]}/subtle-contrib/ruby/selector.rb"
Subtle::Contrib::Selector.font = "-misc-fixed-medium-r-*-*-14-*-*-*-*-*-iso10646-*"
rescue LoadError => error
puts error
end
grab "W-x" do
Subtle::Contrib::Launcher.run
end
grab "W-y" do
Subtle::Contrib::Selector.run
end
# Jump to view1, view2, ...
grab "W-S-1", :ViewJump1
grab "W-S-2", :ViewJump2
grab "W-S-3", :ViewJump3
grab "W-S-4", :ViewJump4
grab "W-S-5", :ViewJump5
grab "W-S-6", :ViewJump6
grab "W-S-7", :ViewJump7
# Switch current view
grab "W-1", :ViewSwitch1
grab "W-2", :ViewSwitch2
grab "W-3", :ViewSwitch3
grab "W-4", :ViewSwitch4
grab "W-5", :ViewSwitch5
grab "W-6", :ViewSwitch6
grab "W-7", :ViewSwitch7
# Select next and prev view */
grab "W-Right", :ViewNext
grab "W-Left", :ViewPrev
# Move mouse to screen1, screen2, ...
grab "W-A-1", :ScreenJump1
grab "W-A-2", :ScreenJump2
grab "W-A-3", :ScreenJump3
grab "W-A-4", :ScreenJump4
# Force reload of config and sublets
grab "W-C-r", :SubtleReload
# Force restart of subtle
grab "W-C-S-r", :SubtleRestart
# Quit subtle
grab "W-C-q", :SubtleQuit
# Move current window
grab "W-B1", :WindowMove
# Resize current window
grab "W-B3", :WindowResize
# Toggle floating mode of window
grab "A-f", :WindowFloat
# Toggle fullscreen mode of window
grab "A-space", :WindowFull
# Toggle sticky mode of window (will be visible on all views)
grab "A-s", :WindowStick
# Raise window
grab "A-r", :WindowRaise
# Lower window
grab "A-l", :WindowLower
# Select next windows
grab "C-Left", :WindowLeft
grab "C-Down", :WindowDown
grab "C-Up", :WindowUp
grab "C-Right", :WindowRight
# Kill current window
grab "A-q", :WindowKill
# Cycle between given gravities
grab "W-KP_7", [ :top_left, :top_left75 ]
grab "W-KP_8", [ :top, :top75 ]
grab "W-KP_9", [ :top_right, :top_right75 ]
grab "W-KP_4", [ :left ]
grab "W-KP_5", [ :center ]
grab "W-KP_6", [ :right ]
grab "W-KP_1", [ :bottom_left, :bottom_left25 ]
grab "W-KP_2", [ :bottom, :bottom25 ]
grab "W-KP_3", [ :bottom_right, :bottom_right25 ]
# Exec programs
grab "W-Return", "urxvtc"
grab "W-c", "chromium"
grab "W-h", "hotot"
grab "W-m", "urxvtc -name mutt -e mutt"
grab "W-n", "mpd && urxvtc -name ncmpcpp -e ncmpcpp || urxvtc -name ncmpcpp -e ncmpcpp"
grab "W-t", "urxvtc -name tmux -e tmux"
grab "W-a", "urxvtc -name tmux -e tmux a"
grab "W-f", "firefox"
grab "W-C-f", "filezilla"
grab "W-p", "thunar"
grab "W-r", "urxvtc -name ranger -e mc"
grab "W-v", "gvim"
# MPC grabs
grab "W-C-Right", "mpc next"
grab "W-C-Left", "mpc prev"
grab "W-C-Down", "mpc toggle"
# Scratchpad
grab "W-s" do
if((c = Subtlext::Client["scratch"]))
c.toggle_stick
c.focus
elsif((c = Subtlext::Subtle.spawn("urxvtc -name scratch")))
c.tags = []
c.flags = [ :stick ]
end
end
# Run Ruby lambdas
grab "S-F2" do |c|
puts c.name
end
grab "S-F3" do
puts Subtlext::VERSION
end
# }}}
#
# == Tags {{{
#
# Simple tags
tag "www" do
match :class => "uzbl|iron|opera|firefox|chromium|dwb|jumanji"
end
tag "vec" do
match :class => "inkscape|shotwell"
end
tag "vb" do
match :class => "virtualbox"
end
tag "term" do
match :instance => "xterm|[u]?rxvt"
#exclude "vim|scratch|mutt|tmux|ncmpcpp|screen"
end
tag "vim" do
match :class => "gvim"
gravity :center
end
tag "tmux" do
match :instance => "tmux|screen"
gravity :top75
end
tag "mpd" do
match :instance => "ncmpcpp"
gravity :bottom25
end
tag "mail" do
match :instance => "mutt"
end
tag "scratchpad" do
match :instance => "scratch"
gravity :scratch
urgent true
stick true
end
tag "default" do
gravity :center33
end
tag "fm" do
match :class => "thunar"
gravity :top75
end
tag "tor" do
match :class => "deluge"
gravity :bottom25
end
tag "matlab" do
match :class => ".*mat(lab|hworks).*"
full true
end
tag "flash" do
match :class => "<unkown>|exe|operapluginwrapper"
stick true
end
tag "editor" do
match :class => "gedit|texmaker|eclipse|geany"
resize false
end
tag "view" do
match :class => "zathura|evince"
float true
resize true
end
tag "fixed" do
geometry [ 10, 10, 100, 100 ]
stick true
end
tag "resize" do
match :class => "sakura|gedit"
resize true
end
# Modes
tag "stick" do
match :instance => "mplayer|ranger"
float true
stick true
end
tag "float" do
match "display"
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
tag "dialogs" do
match :type => :dialog
match :type => :splash
center true
stick true
end
# }}}
#
# == Views {{{
#
view "term" do
match "term|mpd|tmux"
dynamic false
icon "#{ENV["HOME"]}/.local/share/subtle/icons/terminal.xbm"
icon_only true
end
view "www" do
match "www"
dynamic false
icon "#{ENV["HOME"]}/.local/share/subtle/icons/world.xbm"
icon_only true
end
view "bullshit" do
match "default|hotot|fm|tor"
dynamic false
icon "#{ENV["HOME"]}/.local/share/subtle/icons/quote.xbm"
icon_only true
end
view "dev" do
match "editor|vim"
dynamic false
icon "#{ENV["HOME"]}/.local/share/subtle/icons/notepad.xbm"
icon_only true
end
view "design" do
match "vec|gimp_.*"
dynamic false
icon "#{ENV["HOME"]}/.local/share/subtle/icons/diagram.xbm"
icon_only true
end
view "vbox" do
match "vb"
dynamic false
icon "#{ENV["HOME"]}/.local/share/subtle/icons/pc.xbm"
icon_only true
end
view "prog" do
match "matlab"
dynamic true
end
# }}}
#
# Sublets {{ {
#
sublet :clock do
format_string "%d.%m.%y %H:%M"
end
sublet :mpd do
format_string "%note% %artist% - %album% - %title%"
show_icons false
pause_text "pause"
not_running_text "--"
end
# }}}
|
x
crshd said about 13 years ago
Hehe :D
aleks223 said about 13 years ago
Well spotted…