PULSE_LATENCY_MSEC=30 wine
# =1 works in some cases, doesn't on others
http://arunraghavan.net/2013/08/pulseaudio-4-0-and-skype/
PULSE_LATENCY_MSEC=30 wine
# =1 works in some cases, doesn't on others
http://arunraghavan.net/2013/08/pulseaudio-4-0-and-skype/
;; Define the core dir trappings and blacklisted directories here
(setq known-projects '((("gcc" "config" "libgcc" "libiberty") ("/testsuite/" "/test/" "/build/"))
(("mono" "mcs" "eglib" "docs" "tools") ())
(("DROD" "DRODLib" "DRODUtil") ())
(("arch" "drivers" "include" "kernel") ("/drivers/")) ; Linux
(("README" "INSTALL") ("/.pc/")) ; Generic software project #1 (e.g. emacs)
(("README") ("/.pc/")) ; Generic software project #2.
((".") ()) ; Oh well, let's at least index the current dir
)) ; if everything else fails.
(defun index-project () (interactive)
(defun dump-vars-to-file (varlist filename)
"simplistic dumping of variables in VARLIST to a file FILENAME"
(save-excursion
(let ((buf (find-file-noselect filename)))
(set-buffer buf)
(erase-buffer)
(loop for var in varlist do
(princ (concat var "\n") buf))
(save-buffer)
(kill-buffer))))
(defun lookup-project (projects)
(let ((lookup-failed t) (blacklist nil) (remaining-trappings nil) (lookup-path nil) (project nil))
(while (and (consp projects) lookup-failed)
(setq lookup-path buffer-file-name)
(setq project (pop projects))
; (message "Trying project %s" project)
(while (and (> (string-width lookup-path) 1) lookup-failed)
;; For some reason (file-exists-p "main.c/.") = t!
(when lookup-failed
(setq lookup-path (replace-regexp-in-string "/[^/]*$" "" lookup-path)))
; (message "Trying path %s" lookup-path)
(setq lookup-failed nil)
(setq remaining-trappings (nth 0 project))
(setq blacklist (nth 1 project))
(while (and (consp remaining-trappings) (not lookup-failed))
(if (not (file-exists-p (concat lookup-path "/" (pop remaining-trappings))))
(setq lookup-failed t)))))
(when lookup-failed (setq lookup-path nil) (setq blacklist nil))
(list lookup-path blacklist)))
(let ((project-info (lookup-project known-projects))
(project-root nil) (project-blacklist nil))
(setq project-root (nth 0 project-info))
(setq project-blacklist (nth 1 project-info))
(message "Project found at %s. Scanning files... (excliding %s)" project-root project-blacklist)
(when project-root
(defun is-path-blacklisted (path blacklist)
(while (and blacklist (not (string-match (car blacklist) path))) (pop blacklist))
(if blacklist t nil))
(defun build-cscope-database (root blacklist)
(setq dirs (list root)) ;; "/usr/include/")) ; I found it to add too much clutter, better add some individual files instead.
(setq files '())
(while dirs
(setq dir (pop dirs))
(setq ls (directory-files dir))
(while ls
(setq file (pop ls))
(setq file-path (concat dir "/" file))
(unless (is-path-blacklisted file-path blacklist)
(if (file-accessible-directory-p file-path)
(unless (or (string= file ".") (string= file "..")) (add-to-list 'dirs file-path))
(if (and (file-readable-p file-path) (string-match "\\.\\(c\\|cpp\\|h\\|hpp\\|vala\\|def\\)$" file-path))
(add-to-list 'files file-path))))))
;; Append some commonly used header files. Uncomment the "/usr/include" line above
;; and remove/comment this one if you want to see them all their multitude instead
;; of this selectivity.
(dolist (header '("stdio.h" "stdlib.h" "stdarg.h" "ctype.h" "string.h" "math.h" "dlfcn.h"
"sys/types.h" "sys/time.h" "unistd.h" "assert.h" "limits.h" "poll.h"
"libgen.h" "signal.h" "fcntl.h"
"bits/stdio2.h" "bits/string2.h"
"X11/Xos.h" "X11/Xlib.h" "X11/Xfuncproto.h" "X11/Xatom.h" "X11/Xproto.h"
"X11/extensions/Xrandr.h" "X11/extensions/shape.h" "X11/cursorfont.h"
"X11/extensions/XInput2.h" "X11/X.h"
"boost/bind.hpp" "boost/foreach.hpp"
"sys/wait.h" "sys/types.h" "sys/stat.h"
"glib-2.0/glib/gspawn.h" "glib-2.0/glib/gslice.h" "glib-2.0/glib/gmacros.h"
"glib-2.0/gobject/gobject.h" "glib-2.0/gobject/gtype.h"
))
(add-to-list 'files (concat "/usr/include/" header)))
files)
(dump-vars-to-file (build-cscope-database project-root project-blacklist)
(concat project-root "/" cscope-index-file))
(message "Processing...")
(cscope-set-initial-directory project-root)
(with-temp-buffer (shell-command (concat "cd " project-root "; cscope -b; ctags -eL " cscope-index-file) t)) ; with-temp-buffer is needed to hide output
(setq tags-file-name (concat project-root "/TAGS"))
(message "Done processing")))
)
(global-set-key (kbd "<f9>") 'index-project)
#!/bin/sh
locate -0i --regex "($*).*\.(mp3|mpe?g|avi|mkv|ogg|au|m4a|flac)$" | xargs -0 nohup vlc >/dev/null 2>&1 &
Examples:
$ lplay music/j-pop
# play your J-Pop collection
$ lplay '風|wind|kaze'
# play everything that has the word or kanji "wind" in it
$ lplay 'bob.*dylan'
# play all Bob Dylan's songs
locate -0i --regex "$*" | xargs -0 file -0 | grep -Eia 'audio|video' | cut -d '' -f1 | xargs -d\\n nohup vlc >/dev/null 2>&1 &
Open /usr/share/applications/steam.desktop and replace line:
Exec=/usr/bin/steam %U
with (for Steam installed from Valve package):
Exec=sh -c "STEAM_FRAME_FORCE_CLOSE=1 /usr/bin/steam %U"
or (for Steam installed from Ubuntu repo):
Exec=sh -c "STEAM_FRAME_FORCE_CLOSE=1 /usr/games/steam %U"
Or just launch it from console as:
$ STEAM_FRAME_FORCE_CLOSE=1 /usr/bin/steam
(solution based on a post from https://github.com/ValveSoftware/steam-for-linux/issues/1025)
avconv -f x11grab -r 30 -s hd1080 -i :0.0 -f pulse -name 'screencap -> system audio' -i alsa_output.pci-0000_00_1b.0.analog-stereo.monitor -map 0 -map 1 -codec:v libx264 -pre:v lossless_ultrafast -codec:a libmp3lame -threads auto -y captured.avi
does storing
default-sample-rate = 44100
alternate-sample-rate = 44100
avconv -i captured.avi -ss FROM_TIME -t LENGTH -vcodec libx264 -pre:v veryslow -acodec libmp3lame result.avi
avconv -f x11grab -s hd1080 -i :0.0 -f pulse -name 'screencap -> system audio' -i alsa_output.pci-0000_00_1b.0.analog-stereo.monitor -map 0 -map 1 -codec:v libx264 -pre:v ultrafast -codec:a libmp3lame -af asyncts -threads auto -y captured.mkv
#Japanese"ibus engine ..." is the console command that makes ibus switch the current layout. Using keycodes is necessary since the same physical keys may represent different characters in different locales.
# The new ibus version does not switch from Cyrillic to Japanese for some reason, so we have to switch to English first.
# Replace "anthy" with "mozc-jp" if you're using Mozc.
"ibus engine xkb:us::eng; ibus engine anthy"
m:0x40 + c:44
#English
"ibus engine xkb:us::eng"
m:0x40 + c:45
#Russian
"ibus engine xkb:ru::rus"
m:0x40 + c:46
#Ukrainian
"ibus engine xkb:ua::ukr"
m:0x40 + c:32
#French
"ibus engine xkb:fr::fra"
m:0x40 + c:47