Commit 6abe660b authored by Guilherme Becker Agge's avatar Guilherme Becker Agge

SCRUM#631: Create le-no-hot-corner

parent 30d0cd81
Pipeline #19045 passed with stages
in 4 minutes and 56 seconds
#!/bin/bash
# This script generates a .deb package
apt-get update && apt-get install -y devscripts
CHANGELOG="package/debian/changelog"
LINE=$(head -n 1 $CHANGELOG)
PACKAGE=$(echo "$LINE" | cut -d' ' -f1)
VERSION=$(echo "$LINE" | cut -d' ' -f2 | grep -o -E '[0-9]*\.[0-9]*\.[0-9]*')
tar --exclude=debian -czf "${PACKAGE}"_"${VERSION}".orig.tar.gz package/*
cd package || exit -1
debuild -us -uc --lintian-opts --profile debian
cd ../ || exit -1
mkdir build/
mv "${PACKAGE}"* build/
#!/bin/bash
# shellcheck disable=SC2029
# This script uploads an includes a .deb package in our debian repository.
# The distribution is chosen based on the gitlab-ci stage we are on.
apt-get update && apt-get install -y dput ssh
eval "$(ssh-agent -s)"
ssh-add <(echo "$PRIV_KEY")
echo "Deploy job name: $CI_JOB_NAME"
if [ "$CI_JOB_NAME" = "deploy_for_unstable" ]; then
dput -u -f --config=dput.cf repo build/*.changes
else
if [ "$CI_JOB_NAME" = "deploy_for_testing" ]; then
REPO_SRC="unstable"
REPO_TGT="testing"
elif [ "$CI_JOB_NAME" = "deploy_for_stable" ]; then
REPO_SRC="testing"
REPO_TGT="stable"
fi
CHANGELOG="package/debian/changelog"
LINE=$(head -n 1 $CHANGELOG)
PACKAGE=$(echo "$LINE" | cut -d' ' -f1)
VERSION=$(echo "$LINE" | cut -d' ' -f2 | grep -o -E '[0-9]*\.[0-9]*\.[0-9]*')
REPREPRO_CMD="reprepro -Vb /home/repository/www/le6 copysrc $REPO_TGT $REPO_SRC $PACKAGE $VERSION"
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null repository@repo.c3sl.ufpr.br "$REPREPRO_CMD"
fi
## Template para empacotamento utilizando o Gitlab-ci.
stages:
- lint
- build
- test
- deploy
linter_shell:
stage: lint
tags:
- debian-packaging
script:
- ./.linter_shell.sh
linter_javascript:
stage: lint
tags:
- ubuntu
- regular
script:
- apt-get update && apt-get install -y nodejs npm nodejs-legacy
- npm install -g jshint
- jshint package/
build:
stage: build
artifacts:
paths:
- build/
tags:
- ubuntu
- regular
script:
- apt-get update && apt-get install -y glib2.0 && apt-get install -y build-essential devscripts dh-make dh-systemd nodejs npm nodejs-legacy libdbus-1-dev
- npm install -g dbus
- cp -rf /usr/local/lib/node_modules/dbus package/nohotcorner@azuri.free.fr
- ./.build.sh
test:
stage: test
tags:
- ubuntu
- regular
script:
- apt-get update && apt-get install -y wget
- echo "deb http://repo.c3sl.ufpr.br/le6/ unstable main" > /etc/apt/sources.list.d/le6.list
- wget -O- http://repo.c3sl.ufpr.br/le6/le.c3sl.ufpr.br.key | apt-key add -
- echo "Installation test:"
- apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install $(pwd)/build/*.deb language-pack-gnome-pt language-pack-pt-base
- echo "Removal test:"
- pkg_name=$(head -n 1 package/debian/changelog | cut -d' ' -f1)
- DEBIAN_FRONTEND=noninteractive apt -y remove $pkg_name
dependencies:
- build
deploy_for_unstable:
stage: deploy
only:
- develop
tags:
- debian-packaging
script:
- ./.deploy.sh
dependencies:
- build
deploy_for_testing:
stage: deploy
only:
- /^rc-.*$/
tags:
- debian-packaging
script:
- ./.deploy.sh
dependencies:
- build
deploy_for_stable:
stage: deploy
when: manual
only:
- master
tags:
- debian-packaging
script:
- ./.deploy.sh
dependencies:
- build
{
"esversion": 6,
"laxbreak": true
}
#!/bin/bash
YELLOW='\033[0;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
sh_files=$(find -name "*.sh")
exe_files=$(grep -Erl "#\!/bin/(bash|sh)" --exclude=*.* package)
files="$sh_files\n$exe_files"
#find no files
if [[ "$files" == "\n" ]];then
echo -e "${YELLOW}No shell files found!${NC}"
exit 0
fi
echo -e "$files"| xargs shellcheck -s bash
if [[ $? -eq 0 ]];then
echo "AWESOME!No problems found."
exit 0
else
echo -e "Understand errors in: ${BLUE}https://github.com/koalaman/shellcheck/wiki${NC}"
exit 1
fi
[repo]
fqdn = repo.c3sl.ufpr.br
method = scp
login = repository
incoming = /home/repository/www/le6/incoming
allow_unsigned_uploads = 1
ssh_config_options = User=repository
StrictHostKeyChecking=no
post_upload_command = ssh -l repository -i ~/.ssh/id_rsa repo.c3sl.ufpr.br "reprepro -Vb /home/repository/www/le6 processincoming default"
no-hot-corner (1.0.0) unstable; urgency=medium
* Initial release (Closes: #631)
-- Guilherme Becker Agge <lesuporte@c3sl.ufpr.br> Tue, 11 Dec 2018 10:26:23 -0200
Source: no-hot-corner
Section: gnome
Priority: optional
Maintainer: C3SL <contato@c3sl.ufpr.br>
Uploaders: Guilherme Becker Agge <lesuporte@c3sl.ufpr.br>
Build-Depends: debhelper (>=9), autotools-dev, dh-systemd
Standards-Version: 3.9.7
Package: no-hot-corner
Architecture: all
Depends: ${misc:Depends}, ${shlibs:Depends}
Description: Disables the top left hot corners
GNOME extension that disables the top left hot corners ("overview").
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: no-hot-corner
Source: <url:https://github.com/HROMANO/nohotcorner/>
Files: *
Copyright: 2013 HROMANO <https://github.com/HROMANO>
License: GPL-2.0+
Files: debian/*
Copyright: 2018 Guilherme Becker Agge <lesuporte@c3sl.ufpr.br>
License: GPL-3.0+
License: GPL-3.0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
.
On Debian systems, the complete text of the GNU General
Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
.
The original license of the extension was GPL-2.0, but we use GPL-3.0+ for
our packaging. The author's email could not be found, so we provide his
GitHub repository instead. You can also try to contact him at the extension
homepage at GNOME's website:
(https://extensions.gnome.org/extension/118/no-topleft-hot-corner/).
nohotcorner@azuri.free.fr usr/share/gnome-shell/extensions/
etc/skel/.config/autostart/* /etc/skel/.config/autostart/
etc/skel/.config/autostart/* /etc/xdg/autostart/
usr/share/no-hot-corner/ usr/share
#!/bin/sh
# Copyright (C) 2018 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of our packaging of the no-hot-corner extension
#
# no-hot-corner is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
set -e
case "$1" in
configure)
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
exit 0
#DEBHELPER#
#!/bin/sh
# Copyright (C) 2018 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of our packaging of the no-hot-corner extension
#
# no-hot-corner is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
set -e
case "$1" in
remove|upgrade|deconfigure)
;;
failed-upgrade)
;;
*)
echo "prerm called with unknown argument \`$1'" >&2
exit 1
;;
esac
exit 0
#DEBHELPER#
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1
# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
%:
dh $@
# dh_make generated override targets
# This is example for Cmake (See https://bugs.debian.org/641051 )
#override_dh_auto_configure:
# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
[Desktop Entry]
Type=Application
Name=no-hot-corner
Exec=/bin/bash -c "/usr/share/no-hot-corner/nohotcorner.sh"
This diff is collapsed.
nohotcorner
===========
Gnome-shell extension disabling hotcorners
const Main = imports.ui.main;
const ExtensionUtils = imports.misc.extensionUtils;
const Config = imports.misc.config;
let _id;
function _disable_hot_corners() {
// Disables all hot corners
Main.layoutManager.hotCorners.forEach(function(hot_corner) {
if (!hot_corner) {
return;
}
hot_corner._toggleOverview = function() {};
hot_corner._pressureBarrier._trigger = function() {};
});
}
function init() {
}
function enable() {
_disable_hot_corners();
// Hot corners may be re-created afterwards (for example, If there's a monitor change).
// So we catch all changes.
_id = Main.layoutManager.connect('hot-corners-changed', _disable_hot_corners);
}
function disable() {
// Disconnects the callback and re-creates the hot corners
Main.layoutManager.disconnect(_id);
Main.layoutManager._updateHotCorners();
}
{
"_generated": "Generated by SweetTooth, do not edit",
"description": "This extension disables the top left hot corners. You can still click on Activities or press the dedicated key to reach the overview. Since 3.8, should work with other extensions modifying the Activities button. On versions prior to 3.8, may not disable other hotcorners in multiscreen configurations and won't work on fallback/flashback mode.",
"name": "No Topleft Hot Corner",
"shell-version": [
"3.30", "3.28", "3.26", "3.24", "3.22", "3.20", "3.18", "3.16", "3.14", "3.12", "3.10", "3.8"
],
"url": "https://github.com/HROMANO/nohotcorner/",
"uuid": "nohotcorner@azuri.free.fr",
"version": 18
}
#!/bin/bash
# Copyright (C) 2019 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of le-no-hot-corner
#
# le-no-hot-corner is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
# This script enables the extension 'nohotcorner@azuri.free.fr'
# (Assuming 'dash-to-dock@micxgx.gmail.com' is enabled)
ENABLEDEXT=$(gsettings get org.gnome.shell enabled-extensions)
if [[ $ENABLEDEXT == *"nohotcorner"* ]]; then
exit 0
else
# shellcheck disable=SC2140
ENABLEDEXT=${ENABLEDEXT//"'dash-to-dock@micxgx.gmail.com'"/"'dash-to-dock@micxgx.gmail.com', 'nohotcorner@azuri.free.fr'"}
gsettings set org.gnome.shell enabled-extensions "$ENABLEDEXT"
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment