get feed

/home/ap0calypse

21 is only half the truth ...

:: Getting started with Bluetooth on ArchLinux

It's been a while since my last posting, but I felt the need to publish some information about a really odd issue I experienced earlier this day

It all started, because my girlfriend asked me how to access her mobile phone via Bluetooth under ArchLinux (or ArchBang, which is basically the same thing). After some searching, trying and hitting my head on the desk and keyboard, I figured a way out.

At first, you have to install at least this packages:

* bluez
* gvfs-obexftp
* obexftp
* openobex
* obexfs

After installing that (via pacman), we make sure, that the bluetooth services are started and enabled at boot.

$ sudo systemctl enable bluetooth
$ sudo systemctl start bluetooth

So far, so good. Now we search for the MAC-adress of our phone (or other BT device). I used hcitool for this. (make sure your phone is visible)

$ hcitool scan
Scanning ...
    D4:20:6D:AF:95:B7   HTC Wildfire S A510e

hci0 is my local device for bluetooth communication. You can see which is yours with:

$ hcitool dev
Devices:
    hci0    00:1E:4C:FF:7E:EA

Now we have the adress. To pair with the device, we use bluez-simple-agent.

$ sudo bluez-simple-agent hci0 D4:20:6D:AF:95:B7

After that, we are paired. Great, but what now? At first I thought a graphical UI would be nice for file transfer, but then I thought it would be even nicer, if I just could mount it like any other device. Gladly, it works! With obexfs:

$ cd ~
$ mkdir bluetooth
$ obexfs -b D4:20:6D:AF:95:B7 bluetooth/

TADAAAA! Be sure that you have privileges to read/write the bluetooth/ directory. To umount this device again, just type:

$ fusermount -u ~/bluetooth

I hope that this helps some people. Information about bluetooth is very bad these days. But I'm not a big fan of bluetooth anyway ;). Have FUN!

posted by ap0calypse in linux on 2013-04-26 13:17

:: Cycle through your tags in dwm

Long time since my last posting. But today I found a nice patch which helps me to use my dwm desktop even better.

In most window managers I know, you can use the Mod1-Arrow-key way to switch between your tags (or workspaces if you like that better). This behaviour is not the case in dwm. But with some modifications in your config.h, you can achieve it easily. I found this tweaks on the github page of a guy called N0NamedGuy.

First include this function prototypes:

/* function prototypes */
static void x_nexttag(const Arg *arg);
static void x_prevtag(const Arg *arg);
static void x_adjtag(int n);

After that you have to adjust your key settings here:

 { MODKEY,                       XK_Left,   x_prevtag,       {0} },
 { MODKEY,                       XK_Right,  x_nexttag,       {0} },

Last but not least, the most important part, you have to insert this functions:

static void x_prevtag(const Arg *arg) {
    (void)arg;
    x_adjtag(-1);    
}

static void x_nexttag(const Arg *arg) {
    (void)arg;
    x_adjtag(+1);    
}

static void x_adjtag(int n) {
    {
        int i, curtags;
        int seltag = 0;
        Arg arg;

        /*
         *     * Check first tag currently selected.  If there are
         *         * several tags selected we only pick first one.
         *             */
        if (selmon != NULL) {
            curtags = (selmon->tagset[selmon->seltags] & TAGMASK);
        } else {
            return;
        }
        for (i = 0; i < LENGTH(tags); i++) {
            if ((curtags & (1 << i)) != 0) {
                seltag = i;
                break;
            }
        }

        /*
         *      * Calculate next selected tag wrapping around
         *           * when tag overflows.
         *                */
        seltag = (seltag + n) % (int)LENGTH(tags);
        if (seltag < 0)
            seltag += LENGTH(tags);

        arg.ui = (1 << seltag);
        view(&arg);
    }
}

I decided to make this stuff public, because I am sure some people would love that feature.

Have fun! :)

posted by ap0calypse in dwm, c, programming on 2012-08-17 13:17

:: some new features of bazinga

Some weeks went by now, and some people have started to use bazinga, what I really appreciate. And with some people switching to bazinga, there naturally follow some wishes and feature requests.

stekro, who switched to bazinga some days ago after using nanoblogger, had some good ideas I implemented. For example, he came up with the idea, that an INSERT_GPG feature would be nice. This feature now automatically exports a key from the email address given in the config. For an example of how this works, take a look at the "about me" page.

Another config feature is the new possibility to set a max value for the articles displayed on the main page. You can change the behaviour by setting the MAX_ARTICLES_MAIN configuration option to the desired value. For example:

MAX_ARTICLES_MAIN: "3"

Another feature is the possibility to put your FTP password inside your config in which case you don't have to enter it everytime you push to your remote FTP site. To accomplish this, put this in your bazinga.conf:

PUSH_PASSWD: "yoursecretpassword"

And in case your FTP server uses a different port than 21, I also added a new config entry:

PUSH_PORT: "21"

To download and use bazinga you can either visit the bazinga github page or you can upgrade to he latest version from the AUR. Just search for bazinga-git.

posted by ap0calypse in perl, bazinga on 2012-04-19 12:51