Skip to content

Commit

Permalink
Merge pull request #23 from mkropat/regex-title-match
Browse files Browse the repository at this point in the history
=~ regex title comparing (w/ release changes)
  • Loading branch information
mkropat authored Mar 5, 2017
2 parents 2aae900 + 3a6faa9 commit 8229224
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.vagrant/
debian/copyright
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014 Michael Kropat
Copyright (c) 2017 Michael Kropat

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ PREFIX = /usr/local
BIN = $(DESTDIR)/$(PREFIX)/bin
MAN = $(DESTDIR)/$(PREFIX)/share/man

VERSION = 0.8
VERSION = 0.9
PACKAGE_DIR = jumpapp-$(VERSION)
PACKAGE_FILE = jumpapp_$(VERSION).tar.bz2
PACKAGE_ORIG_FILE = jumpapp_$(VERSION).orig.tar.bz2

AUTHOR = Michael Kropat <mail@michael.kropat.name>
DATE = Apr 11, 2016
DATE = Mar 4, 2017
FILES = t README.md LICENSE.txt Makefile jumpapp jumpappify-desktop-entry

.PHONY: all
Expand Down
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ EOF

Vagrant.configure(2) do |config|
config.vm.define 'ubuntu' do |ubuntu|
ubuntu.vm.box = 'ubuntu/trusty64'
ubuntu.vm.box = 'ubuntu/xenial64'
ubuntu.vm.provision 'shell', inline: provision_ubuntu
end

Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
jumpapp (0.9-1) xenial; urgency=low

* Make `-t` support regex matching

-- Michael Kropat <mail@michael.kropat.name> Sat, 04 Mar 2017 23:14:00 +0000

jumpapp (0.8-1) trusty; urgency=low

* Jump to last-focused window when switching applications
Expand Down
2 changes: 1 addition & 1 deletion jumpapp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ where_workspace_matches() {

where_title_matches() {
while read -r windowid hostname pid workspace class title; do
if [[ "$matching_title" == '' || "$title" =~ "$matching_title" ]]; then
if [[ "$matching_title" == '' || "$title" =~ $matching_title ]]; then
printf '%s\n' "$windowid $hostname $pid $workspace $class $title"
fi
done
Expand Down
5 changes: 4 additions & 1 deletion jumpapp.spec
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@ mkdir -p %{buildroot}%{_unitdir}
%{_mandir}/man1/*

%changelog
* Sat Mar 4 2017 Michael Kropat <mail@michael.kropat.name> - 0.9-1
- Make `-t` support regex matching

* Tue Apr 12 2016 Michael Kropat <mail@michael.kropat.name> - 0.8-1
- Jump to last-focused window when switching applications
- Add `-t` title-matching option
- Add `-w` workspace-matching option

* Thu Mar 28 2014 Michael Kropat <mail@michael.kropat.name> - 0.2-1
* Fri Mar 28 2014 Michael Kropat <mail@michael.kropat.name> - 0.2-1
- Window Cycling feature

* Thu Mar 27 2014 Michael Kropat <mail@michael.kropat.name> - 0.1-1
Expand Down
6 changes: 3 additions & 3 deletions t/test_jumpapp
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,12 @@ it_calls_activate_window_with_first_windowid_when_second_is_active_and_r_flag_is
assertEquals 456 "$activate_window_arg"
}

it_calls_activate_window_with_windowid_that_matches_title_passed_with_-t() {
list_windows_output='456 somehost 123 -1 someapp some window lowercase
it_calls_activate_window_with_windowid_that_matches_regex_title_passed_with_-t() {
list_windows_output='456 somehost 123 -1 someapp not the window
567 somehost 123 -1 someapp Some window and text
678 somehost 123 -1 someapp'

main -t "Some window" someapp
main -t "[Ss]ome window" someapp

assertNotNull 'activate_window() called' "$activate_window_called"
assertEquals 567 "$activate_window_arg"
Expand Down

0 comments on commit 8229224

Please sign in to comment.