Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Signed-off-by: Ercan Ersoy <ercanersoy@ercanersoy.net>
  • Loading branch information
ercanersoy committed Apr 10, 2022
0 parents commit c9438ac
Show file tree
Hide file tree
Showing 18 changed files with 1,667 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
build/
dist/
Run.egg-info/

__pycache__/
*.py[cod]
*$py.class

*.glade~

*.po~
*.mo
3 changes: 3 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Copyright (c) 2021-2022 Ercan Ersoy

Run is licensed under GNU GPL v2 and GNU GPL v3.
339 changes: 339 additions & 0 deletions LICENSE-GPLv2

Large diffs are not rendered by default.

674 changes: 674 additions & 0 deletions LICENSE-GPLv3

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Run

A helper application for running program

Copyright (c) 2021-2022 Ercan Ersoy

Author: Ercan Ersoy

# Note

update-strings.sh script file written by Erdem Ersoy. Some changes applied to update-strings.sh script file by Ercan Ersoy.
53 changes: 53 additions & 0 deletions bin/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env python3

#
# run - Run main script
#
# Copyright (c) 2021-2022 Ercan Ersoy
#
# Author: Ercan Ersoy
#

###########
# Imports #
###########

from run import main_window

import locale
import os
import sys

import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Gio', '2.0')
from gi.repository import Gtk, Gio


#####################
# Application Class #
#####################

class Run(Gtk.Application):
def __init__(self, application_id, flags):
super().__init__(application_id=application_id, flags=flags)
self.connect("activate", self.open_main_window)

def open_main_window(self, app):
self.window = main_window.MainWindow(self)


#################
# Main Function #
#################

def main():
locale.setlocale(locale.LC_ALL, "")
locale.bindtextdomain('run', '/usr/share/locale')

app = Run("net.ercanersoy.run", Gio.ApplicationFlags.FLAGS_NONE)
return app.run()


if __name__ == '__main__':
sys.exit(main())
15 changes: 15 additions & 0 deletions data/net.ercanersoy.run.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Desktop Entry]
Version=0.1
Type=Application
Name=Run
Name[tr]=Çalıştır
GenericName=Run
GenericName[tr]=alıştır
Comment=A helper application for running program
Comment[tr]=Program çalıştırma için bir yardımcı uygulama
TryExec=run
Exec=run
Icon=gnome-run
Terminal=false
Categories=System;GTK;
StartupNotify=false
53 changes: 53 additions & 0 deletions locale/en/LC_MESSAGES/run.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#
# run.po - English translation file for Run
#
# Copyright (c) 2021-2022 Ercan Ersoy
#
# Author: Ercan Ersoy
#
msgid ""
msgstr ""
"Project-Id-Version: Run 0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-04-10 09:48+0300\n"
"PO-Revision-Date: 2022-04-10 10:05+0300\n"
"Last-Translator: Ercan Ersoy <ercanersoy@ercanersoy.net>\n"
"Language-Team: \n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.4.2\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: ui/main-window.glade:33
msgid "Run with terminal emulator"
msgstr "Run with terminal emulator"

#: ui/main-window.glade:48
msgid "Run with root privileges"
msgstr "Run with root privileges"

#: ui/main-window.glade:67
msgid "Run"
msgstr "Run"

#: ui/about-dialog.glade:11
msgid "Copyright (c) 2021-2022 Ercan Ersoy"
msgstr "Copyright (c) 2021-2022 Ercan Ersoy"

#: ui/about-dialog.glade:12
msgid "A helper application for running program"
msgstr "A helper application for running program"

#: ui/about-dialog.glade:14
msgid "Website"
msgstr "Website"

#: ui/about-dialog.glade:15
msgid "This software licensed under GNU GPLv2 and GNU GPLv3."
msgstr "This software licensed under GNU GPLv2 and GNU GPLv3."

#: ui/about-dialog.glade:18
msgid "Ercan Ersoy"
msgstr "Ercan Ersoy"
50 changes: 50 additions & 0 deletions locale/run.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the run package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: run 0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-04-10 10:05+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#: ui/main-window.glade:33
msgid "Run with terminal emulator"
msgstr ""

#: ui/main-window.glade:48
msgid "Run with root privileges"
msgstr ""

#: ui/main-window.glade:67
msgid "Run"
msgstr ""

#: ui/about-dialog.glade:11
msgid "Copyright (c) 2021-2022 Ercan Ersoy"
msgstr ""

#: ui/about-dialog.glade:12
msgid "A helper application for running program"
msgstr ""

#: ui/about-dialog.glade:14
msgid "Website"
msgstr ""

#: ui/about-dialog.glade:15
msgid "This software licensed under GNU GPLv2 and GNU GPLv3."
msgstr ""

#: ui/about-dialog.glade:18
msgid "Ercan Ersoy"
msgstr ""
53 changes: 53 additions & 0 deletions locale/tr/LC_MESSAGES/run.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#
# run.po - Turkish translation file for Run
#
# Copyright (c) 2021-2022 Ercan Ersoy
#
# Author: Ercan Ersoy
#
msgid ""
msgstr ""
"Project-Id-Version: Run 0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-04-10 09:48+0300\n"
"PO-Revision-Date: 2022-04-10 10:06+0300\n"
"Last-Translator: Ercan Ersoy <ercanersoy@ercanersoy.net>\n"
"Language-Team: \n"
"Language: tr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.4.2\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: ui/main-window.glade:33
msgid "Run with terminal emulator"
msgstr "Uçbirim emulatöründe çalıştır"

#: ui/main-window.glade:48
msgid "Run with root privileges"
msgstr "Yönetici haklarıyla çalıştır"

#: ui/main-window.glade:67
msgid "Run"
msgstr "Çalıştır"

#: ui/about-dialog.glade:11
msgid "Copyright (c) 2021-2022 Ercan Ersoy"
msgstr "Telif Hakkı (c) 2021-2022 Ercan Ersoy"

#: ui/about-dialog.glade:12
msgid "A helper application for running program"
msgstr "Program çalıştırma için yardımcı uygulama"

#: ui/about-dialog.glade:14
msgid "Website"
msgstr "Web Sitesi"

#: ui/about-dialog.glade:15
msgid "This software licensed under GNU GPLv2 and GNU GPLv3."
msgstr "Bu yazılım, GNU GPLv2 ve GNU GPLv3 altında lisanslanmıştır."

#: ui/about-dialog.glade:18
msgid "Ercan Ersoy"
msgstr "Ercan Ersoy"
9 changes: 9 additions & 0 deletions run/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env python3

#
# init.py - Run init script
#
# Copyright (c) 2021-2022 Ercan Ersoy
#
# Author: Ercan Ersoy
#
29 changes: 29 additions & 0 deletions run/about_dialog.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#
# about-dialog.py - Run about dialog script
#
# Copyright (c) 2021-2022 Ercan Ersoy
#
# Author: Ercan Ersoy
#

###########
# Imports #
###########

import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk


#####################
# Main Window Class #
#####################

class AboutDialog(Gtk.AboutDialog):
def __init__(self):
self.builder = Gtk.Builder().new_from_file('/usr/share/run/'
'ui/about-dialog.glade')

self.AboutDialog = self.builder.get_object('about-dialog')
self.AboutDialog.run()
self.AboutDialog.hide()
78 changes: 78 additions & 0 deletions run/main_window.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#
# main-window.py - Run main window script
#
# Copyright (c) 2021-2022 Ercan Ersoy
#
# Author: Ercan Ersoy
#

###########
# Imports #
###########

from run import about_dialog

import subprocess

import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk


#####################
# Main Window Class #
#####################

class MainWindow(object):
def __init__(self, app):
self.run_with_terminal_emulator = False
self.run_with_root_privileges = False

self.App = app

self.builder = Gtk.Builder().new_from_file('/usr/share/run/ui/'
'main-window.glade')
self.builder.connect_signals(self)

self.MainWindow = self.builder.get_object('main-window')
self.MainWindow.set_application(self.App)
self.MainWindow.show()

def onDestroy(self):
self.MainWindow.destroy()

def run_with_terminal_emulator_toggle(self, button):
run_with_terminal_emulator_checkbox = \
self.builder.get_object('run-with-terminal-'
'emulator-checkbox')
self.run_with_terminal_emulator = \
run_with_terminal_emulator_checkbox.get_active()

def run_with_root_privileges_toggle(self, button):
run_with_root_privileges_checkbox = \
self.builder.get_object('run-with-root-'
'privileges-checkbox')
self.run_with_root_privileges = \
run_with_root_privileges_checkbox.get_active()

def run(self, button):
command_entry = self.builder.get_object('command-entry')
command_line = command_entry.get_text().split(' ')

if len(command_line) != 0:
if self.run_with_root_privileges:
command_line.insert(0, 'pkexec')

if self.run_with_terminal_emulator:
command_line.insert(0, '-e')
command_line.insert(0, 'x-terminal-emulator')

subprocess.call(command_line)

self.onDestroy()

def information(self, button):
dialog = about_dialog.AboutDialog()

def exit_program(self, button):
self.onDestroy()
15 changes: 15 additions & 0 deletions run/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env python3

#
# version.py - Run version information script
#
# Copyright (c) 2021-2022 Ercan Ersoy
#
# Author: Ercan Ersoy
#

####################
# Version Variable #
####################

version = '0.1'
Loading

0 comments on commit c9438ac

Please sign in to comment.