Questions tagged [hook]
34 questions
138
votes
6 answers
Does bash have a hook that is run before executing a command?
In bash, can I arrange for a function to be executed just before running a command?
There is $PROMPT_COMMAND, which is executed before showing a prompt, i.e., just after running a command.
Bash's $PROMPT_COMMAND is analogous to zsh's precmd…
Gilles 'SO- stop being evil'
- 69,786
- 21
- 137
- 178
65
votes
4 answers
How to launch a command on network connection/disconnection?
I have a wifi connection that requires to authenticate using a web form once the wireless link is established.
I know how to automate the authentication with a script that uses curl/curlIE.
But how can I ask Windows to call my script every time I…
dolmen
- 1,232
- 1
- 11
- 16
8
votes
3 answers
How to commit files modified by pre-commit hook in Git
Im struggling for a couple of hours to make git store metadata (permissions/flags/etc) of the files using metastore and I use hooks/pre-commit for this.
The script is invoked correctly, and the file "metadata" is modified but not added into commit.…
dimovnike
- 417
- 2
- 5
- 11
7
votes
2 answers
How to trick programs into thinking they're running under 32-bit?
Basically I have 3 executables in my Windows 7 64-bit, those are:
Loader.exe -> This is a 32-bit exe
x86.exe -> This is a 32-bit exe
x64.exe -> This is a 64-bit exe
When Loader.exe starts it determines if the system is 32-bit or 64-bit and loads…
Æless Norm
- 151
- 1
- 1
- 5
6
votes
1 answer
ZSH: change prompt just before command is run
I would like to have a two-line prompt in zsh, but collapse it to a very small one just after pressing ENTER, so that it doesn't show up in the terminal scroll history. After typing two commands, the terminal should look like this while typing the…
Suzanne Soy
- 501
- 1
- 5
- 21
4
votes
2 answers
Global git hook
Is it possible to hook all ways of creating git repo? So I can run script when repo is cloned, initialized… (are there any other ways, except moving/copying folder?).
My intention is to track all repos, so I don't need to go through all dirs to run…
tig
- 4,624
- 4
- 34
- 49
2
votes
1 answer
When I run a git hook in a repo on a network share: which binaries are used?
See title. My repo is located on a network share. When I push new revs there, a post-udpate hook is run. The hook needs Perl and runs nicely.
But which perl.exe is used here? The one on my machine? Or is Perl accidently installed on the remote…
eckes
- 508
- 5
- 8
- 19
2
votes
2 answers
Monitor programs accessing my keyboard?
As of a few days ago, my computer is behaving 'erratically'.
When I am typing, my pointer will randomly move to another place in the text and start typing a semi-random string of characters.
("gvyfn" is common; It has typed this about 8 times whilst…
Anti Earth
- 161
- 1
- 9
2
votes
1 answer
How to properly copy/paste code from .pdf to a new file open on terminal?
I have a pdf containing the following code:
#!/bin/sh
echo
echo “**** Pulling changes into Dev [Hub’s post-update hook]”
echo
case “ $1 ” in
If I copy and then paste that code on my terminal, after doing pico myhookname I get…
MEM
- 1,297
- 5
- 17
- 29
2
votes
2 answers
How can I find which file system hooks are installed on a windows XP pro machine?
I've a suspect that a program I installed (spideroak) didn't completely removed itself on uninstall. How can I check if there are still file system hooks installed?
EDIT:
Probably spideroak wasn't the problem. For some reasons git-cheetah shell…
6502
- 145
- 1
- 2
- 12
2
votes
3 answers
Compiz shutdown hook?
I want to check 10+ local Git repositories if they have any unpushed commit, before shutdown.
(I always forgot to push them, so later, the next morning I came office and back home again)
I think maybe the shutdown process can check some conditions…
Lenik
- 17,942
- 25
- 87
- 119
2
votes
1 answer
Can the OS X unlock panel trigger a login hook similar to loginwindow?
I'd like to automatically run a shell script every time I authenticate onto my computer. However, all the info I can find about loginhook and Global LoginItems applies only when authenticating to "loginwindow," and not to the "unlock panel."
The…
Allen
- 41
- 2
2
votes
0 answers
Is it possible to disable part area of the touchscreen in Windows 10?
There is a laptop with screen touch function, but keeps ghost-touching as long as it is powered on.
I have tried many solutions like touching my hand on a window that is connected to the ground, adding a capacitor between VCC and GND, etc. But every…
NeNe
- 21
- 3
2
votes
2 answers
How to run commands when mac is idle and when it resumes
I want to run script when my mac is idle (for example after 5 minutes or screen saver start time is also ok) and when I resume it from idle state.
I know that I can write daemon using NSDistributedNotificationCenter and com.apple.screenIsLocked and…
tig
- 4,624
- 4
- 34
- 49
2
votes
0 answers
Ubuntu LVM on LUKS UEFI
I want to install Ubuntu on LVM on LUKS in UEFI mode. An UEFI partition, another encrypted partition for /boot and again an encrypted partition for system.
My question is:
How can I add hooks to initramfs?
It's so easy on Arch Linux by editing…
user974947
- 21
- 1