Code Monkey home page Code Monkey logo

Comments (6)

subogero avatar subogero commented on July 17, 2024

My minimal wrapper looks like this, it just swaps -e for -x:

#!/bin/sh
while [ "$1" ]; do
  param=$1
  shift
  [ $param = '-e' ] && param='-x'
  args="$args $param"
done
exec mate-terminal $args

This sample script might handle parameters with special characters badly, and it should be integrated into the Debian
/etc/alternatives system as well.

from mate-terminal.

subogero avatar subogero commented on July 17, 2024

I've written the wrapper in C as, unlike a shell, it does not mess with the special characters in the arguments. I don't really know the mate build system, so I've just simply compiled and installed it in /usr/bin. It works nicely.

#include <unistd.h>
#include <string.h>
int main(int argc, char *argv[])
{
    int i;
    argv[0] = "/usr/bin/mate-terminal";
    for (i = 1; i < argc; ++i) {
        if (strncmp(argv[i], "-e", 3) == 0) {
            argv[i] = "-x";
        }
    }
    execv(argv[0], argv);
    return 1; /* if exec returns, it's an error, baby */ 
}

from mate-terminal.

stefano-k avatar stefano-k commented on July 17, 2024

There is an example here too:
http://ftp.de.debian.org/debian/pool/main/g/gnome-terminal/gnome-terminal_2.30.2-1.debian.tar.gz
see gnome-terminal.wrapper

from mate-terminal.

sbalneav avatar sbalneav commented on July 17, 2024

mate-terminal.wrapper added

from mate-terminal.

subogero avatar subogero commented on July 17, 2024

Thanks!

from mate-terminal.

glensc avatar glensc commented on July 17, 2024

Does this really have to be in Python?

and this wrapper is not needed on systems not using alternatives? what symlink actually points to this? can somebody show?

from mate-terminal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.