Skip to content

Farouk123456/GTKDock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GTKDock

GTKDock is a GTKmm4 based Dock that tries to be WM agnostic inspired by nwg-dock.

It is very much still in development. Right now it works best on hyprland but needs a little coding knowledge to add support for other window managers.

If WM is wayland it has to support gtk-layer-shell

Dependencies:

Compiletime: GLM GTKmm4 gtk-layer-shell

Runtime: Wayland: hyprctl (for hyprland)

Building and Installing:

Build with make: make clean && make -j $(nproc --ignore=2)

Installation: ln -s $(pwd)/GTKDock $HOME/.local/bin
Or (if ~/.config/GTKDock exists): mv ./GTKDock ~/.local/bin/

Usage:

GTKDock -d[monIdx] -e[edgeIdx] -a[alignmentIdx]

(Dock Edge Possible values: 0 = left 1 = top 2 = right 3 = bottom)
(Dock Alignment Possible values: 0 = center 1 = left 2 = top 3 = right 4 = bottom)

conf/pinnedApps stores the pinned Apps and their order in the Format

name:execCmd:iconPath:desptopFilePath

you can add reorder the lines to change the ordering of pinned Apps in the Dock futher configuration is available in conf/settings.conf

There are two ways of using GTKDock either leaving it in its Project Dir and linking to it
or moving config and imgs folders to ~/.config/GTKDock so one can use the executable anywhere

-d Controlls which monitor the dock gets created on and controlls (if isolated_to_monitor is 1)
-e Controlls which edge the dock sticks to and ianimates into (sildes in and out of)
-a Controlls the dock alignment on the display edge (ex. dock is on the bottom on the left or dock is on the left edge on the topside ...)

Example:

./GTKDock -d1 -e3 -a0

WM Support and Compatibility

GTKDock has been tested on Hyprland and GNOME on wayland

to add support to other WM's you'd need to

  1. add functionlity for function in wm-specific-impl.cpp
  2. extend list_windows.bash to work for your WM (if it doesn't)

WM specific File: list_windows.bash

Bash script that queries the wm for running applications
Returned format should be:

monitorIdx-:-specificWindowTitle-:-windowClass-:-isFullscreen (0 or 1)-:-PID

hyprland is implemented
each line is directly tied to an AppInstance in GTKDock

WM specific File: wm-specific.h

defines the wm-specific functions these function are then implemented in wm-specific-impl.cpp

void GLS_setup_top_layer(Gtk::Window * win, int dispIdx, int edgeMargin, const std::string& name, DockEdge edge)

Is run on wayland to make window appear in the TOP layer and be anchored to a display edge

void GLS_chngMargin(Gtk::Window * win, int newMargin, DockEdge edge)

Chganges the distance between the window edge and the display edge on wayland

void openInstance(AppInstance i)

makes WM get the instance i.e. focus on it / bring it back from minimized status ...

void closeInstance(std::vector<AppInstance> instances)

makes WM close the instance(window)

bool check_layer_shell_support()

checks if gtk-layer-shell protocol is supported

void populateInstanceMenuWithWMSpecific(Gtk::Box* popover_box, AppInstance inst)

adds buttons to the context menu of an instance that can do arbitrary functionality

for example toggle floating on hyprland

Cutomization

imgs/launcher.png is used for the launcher button and conf/style.css is used to style all the elements in the Dock.
conf/settings.conf controlls:

  1. icon size
  2. padding
  3. hotspot height i. e. region that activates the dock
  4. auto-hide timeout (time to wait before hiding dock) and animation duration
  5. to draw launcher btn or not
  6. margin from screen edge
  7. cmd to be executed when launcher btn is pressed
  8. if dock is isolated to the apps running in its monitor or whether it should show windows on all screens
  9. exclusive mode creates a zone where only the dock exists (this is a wayland only feature)
  10. hotfix_height and hotfix_width is a little fix for compatibility with other topbars / exclusive zone windows that may exist

You might want to use GTK_DEBUG=interactive to help with customization :)

About

A WM agnostic linux Dock

Resources

License

Stars

4 stars

Watchers

2 watching

Forks

Contributors

Languages