M
M
Meehalkoff2014-10-14 23:17:26
linux
Meehalkoff, 2014-10-14 23:17:26

How to set different icons for multiple running instances of the same application?

System: arch with openbox and tint2.
Situation following:
Several vncview are started. How to set its own icon for each instance, so as not to get confused later.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikolai Kostyurin, 2014-10-23
@JiLiZART

As one of the options, make symlinks to the binary, create several .desktop files in which you specify different symlinks and icons for them.

K
Konstantin Gromov, 2016-11-15
@s9203

The pg.any function is asynchronous and, as a result res[0].error = errors;, is executed before processing unique logins. To work correctly, you need to postpone the work with errors until all queries to the database are executed:

User.prototype.join = function (user, res) {
    var errors = [],
        unique = [];

    for (var i = 0; i < user.length; i++) {
        if (user[i].required && !user[i].value) {
            errors.push('Вы не ввели логин');
        }

        if (user[i].unique) {
            var query = pg.any('SELECT id FROM users WHERE login=$1', [user[i].value]).then(function (user) {
                if (user.length) {
                    errors.push('Пользователь с таким логином уже зарегистрирован');
                }
            });

            unique.push(query);
        }
    }

    return Promise.all(unique).then(function () {
        res[0].error = errors;
    });
};

And the returns to the routes need to be wrapped in then:
// неправильно

join(user, res);
// дальнейшая обработка res



// правильно

join(user, res).then(function () {
    // дальнейшая обработка res
});

The design (function (i) { ... })(i);in the original version is meaningless, so I removed it. And if (user[i].unique == true) {identical if (user[i].unique) {.
Due to the fact that I do not see the full code, there may be errors.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question