Skip to content

Instantly share code, notes, and snippets.

View toshi75's full-sized avatar
💭
alive

toshi75

💭
alive
  • Japan
  • 17:52 (UTC +09:00)
View GitHub Profile
@toshi75
toshi75 / Bookmarklet: Get page title
Created March 11, 2020 16:32
Bookmarklet: Get page title
javascript:(function(){var title=document.title;var CC = document.createElement('textarea');CC.textContent = title;var BD = document.getElementsByTagName('body')[0];BD.appendChild(CC);CC.select();var cpEXE = document.execCommand('copy');BD.removeChild(CC);})();
@toshi75
toshi75 / bash prompt
Last active March 25, 2020 11:28
bash prompt
#== PS1 ==========================================
function _SHOW_DIR (){
if [[ "$(echo "$(pwd)" |grep -c \.Trash)" -ne 0 ]] ||
[[ "$(echo "$(pwd)" |grep -c \.local\/share\/Trash)" -ne 0 ]] ;then
local PREFIX="$(echo "$(pwd)" |sed -e "s|\/home\/$USER|\$HOME|g" \
-e 's|~|\$HOME|g' \
-e 's|\.Trash.*$||g' \
-e 's|\.local\/share\/Trash.*$||g')"
echo "$PREFIX\e[1;5m\e[1;33mTrash\e[m"
else
@toshi75
toshi75 / mpv_plugin-navigator.lua
Last active November 17, 2019 02:27
mpv_plugin-navigator.lua
-- Mpv Filenavigator
-- Author: donmaiq
-- Contributors: SteveJobzniak
-- URL: https://github.com/donmaiq/mpv-filenavigator
--
local settings = {
--fallback if no file is open, should be a string that points to a path in your system
defaultpath = os.getenv("HOME") or "/",
forcedefault = false, --force navigation to start from defaultpath instead of currently playing file
--favorites in format { 'Path to directory, notice trailing /' }
@toshi75
toshi75 / mpv-input.conf
Last active December 1, 2019 02:18
mpv conf files
# mpv keybindings
#
# Location of user-defined bindings: ~/.config/mpv/input.conf
#
# Lines starting with # are comments. Use SHARP to assign the # key.
# Copy this file and uncomment and edit the bindings you want to change.
#
# List of commands and further details: DOCS/man/input.rst
# List of special keys: --input-keylist
# Keybindings testing mode: mpv --input-test --force-window --idle
@toshi75
toshi75 / fish_prompt.fish
Last active March 9, 2020 04:03
prompt for fish shell
function fish_prompt --description 'Write out the prompt'
# Line 1
echo ''
# Line 2-1
set_color bryellow --bold
echo -n '>'
set_color brred --bold
echo -n '+'
set_color brcyan --bold
@toshi75
toshi75 / PS1.sh
Last active April 6, 2022 02:48
prompt for bash [user,day,time,PID,diskspace]
#== PS1 ==========================================
function _SHOW_DIR (){
echo "$(pwd)"|sed -e "s|\/home\/$USER|\$HOME|g" \
-e 's|~|\$HOME|g'
}
function _DOW (){
#Day of Week
case $(date '+%w') in
0) DayOfWeek="\e[1;31mSun\e[1;36m" ;;
@toshi75
toshi75 / disable_gnome-tracker.sh
Created May 21, 2019 16:56
disable_gnome-tracker
#!/usr/bin/env bash
# https://gist.github.com/jamieparfet/0479c938495f88d1b75b30aff318f735
tracker daemon -k
cd ~/.config/autostart
cp -v /etc/xdg/autostart/tracker-* ./
for i in $(ls tracker-*.desktop) ;do
echo "Hidden=true" >> "$i"
@toshi75
toshi75 / splitttc.pl
Created May 21, 2019 16:27
ttc2ttf script from web
#!/usr/bin/perl
# SplitTTC for spliting TTC file.
# by Nob-rin,2009
# 2009-10-20
# http://biokids.org/?Happy%20Scripting%2FTTC%A5%D5%A5%A1%A5%A4%A5%EB%A4%F2%CA%AC%B2%F2%A4%B9%A4%EB
# Usage
# perl splitttc.pl "font_to_split.ttc"
use strict;
@toshi75
toshi75 / PKGBUILD
Last active January 29, 2019 09:49
"df" like script
# Maintainer: toshi75
pkgname=disk
pkgver=20190129
pkgrel=1
pkgdesc='"df" like script'
arch=('any')
url="https://gist.github.com/toshi75"
license=('GPL3')
conflicts=('disk')
@toshi75
toshi75 / caps on xfce
Last active July 16, 2020 23:00
caps on xfce
1.[設定]-[設定マネージャ]を開く
2.[セッションと起動]の[自動開始アプリケーション]タブを選択
3.[追加]ボタンをクリックし、『アプリケーションの追加』ダイアログを開く
man setxkbmap
man xkeyboard-config |gedit -
Caps Lock is also a Ctrl
/usr/bin/setxkbmap -option "caps:ctrl_modifier"