Skip to content

mrclksr/DSBMC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DSBMC - Graphical Client for DSBMD

About

DSBMC is a Qt5 client which allows accessing the functions the mounting daemon DSBMD provides, like mounting/unmounting media and disk images, and setting the reading speed of CD/DVD drives.

Main window

Installation

Building from Source

Getting the Source Code

% git clone https://github.com/mrclksr/DSBMC.git

Building and Installing from Source (Qt5)

# cd DSBMC
# cmake -S . -B build
# cmake --build build
# cmake --build build -t install

Building and Installing from Source (Qt6)

# cd DSBMC
# cmake -D USE_QT6=ON -S . -B build
# cmake --build build
# cmake --build build -t install

Installing via pkg(8)

# pkg install dsbmc

Installing from the FreeBSD Ports

# cd /usr/ports/sysutils/dsbmc
# make install distclean

Installation and Quick Setup of the Mouting Daemon (DSBMD)

Install DSBMD via pkg(8)

# pkg install dsbmd

or via the FreeBSD Ports

# cd /usr/ports/sysutils/dsbmd
# make install distclean

Enable vfs.usermount

# sysctl vfs.usermount=1

and make it permanent by adding the line vfs.usermount=1 to /etc/sysctl.conf:

# echo 'vfs.usermount=1' >> /etc/sysctl.conf

This allows DSBMD to mount media as regular user, and it allows you to unmount devices you mounted without having special privileges. That is, you can unmount media using your filemanager.

Finally, enable DSBMD in /etc/rc.conf, and start it

# sysrc dsbmd_enable=YES
# service dsbmd start

Usage

The Main Window

Each device which can be mounted by DSBMD is represented by an icon matching the device type (CD/DVD, HDD, USB disk, MMC SD card, PTP (camera), MTP), and a label. If possible, the volume label of the device is used. Otherwise, the name of the device node (e.g. da0p1) is used. Mounted devices are represented by a folder icon.

The status bar at the bottom of the main window shows the device node name, the capacity, and the number of free bytes of the selected device. The number of free bytes is 0 if the device is a CD/DVD or if it’s not mounted. Depending on the size, the unit is GB, MB, or KB.

Main window

The Tray Icon

The visibility of the main window can be toggled by pressing DSBMC's tray icon. Pressing the window’s close button will minimize it to tray. Every time a new device is added to the system, the main window and a balloon message pops up. You can control this behavior under FilePreferencesGeneral settingsBehavior. The theme used for the tray icon can be changed under FilePreferencesTray Icon Theme.

Mounting and Unmounting Devices, Playing Media, etc.

Each device icon provides a context menu which offers the possible actions of a device, like Mount, Unmount, Play, etc. Except for audio CDs, all device icons can be double-clicked to mount the device and open its mount point in a filemanager. The commands for opening mount points (filemanager) and playing media can be defined under FilePreferencesCommands.

Mounting Disk Image Files

The mounting daemon (DSBMD) accesses disk image files through the memory disk interface (md(4)). You can open an image file via filemanager, by letting it open the file with DSBMC, or you can use the command line:

% dsbmc /path/to/image/file.img

One or more md devices will appear in the main window, which you can mount like any other device.

Ejecting Media and Devices

Depending on the type of device, the Eject action behaves differently:

CD/DVD

If mounted, the CD/DVD is first umounted, and then the CD/DVD tray is ejected.

USB Mass Storage Devices

If mounted, the device is first unmounted, and then detached from the CAM subsystem. This flushed all the device’s caches and makes sure pending data gets written. Finally, the device node will be removed.

💡

Eject your Kindle if you want to use it while charging on your computer.

Disk Images

If mounted, the memory disk (md) is first unmounted, and then detached from its backing store (image file). Finally, the device node will be removed.

Automounting Devices

If you want devices to be automatically mounted when they are inserted, you can enable automount under FilePreferencesBehavior.

General Settings

Ignoring Devices or Mount Points

If you don’t want certain devices, partitions, or mount points to appear in the main window, like EFI partitions, you can add the device’s node path (e.g. /dev/da0s1) to the comma separated Ignore Devices list under FilePreferencesIgnore Devices. It is also possible to use the device’s volume Label (e.g. EFISYS).

Autoplaying Media

If you want CD/DVDs to be played automatically when inserted, you can enable Autoplay for each media type separately under FilePreferenceCommands.

Command Settings

Command-Line

Usage

dsbmc [-hi] [<disk image> …​]

Options

-i

Start DSBMC as tray icon without showing the main window.

-h

Help message.

If a disk image is given, a md(4) device is created from it.

Development

Contributing Translations

Available Translations

  • German

Instructions

Let’s say you want to add French translations, you can proceed as follows:

  1. Create a fork of this repo, and clone it:

    % git clone url-of-your-fork
  2. Install devel/qt5-linguist

  3. cd to your-forked-dsbmc-dir

  4. Add locale/dsbmc_fr.ts to the TS_FILES list in CMakeLists.txt.

  5. In order to create the dsbmc_fr.ts file, run

    Qt5
    % cmake -S . -B build
    % cmake --build build

    or

    Qt6
    % cmake -D USE_QT6=ON -S . -B build
    % cmake --build build -t dsbmc_lupdate
  6. Run linguist locale/dsbmc_fr.ts

  7. Add the file to the repo: git add locale/dsbmc_fr.ts

  8. Commit: git commit -am 'Add French translations.'

  9. Send a pull request.

Configuring the Look and Behavior of Qt5 Applications

If you are not using a desktop environment like KDE or GNOME, there are two ways to control the appearance of Qt5 applications:

qt5ct and the Kvantum Theme Engine

qt5ct

qt5ct is a tool that allows you to configure themes, fonts, and icons of Qt5 applications. It can be installed via pkg

# pkg install qt5ct

or via the FreeBSD ports:

# cd /usr/ports/misc/qt5ct
# make install

In order to make Qt5 applications use qt5ct, add the line export QT_QPA_PLATFORMTHEME=qt5ct to one of the following files, depending on how you start your X session:

Table 1. Session Files
X Session Start Method File

SliM, startx, xinit

~/.xinitrc

GDM, LightDM, LXDM, SDDM

~/.xprofile

WDM, XDM

~/.xsession

Alternatively, you can add the line to your window manager’s startup script, or, if you are using a Bourne shell compatible login shell, to your ~/.profile.

After loggin out and in again, proceed with the next section.

Kvantum

Kvantum is a SVG-based theme engine for Qt, KDE and LXQt. Install it via pkg:

# pkg install Kvantum-qt5

or via the FreeBSD ports:

# cd /usr/ports/x11-themes/Kvantum
# make install distclean

Start qt5ct and choose kvantum under AppeareanceStyle, and press Ok.

💡

You can use Kvantum directly without qt5ct by setting QT_STYLE_OVERRIDE=kvantum. Note, however, that the Kvantum Manager lacks the ability to change fonts and the icon theme.

Now you can start kvantummanager to set, install and configure themes.

💡

You can download Kvantum themes from KDE Store. Unpack them, and use the Kvantum Manager to install new themes.

Qt5-style-plugins

Qt5-style-plugins is a theme engine which allows using GTK-2 themes with Qt5 applications. Install it via pkg

# pkg install qt5-style-plugins

or via the FreeBSD ports

# cd /usr/ports/x11-themes/qt5-style-plugins
# make install distclean

In order to make Qt5 applications use qt5-style-plugins, add the line export QT_QPA_PLATFORMTHEME=gtk2 to one of the following files, depending on how you start your X session:

Table 2. Session Files
X Session Start Method File

SliM, startx, xinit

~/.xinitrc

GDM, LightDM, LXDM, SDDM

~/.xprofile

WDM, XDM

~/.xsession

Alternatively, you can add the line to your window manager’s startup script, or, if you are using a Bourne shell compatible login shell, to your ~/.profile.

After loggin out and in again, your Qt5 applications should look like your GTK applications.

Troubleshooting