Author Topic: Using FLUXBOX as a Window Manager  (Read 25668 times)

dizzie

  • DEFCON 1
  • Posts: 729
  • Bastard Operator From Hell
    • View Profile
Re: Using FLUXBOX as a Window Manager
« Reply #60 on: September 16, 2013, 08:47:20 AM »
Wow!  That is really nice.  I am curious as to what the tiling users will see in this

Thanks for sharing!


I see..... (get ready for this) Possibilities, very nicely done Packrat  ;D
Reclaim your culture, it's within your reach!

My Blog | Facebook | Twitter | G+ | VSIDO |


PackRat

  • Posts: 1979
    • View Profile
Re: Using FLUXBOX as a Window Manager
« Reply #61 on: September 16, 2013, 11:32:06 AM »
^, ^^ muchas gracias

Started out as an exercise in using MacroCmd and ToggleCmd (see fluxbox wiki for details) - I chose window placement to see if I could replicate the Win-Left/Right/Up/Down behavior of Windows 7. Used only native fluxbox commands and have hit a couple snags when multiple windows are open - tiling to the right doesn't always work - but will if the key binding is invoked again; unfortunately, I do not know of a way for fluxbox to resize a window based on a percentage of the desktop, not pixels (my commands are for 1366x768 laptop, adjust for your monitors). I suspect that using scripts with wmctl and/or xdotool smoother tiling is possible. Adding ToggleDecor to the command string would probably be beneficial too.



as far as I know, pytile works with fluxbox - but that's cheating  ;)
the object with this exercise is to use fluxbox's internal commands to get the desired results.

Edit - Received a telepathic message from Captain Obvious this morning (in my world she looks like Salma Hayek); if 50% is used instead of, say 50, with the ResizeTo command, fluxbox will interpret that as 50% of the desktop real estate and account for the fluxbox toolbar and anything docked in the slit (conky in my instance) rather than 50 pixels.



now just have to solve issue of tiling to right.

Edit #2 - last one, I promise - MacroCmd is read left to right so the order matters:

ToggleDecor --> ResizeTo --> MoveTo = the proper order, all the windows are tiled as desired.



and the code, one chain to untile the active window:

Code: [Select]
# manual tiling with key chains - useing chains to avoid clash with keybindings #

Ctrl a Mod4 h :ArrangeWindowsHorizontal
Ctrl a Mod4 v :ArrangeWindowsVertical

Ctrl a Mod4 l :MacroCmd {ResizeTo 50% 50%} {MoveTo 0 0 UpperLeft} {MaximizeVertical}
Ctrl a Mod4 r :MacroCmd {ResizeTo 50% 50%} {MoveTo 0 0 UpperRight} {MaximizeVertical}
Ctrl a Mod4 t :MacroCmd {ResizeTo 50% 50%} {MoveTo 0 0 UpperLeft} {MaximizeHorizontal}
Ctrl a Mod4 b :MacroCmd {ResizeTo 50% 50%} {MoveTo 0 0 LowerLeft} {MaximizeHorizontal}

Ctrl a Mod1 h :MacroCmd {ToggleDecor} {ResizeTo 50% 50%} {MoveTo 0 0 UpperLeft}
Ctrl a Mod1 j :MacroCmd {ToggleDecor} {ResizeTo 50% 50%} {MoveTo 0 0 UpperRight}
Ctrl a Mod1 k :MacroCmd {ToggleDecor} {ResizeTo 50% 50%} {MoveTo 0 0 LowerLeft}
Ctrl a Mod1 l :MacroCmd {ToggleDecor} {ResizeTo 50% 50%} {MoveTo 0 0 LowerRight}

Ctrl a Mod4 m :MacroCmd {ToggleDecor} {Resize 60% 40%} {MoveTo 0 0 Center}

enough for now, time to back up files and set up for Velociraptor install.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

Digit

  • Techno Hippie
  • Posts: 295
  • savant (alegedly), polymath (wannabe)
    • View Profile
    • wastedartist.com
Re: Using FLUXBOX as a Window Manager
« Reply #62 on: September 24, 2013, 10:17:10 AM »
loving the pseudo tiling stuff there packrat.  kinda surprised no one was meddling with it sooner.   of all the features, i think that's the stuff i missed the most in openbox.  all that fill to edges stuff, etc. 

PackRat

  • Posts: 1979
    • View Profile
Re: Using FLUXBOX as a Window Manager
« Reply #63 on: September 24, 2013, 12:19:12 PM »
^ They are are basically move and resize command combinations; should be doable in openbox and pekwm.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

statmonkey

  • Posts: 330
    • View Profile
Re: Using FLUXBOX as a Window Manager
« Reply #64 on: September 24, 2013, 05:02:36 PM »
Very interesting ectropy.  Not sure I follow all of it but starting to see why I am not getting many auto adds to my menu.  I guess that would be none.  I assume that when the /usr/share/applications/*.desktop file has a Categories line that you don't have setup it is not going to create it, so there fore it is not going to show.  Is that right?  I am going to research this, I really have never paid much attention to desktop entries before so a whole 'nother rabbit hole to jump down.  Thanks ... I think  ::)

PackRat

  • Posts: 1979
    • View Profile
Re: Using FLUXBOX as a Window Manager
« Reply #65 on: July 05, 2015, 01:13:28 AM »
I'll post this here since I don't want to start a new topic just for this configuration.

These are the layers (highest to lowest) defined by fluxbox:

Code: [Select]
    2 - Above Dock

    4 - Dock

    6 - Top

    8 - Normal

    10 - Bottom

    12 - Desktop

What's important to note for this configuration is that, in fluxbox, the Desktop is an actual named layer that is below everything including the Normal layer (Normal is where open windows are sitting as you're working).

This key binding will provide (toggle actually) the typical show desktop functionality:

Code: [Select]
Mod1 F12 :ToggleCmd {ShowDesktop} {DeIconify all originquiet}
so Alt-F12 will show desktop, Alt-F12 again will return the windows to their previous positions.

However, since Desktop is a layer, what the ShowDesktop command actually does is iconify all windows that are not residing on the Desktop layer, or docked in the slit (the upper conky in these screenshots) - this includes conky windows which typically reside on the bottom layer of a window manager (Bottom is layer 10):

     

If you want conky (or another app) to remain open when ShowDesktop is invoked, use the ~/.fluxbox/apps file to place those windows on the Desktop Layer (12).

For conky, in the ~/.fluxbox/apps:

Code: [Select]
[app] (name=Conky) (class=Conky)
  [Layer] {12}
[end]

and conky windows will remain visible when ShowDesktop is invoked. For conky, this can be refined further by using the:

Code: [Select]
own_window_class <some class name>
own_window_title <some title name>

in the conkyrc to give each conky a unique class and name. The ~/.fluxbox/apps file can then be configured for individual conky windows.


I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

Snap

  • Posts: 475
    • View Profile
Re: Using FLUXBOX as a Window Manager
« Reply #66 on: July 06, 2015, 07:38:52 AM »
Thanks these tips, PackRat.

PackRat

  • Posts: 1979
    • View Profile
Re: Using FLUXBOX as a Window Manager
« Reply #67 on: July 30, 2015, 12:52:30 AM »
Discovered fluxbox has key modes.

Key modes are a method to extend your keybindings. To check them out, I used the wiki example to set up move and resize modes -

Code: [Select]
# MoveMode
Mod4 w Mod4 m               :KeyMode MoveMode
MoveMode: None Up           :MoveUp 5
MoveMode: None Down         :MoveDown 5
MoveMode: None Left         :MoveLeft 5
MoveMode: None Right        :MoveRight 5
MoveMode: Shift Up          :MoveUp 10
MoveMode: Shift Down        :MoveDown 10
MoveMode: Shift Left        :MoveLeft 10
MoveMode: Shift Right       :MoveRight 10

# ResizeMode
Mod4 w Mod4 r               :KeyMode ResizeMode
ResizeMode: None Up         :ResizeVertical -5
ResizeMode: None Down       :ResizeVertical 5
ResizeMode: None Left       :ResizeHorizontal -5
ResizeMode: None Right      :ResizeHorizontal 5
ResizeMode: Shift Up        :MacroCmd {ResizeTo 50% 50%} {MoveTo 0 0 UpperLeft}
ResizeMode: Shift Down      :MacroCmd {ResizeTo 50% 50%} {MoveTo 0 0 UpperRight}
ResizeMode: Shift Left      :MacroCmd {ResizeTo 50% 50%} {MoveTo 0 0 LowerLeft}
ResizeMode: Shift Right     :MacroCmd {ResizeTo 50% 50%} {MoveTo 0 0 LowerRight}

Very handy. Have to remember to ESC (default key) to exit the mode.

scrot or it didn't happen -



i3 has this feature, and I think pekwm. Not sure of any others.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

Snap

  • Posts: 475
    • View Profile
Re: Using FLUXBOX as a Window Manager
« Reply #68 on: July 30, 2015, 10:18:34 AM »
Huh, got this wiki page in my FB documentation folder some time ago, but never went through it... Thanks for the reminder. Time to learn a bit more.

BTW, Do you ever sleep?  :P

PackRat

  • Posts: 1979
    • View Profile
Re: Using FLUXBOX as a Window Manager
« Reply #69 on: July 30, 2015, 10:28:22 AM »
I have 2 kids and a year old dog. So no.  :D
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

Snap

  • Posts: 475
    • View Profile
Re: Using FLUXBOX as a Window Manager
« Reply #70 on: July 30, 2015, 10:42:54 AM »
Aaaah... truly a non ideal environment for peaceful sleeping. Please, forward my compliments to your kids and hyperactive dog for keeping you awake and restless in our benefit.  :D

hudson

  • Posts: 35
    • View Profile
Re: Using FLUXBOX as a Window Manager
« Reply #71 on: July 30, 2015, 08:28:39 PM »
Hello, at the request of PackRat, I'm posting how to use bbpager with Flux:

install bbpager and wmctrl and put the following two lines in the startup file before exec fluxbox:

(sleep 1s && bbpager) &
(sleep 2s && wmctrl -r bbpager -b add,below) &

screenshot (upper left hand corner) http://vsido.org/index.php?topic=1014.msg11748#msg11748
colors are a little dim in the screenshot, but it works very nicely

PackRat

  • Posts: 1979
    • View Profile
Re: Using FLUXBOX as a Window Manager
« Reply #72 on: August 25, 2016, 02:22:20 AM »
Couple shots of fluxbox -



One thing fluxbox is missing out of the box is a pager - fbpager and obpager are still in the repos, but no longer developed, and have some limits aesthetically. Since Vsido uses tint2 by default, it's easy enough to configure tint2 to display multiple desktops and get pager functionality that way. But, if you don't want to run a 3rd party application, limited pager capability can be quickly set up by configuring the fluxbox Iconbar.

By default, the Iconbar is enabled and set to show all the windows on the active workspace. A quick look at the configuration options in the menu (screenshot) shows there are several other options available. Note that Icons refers to iconified windows, not the mini icon associated with an application. If you do not want to display the mini icons with the window in the iconbar, clear the "show pictures" option.

None - don't display the iconbar
Icons - only iconified windows, all workspaces
NoIcons - only open windows, all workspaces
WorkspaceIcons - iconified windows on active workspace
WorkspaceNoIcons - open windows on active workspace
Workspace - Open and iconified windows on active workspace
All Windows - Open and Iconified windows, all workspaces

Workspace is the default.

Changing to All Windows will display all the open and iconified windows on all desktops (file manager and gimp are open on Workspace 2 in the screenshot) and clicking on the application in the iconbar has two potential outcomes:  If the window is open, you will switch to the workspace and the application window will be raised and focused. If the application window is iconified, it will be moved to the current workspace, raised and capture focus.

Unfortunately, unlike tint2 pager mode, only the current workspace is numbered on the fluxbox toolbar, so visually the user cannot tell which workspace the window actually occupies.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

PackRat

  • Posts: 1979
    • View Profile
Re: Using FLUXBOX as a Window Manager
« Reply #73 on: September 10, 2017, 12:38:14 AM »
Update to the faux tiling, ToggleDecor key bindings -



key bindings/chains to add to $HOME/.fluxbox/fluxbox-keys
Code: [Select]
! this will tile tint2  panel
!Mod1 Shift m :ArrangeWindowsHorizontal
!Mod1 Shift n :ArrangeWindowsVertical

Ctrl a Mod4 h :MacroCmd {ResizeTo 48% 98%} {MoveTo 1% 1% UpperLeft}
Ctrl a Mod4 j :MacroCmd {ResizeTo 48% 98%} {MoveTo 1% 1% UpperRight}
Ctrl a Mod4 k :MacroCmd {ResizeTo 98% 48%} {MoveTo 1% 1% UpperLeft}
Ctrl a Mod4 l :MacroCmd {ResizeTo 98% 48%} {MoveTo 1% 1% LowerLeft}

Ctrl a Mod4 v :MacroCmd {SetDecor BORDER} {ResizeTo 48% 98%} {MoveTo 1% 1% UpperLeft}
Ctrl a Mod4 b :MacroCmd {SetDecor BORDER} {ResizeTo 48% 98%} {MoveTo 1% 1% UpperRight}
Ctrl a Mod4 n :MacroCmd {SetDecor BORDER} {ResizeTo 98% 48%} {MoveTo 1% 1% UpperLeft}
Ctrl a Mod4 m :MacroCmd {SetDecor BORDER} {ResizeTo 98% 48%} {MoveTo 1% 1% LowerLeft}

Ctrl a Mod1 h :MacroCmd {ResizeTo 48% 48%} {MoveTo 1% 1% UpperLeft}
Ctrl a Mod1 j :MacroCmd {ResizeTo 48% 48%} {MoveTo 1% 1% UpperRight}
Ctrl a Mod1 k :MacroCmd {ResizeTo 48% 48%} {MoveTo 1% 1% LowerLeft}
Ctrl a Mod1 l :MacroCmd {ResizeTo 48% 48%} {MoveTo 1% 1% LowerRight}

Ctrl a Mod1 v :MacroCmd {SetDecor BORDER} {ResizeTo 48% 48%} {MoveTo 1% 1% UpperLeft}
Ctrl a Mod1 b :MacroCmd {SetDecor BORDER} {ResizeTo 48% 48%} {MoveTo 1% 1% UpperRight}
Ctrl a Mod1 n :MacroCmd {SetDecor BORDER} {ResizeTo 48% 48%} {MoveTo 1% 1% LowerLeft}
Ctrl a Mod1 m :MacroCmd {SetDecor BORDER} {ResizeTo 48% 48%} {MoveTo 1% 1% LowerRight}

Ctrl a Mod4 c :MacroCmd {SetDecor 0x66f} {ResizeTo 85% 95%} {MoveTo 0 0 Center}
Ctrl a Mod4 x :MacroCmd {SetDecor BORDER} {ResizeTo 85% 95%} {MoveTo 0 0 Center}

# Ctrl a Mod4 d :ToggleDecor
Mod1 Shift F12 :MacroCmd {SetDecor TAB}

Mod1 Shift d :ToggleCmd {ShowDesktop} {DeIconify all originquiet}
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

PackRat

  • Posts: 1979
    • View Profile
Re: Using FLUXBOX as a Window Manager
« Reply #74 on: October 16, 2017, 02:56:59 AM »
never ending modifications - added some chains to undecorate and tile:

Code: [Select]
# manual tiling with key chains - using chains to avoid clash with keybindings #

! this will tile tint2  panel
!Mod1 Shift m :ArrangeWindowsHorizontal
!Mod1 Shift n :ArrangeWindowsVertical

Ctrl a Mod4 h :MacroCmd {ResizeTo 48% 98%} {MoveTo 1% 1% UpperLeft}
Ctrl a Mod4 j :MacroCmd {ResizeTo 48% 98%} {MoveTo 1% 1% UpperRight}
Ctrl a Mod4 k :MacroCmd {ResizeTo 98% 48%} {MoveTo 1% 1% UpperLeft}
Ctrl a Mod4 l :MacroCmd {ResizeTo 98% 48%} {MoveTo 1% 1% LowerLeft}

Ctrl a Mod4 v :MacroCmd {SetDecor BORDER} {ResizeTo 48% 98%} {MoveTo 1% 1% UpperLeft}
Ctrl a Mod4 b :MacroCmd {SetDecor BORDER} {ResizeTo 48% 98%} {MoveTo 1% 1% UpperRight}
Ctrl a Mod4 n :MacroCmd {SetDecor BORDER} {ResizeTo 98% 48%} {MoveTo 1% 1% UpperLeft}
Ctrl a Mod4 m :MacroCmd {SetDecor BORDER} {ResizeTo 98% 48%} {MoveTo 1% 1% LowerLeft}

Ctrl a Mod1 h :MacroCmd {ResizeTo 48% 48%} {MoveTo 1% 1% UpperLeft}
Ctrl a Mod1 j :MacroCmd {ResizeTo 48% 48%} {MoveTo 1% 1% UpperRight}
Ctrl a Mod1 k :MacroCmd {ResizeTo 48% 48%} {MoveTo 1% 1% LowerLeft}
Ctrl a Mod1 l :MacroCmd {ResizeTo 48% 48%} {MoveTo 1% 1% LowerRight}

Ctrl a Mod1 v :MacroCmd {SetDecor BORDER} {ResizeTo 48% 48%} {MoveTo 1% 1% UpperLeft}
Ctrl a Mod1 b :MacroCmd {SetDecor BORDER} {ResizeTo 48% 48%} {MoveTo 1% 1% UpperRight}
Ctrl a Mod1 n :MacroCmd {SetDecor BORDER} {ResizeTo 48% 48%} {MoveTo 1% 1% LowerLeft}
Ctrl a Mod1 m :MacroCmd {SetDecor BORDER} {ResizeTo 48% 48%} {MoveTo 1% 1% LowerRight}

Ctrl a Mod4 c :MacroCmd {SetDecor 0x66f} {ResizeTo 85% 95%} {MoveTo 0 0 Center}
Ctrl a Mod4 x :MacroCmd {SetDecor BORDER} {ResizeTo 85% 95%} {MoveTo 0 0 Center}

# Ctrl a Mod4 d :ToggleDecor
Mod1 Shift F12 :MacroCmd {SetDecor TAB}

Mod1 Shift d :ToggleCmd {ShowDesktop} {DeIconify all originquiet}
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo