Skip to content

Instantly share code, notes, and snippets.

@bathtime
bathtime / youtube.cpp
Last active April 13, 2019 12:54
Launch Youtube from Primary/Clipboard Buffer
/*
Compile with:
gcc -O3 -Wall youtube.c -o youtube -lX11
*/
#include<X11/Xlib.h>
#include<unistd.h>
#include<stdio.h>
/*
g++ -Wall -O2 editfile.cpp -o editfile
*/
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/sendfile.h>
#include <sys/stat.h>
/*
Config file: /home/pi/.config/dunst/dunstrc
gcc -o notify `pkg-config --cflags --libs libnotify` notify.c
*/
#include <libnotify/notify.h>
int main(int argc, char **argv) {
/*
Key/Touch/Secondary Button Stimulator
Compile with:
gcc -Wall -O2 mouse.c -o mouse -lX11 -lXtst -lXext
SendKey function courtesy of:
https://bharathisubramanian.wordpress.com/2010/03/14/x11-fake-key-event-generation-using-xtest-ext/
@bathtime
bathtime / transmerge.sh
Last active June 22, 2024 02:26
A simple Linux shell script for translating an .srt file into another language and merging both languages into an .ass file
#!/bin/sh
#
# This program takes an .srt file, translates it, and merges both translations into a .ass file with the user's selected
# language on top of the screen and the other language at the bottom.
#
# Usage: ./transmerge.sh [source language] [target language] [language on top (en|fri|...)] [source .srt] [target .ass (optional)]
#
# ex., $ ./transmerge.sh en fr en movie.srt
#
@bathtime
bathtime / Movie .srt
Last active March 31, 2020 14:15
Temporary place for movie scripts to be translated
1
00:03:12,440 --> 00:03:14,769
Salut. J'ai rendez-vous avec M. Ullman.
2
00:03:14,980 --> 00:03:16,939
Mon nom est Jack Torrance.
3
00:03:17,110 --> 00:03:19,649
@bathtime
bathtime / srtssa.sh
Last active December 26, 2023 22:22
srtssa.sh
#!/bin/bash
usage() {
echo "Version 0.15.1, GNU GPLv3
*** WARNING: ALPHA VERSION CODE!!! THIS PROGRAM EATS HAMSTERS! ***
This program takes an .srt, .txt, .pdf, or .epub file, translates it, and merges both translations
into an .ssa or .txt file in a parallel manner, allowing both subtitles to be viewed at the same time.