Wednesday, October 21, 2015

Switch keyboard layouts

Alternative to panel tray plugins:
  1.  with a search/launch application like Synapse, Dash, etc
  2. as launchers in a dock or panel 

1. Use Synapse and similar.

The idea is to use the `setxkbmap` command, thus:

setxkbmap us

setxkbmap us intl

setxkbmap fr

setxkbmap ro std_cedilla

And put such commands in desktop files like:

[Desktop Entry]
Name=Keyboard US International dead Keys
Exec=setxkbmap us intl
Icon=path/to/some/icon/file
Terminal=false
Type=Application
Categories=Application;Utility;

Copying these file.desktop files in /usr/share/applications should make them searchable with launchers like Synapse, Unity Dash, Whisker Menu etc.

2. As launchers.

After creating desktop files as above they can be added (as for any other application) to a panel or dock as launchers.

If put all in a folder they can be stacked together in Plank dock.





MPV: my ~/.config/mpv/input.conf file

# 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
#
# Use 'ignore' to unbind a key fully (e.g. 'ctrl+a ignore').
#
# Strings need to be quoted and escaped:
#   KEY show-text "This is a single backslash: \\ and a quote: \" !"
#
# You can use modifier-key combinations like Shift+Left or Ctrl+Alt+x with
# the modifiers Shift, Ctrl, Alt and Meta (may not work on the terminal).
#
# The default keybindings are hardcoded into the mpv binary.
# You can disable them completely with: --no-input-default-bindings

# Developer note:
# On compilation, this file is baked into the mpv binary, and all lines are
# uncommented (unless '#' is followed by a space) - thus this file defines the
# default key bindings.

# If this is enabled, treat all the following bindings as default.
#default-bindings start

#MOUSE_BTN0 ignore                      # don't do anything
#MOUSE_BTN0_DBL cycle fullscreen        # toggle fullscreen on/off
#MOUSE_BTN2 cycle pause                 # toggle pause on/off
#MOUSE_BTN3 seek 10
#MOUSE_BTN4 seek -10
#MOUSE_BTN5 add volume -2
#MOUSE_BTN6 add volume 2

# Mouse wheels, touchpad or other input devices that have axes
# if the input devices supports precise scrolling it will also scale the
# numeric value accordingly
#AXIS_UP    seek 10
#AXIS_DOWN  seek -10
#AXIS_LEFT  seek 5
#AXIS_RIGHT seek -5

## Seek units are in seconds, but note that these are limited by keyframes
#RIGHT seek  5
#LEFT  seek -5
#UP    seek  60
#DOWN  seek -60
# Do smaller, always exact (non-keyframe-limited), seeks with shift.
# Don't show them on the OSD (no-osd).
#Shift+RIGHT no-osd seek  1 exact
#Shift+LEFT  no-osd seek -1 exact
#Shift+UP    no-osd seek  5 exact
#Shift+DOWN  no-osd seek -5 exact
# Skip to previous/next subtitle (subject to some restrictions; see manpage)
#Ctrl+LEFT   no-osd sub-seek -1
#Ctrl+RIGHT  no-osd sub-seek  1
#PGUP add chapter 1                     # skip to next chapter
#PGDWN add chapter -1                   # skip to previous chapter
#Shift+PGUP seek 600
#Shift+PGDWN seek -600
#[ multiply speed 0.9091                # scale playback speed
#] multiply speed 1.1
#{ multiply speed 0.5
#} multiply speed 2.0
#BS set speed 1.0                       # reset speed to normal
#q quit
#Q quit-watch-later
#q {encode} quit 4
#ESC set fullscreen no
#ESC {encode} quit 4
#p cycle pause                          # toggle pause/playback mode
#. frame-step                           # advance one frame and pause
#, frame-back-step                      # go back by one frame and pause
#SPACE cycle pause
#> playlist-next                        # skip to next file
#ENTER playlist-next                    # skip to next file
#< playlist-prev                        # skip to previous file
#O no-osd cycle_values osd-level 3 1    # cycle through OSD mode
#o show-progress
#P show-progress
#I show-text "${filename}"              # display filename in osd
#z add sub-delay -0.1                   # subtract 100 ms delay from subs
#x add sub-delay +0.1                   # add
#ctrl++ add audio-delay 0.100           # this changes audio/video sync
#ctrl+- add audio-delay -0.100
#9 add volume -2
#/ add volume -2
#0 add volume 2
#* add volume 2
#m cycle mute
#1 add contrast -1
#2 add contrast 1
#3 add brightness -1
#4 add brightness 1
#5 add gamma -1
#6 add gamma 1
#7 add saturation -1
#8 add saturation 1
# toggle deinterlacer (automatically inserts or removes required filter)
#d cycle deinterlace
#r add sub-pos -1                       # move subtitles up
#t add sub-pos +1                       #                down
#v cycle sub-visibility
# stretch SSA/ASS subtitles with anamorphic videos to match historical
#V cycle ass-vsfilter-aspect-compat
# switch between applying no style overrides to SSA/ASS subtitles, and
# overriding them almost completely with the normal subtitle style
#u cycle-values ass-style-override "force" "no"
#j cycle sub                            # cycle through subtitles
#J cycle sub down                       # ...backwards
#Ctrl+A cycle audio                      # switch audio streams
#_ cycle video
#T cycle ontop                          # toggle video window ontop of other windows
#f cycle fullscreen                     # toggle fullscreen
#s screenshot                           # take a screenshot
#S screenshot video                     # ...without subtitles
#Ctrl+s screenshot window               # ...with subtitles and OSD, and scaled
#Alt+s screenshot each-frame            # automatically screenshot every frame
#w add panscan -0.1                     # zoom out with -panscan 0 -fs
#e add panscan +0.1                     #      in
#cycle video aspect ratios; "-1" is the container aspect
#A cycle-values video-aspect "16:9" "4:3" "2.35:1" "-1"
#POWER quit
#PLAY cycle pause
#PAUSE cycle pause
#PLAYPAUSE cycle pause
#STOP quit
#FORWARD seek 60
#REWIND seek -60
#NEXT playlist-next
#PREV playlist-prev
#VOLUME_UP add volume 2
#VOLUME_DOWN add volume -2
#MUTE cycle mute
#CLOSE_WIN quit
#CLOSE_WIN {encode} quit 4
#E cycle edition                        # next edition
#l ab_loop                              # Set/clear A-B loop points
#L cycle-values loop "inf" "no"         # toggle infinite looping
#ctrl+c quit 4

# Apple Remote section
#AR_PLAY cycle pause
#AR_PLAY_HOLD quit
#AR_CENTER cycle pause
#AR_CENTER_HOLD quit
#AR_NEXT seek 10
#AR_NEXT_HOLD seek 120
#AR_PREV seek -10
#AR_PREV_HOLD seek -120
#AR_MENU show-progress
#AR_MENU_HOLD cycle mute
#AR_VUP add volume 2
#AR_VUP_HOLD add chapter 1
#AR_VDOWN add volume -2
#AR_VDOWN_HOLD add chapter -1

# For tv://
#h cycle tv-channel -1                  # previous channel
#k cycle tv-channel +1                  # next channel

#
# Legacy bindings (may or may not be removed in the future)
#
#! add chapter -1                       # skip to previous chapter
#@ add chapter 1                        #         next

#
# Not assigned by default
# (not an exhaustive list of unbound commands)
#

# ? add sub-scale +0.1                  # increase subtitle font size
# ? add sub-scale -0.1                  # decrease subtitle font size
# ? sub-step -1                         # immediately display next subtitle
# ? sub-step +1                         #                     previous
# ? cycle-values window-scale 0.5 2 1   # switch between 1/2, 2x, unresized window size
# ? cycle colormatrix
# ? add audio-delay 0.100               # this changes audio/video sync
# ? add audio-delay -0.100
# ? cycle angle                         # switch DVD/Bluray angle
# ? add balance -0.1                    # adjust audio balance in favor of left
# ? add balance 0.1                     #                                  right
# ? cycle sub-forced-only               # toggle DVD forced subs
# ? cycle program                       # cycle transport stream programs
# ? stop                                # stop playback (quit or enter idle mode)

#CIPRICUS#
Alt+a cycle-values video-aspect "16:9" "4:3" "2.35:1" "-1"
Ctrl+a cycle audio                      # switch audio streams
Ctrl+f cycle fullscreen        # toggle fullscreen on/off
Ctrl+s cycle sub                            # cycle through subtitles
Meta+UP add sub-pos -1                       # move subtitles up
Meta+DOWN add sub-pos +1                       #                down
Meta+Alt+s cycle sub-visibility
MOUSE_BTN0 ignore                      # don't do anything
MOUSE_BTN0_DBL cycle fullscreen        # toggle fullscreen on/off
MOUSE_BTN2 cycle pause                 # toggle pause on/off
MOUSE_BTN3 add volume 2
MOUSE_BTN4 add volume -2
#MOUSE_BTN5 add volume -2
#MOUSE_BTN6 add volume 2
MOUSE_BTN1 cycle-values video-aspect "16:9" "4:3" "2.35:1" "-1"
Ctrl+RIGHT seek  60
Ctrl+LEFT  seek -60
UP    add volume 2
DOWN  add volume -2

Fluxbox: my ~/.fluxbox/keys file

 #Mod1    == Alt
 #Mod4    == Windows key
 #Control == Ctrl
 #Shift   == Shift

#--------------

# launch applications
Mod4 F1 :Exec pcmanfm
Mod4 F2 :Exec palemoon
Mod4 F3 :Exec pcmanfm
Shift Mod4 F3 :Exec gksu pcmanfm
Mod4 t :Exec lxterminal
Mod1 x :Exec gnome-terminal
Mod4 x :Exec oblogout
XF86HomePage :Exec firefox
Mod4 p :Exec lxrandr
Mod4 z :Exec libreoffice --writer
Shift x :Exec lxtask
Ctrl Shift p :Exec bash -c 'xfce4-screenshooter -r'
#0xff61 :Exec bash -c 'xfce4-screenshooter -r'
Mod4 s :Exec synapse
Mod4 m :Exec /usr/share/applications/mousepad.desktop
Ctrl Mod1 r :Exec setxkbmap ro std_cedilla
Ctrl 2 :Exec xrandr --output VGA1 --mode 1360x768 --rate 60.02 --right-of LVDS1 --output LVDS1 --mode 1600x900
Ctrl 1 :Exec xrandr --output VGA1 --mode 1360x768 --same-as LVDS1 --output LVDS1 --off
Ctrl 3 :Exec xrandr --output VGA1 --off --output LVDS1 --mode 1600x900 --rate 60.08
Mod1 t :Exec xinput set-prop 16 "Device Enabled" 1
Ctrl t :Exec xinput set-prop 16 "Device Enabled" 0
Ctrl Esc :Exec oblogout
#------------------

# click on the desktop to get menus
OnDesktop Mouse1 :HideMenus
OnDesktop Mouse2 :WorkspaceMenu
OnDesktop Mouse3 :RootMenu

# scroll on the desktop to change workspaces
OnDesktop Mouse4 :PrevWorkspace
OnDesktop Mouse5 :NextWorkspace

# scroll on the toolbar to change current window
OnToolbar Mouse4 :PrevWindow {static groups} (iconhidden=no)
OnToolbar Mouse5 :NextWindow {static groups} (iconhidden=no)

# alt + left/right click to move/resize a window
OnWindow Mod1 Mouse1 :MacroCmd {Raise} {Focus} {StartMoving}
OnWindowBorder Move1 :StartMoving


OnWindow Mod1 Mouse3 :MacroCmd {Raise} {Focus} {StartResizing NearestCorner}
OnLeftGrip Move1 :StartResizing bottomleft
OnRightGrip Move1 :StartResizing bottomright

# alt + middle click to lower the window
OnWindow Mod1 Mouse2 :Lower

# control-click a window's titlebar and drag to attach windows
OnTitlebar Control Mouse1 :StartTabbing

# double click on the titlebar to shade
OnTitlebar Double Mouse1 :Maximize

# left click on the titlebar to move the window
OnTitlebar Mouse1 :MacroCmd {Raise} {Focus} {ActivateTab}
OnTitlebar Move1  :StartMoving

#---THIS IS MINE!!!!!#################
# scroll on a window's titlebar to shade
OnTitlebar Mouse4 :Shade
OnTitlebar Mouse5 :Shade

# middle click on the titlebar to lower
OnTitlebar Mouse2 :Close

# right click on the titlebar for a menu of options
OnTitlebar Mouse3 :Minimize
OnTitlebar Mouse3 Shift :WindowMenu

# alt-tab
Mod1 Tab :NextWindow {groups} (workspace=[current])
Mod1 Shift Tab :PrevWindow {groups} (workspace=[current])

# cycle through tabs in the current window
Mod4 Tab :NextTab
Mod4 Shift Tab :PrevTab

# go to a specific tab in the current window
Mod4 1 :Tab 1
Mod4 2 :Tab 2
Mod4 3 :Tab 3
Mod4 4 :Tab 4
Mod4 5 :Tab 5
Mod4 6 :Tab 6
Mod4 7 :Tab 7
Mod4 8 :Tab 8
Mod4 9 :Tab 9

# open a terminal
Mod1 F1 :Exec lxterminal

# open a dialog to run programs
Mod1 F2 :Exec fbrun -font monospace-14

# open dmenu
#Mod4 space :Exec dmenu_extended_run
Mod4 space :Exec dmenu_recency
#Mod4 space :dmenu_regency -b -fn 'Monospace 12'

# volume settings, using common keycodes
# if these don't work, use xev to find out your real keycodes
176 :Exec amixer sset Master,0 1+
174 :Exec amixer sset Master,0 1-
160 :Exec amixer sset Master,0 toggle

# current window commands
Mod1 F4 :Close
Mod1 F5 :Kill
Mod1 F9 :Minimize
Mod1 F10 :Maximize
Mod1 F11 :Fullscreen

# open the window menu
Mod1 space :WindowMenu

# exit fluxbox
Control Mod1 Delete :Exit

# change to previous/next workspace
Control Mod1 Left :PrevWorkspace
Control Mod1 Right :NextWorkspace

# send the current window to previous/next workspace
Mod4 Left :SendToPrevWorkspace
Mod4 Right :SendToNextWorkspace

# send the current window and follow it to previous/next workspace
Control Mod4 Left :TakeToPrevWorkspace
Control Mod4 Right :TakeToNextWorkspace

# change to a specific workspace
Control F1 :Workspace 1
Control F2 :Workspace 2
Control F3 :Workspace 3
Control F4 :Workspace 4
Control F5 :Workspace 5
Control F6 :Workspace 6
Control F7 :Workspace 7
Control F8 :Workspace 8
Control F9 :Workspace 9
Control F10 :Workspace 10
Control F11 :Workspace 11
Control F12 :Workspace 12

# send the current window to a specific workspace
Mod4 F1 :SendToWorkspace 1
Mod4 F2 :SendToWorkspace 2
Mod4 F3 :SendToWorkspace 3
Mod4 F4 :SendToWorkspace 4
Mod4 F5 :SendToWorkspace 5
Mod4 F6 :SendToWorkspace 6
Mod4 F7 :SendToWorkspace 7
Mod4 F8 :SendToWorkspace 8
Mod4 F9 :SendToWorkspace 9
Mod4 F10 :SendToWorkspace 10
Mod4 F11 :SendToWorkspace 11
Mod4 F12 :SendToWorkspace 12

# send the current window and change to a specific workspace
Control Mod4 F1 :TakeToWorkspace 1
Control Mod4 F2 :TakeToWorkspace 2
Control Mod4 F3 :TakeToWorkspace 3
Control Mod4 F4 :TakeToWorkspace 4
Control Mod4 F5 :TakeToWorkspace 5
Control Mod4 F6 :TakeToWorkspace 6
Control Mod4 F7 :TakeToWorkspace 7
Control Mod4 F8 :TakeToWorkspace 8
Control Mod4 F9 :TakeToWorkspace 9
Control Mod4 F10 :TakeToWorkspace 10
Control Mod4 F11 :TakeToWorkspace 11
Control Mod4 F12 :TakeToWorkspace 12

Manjaro Fluxbox: installing printer Canon Pixma MG2450

If you enable AUR you can identify them in Pamac. Search canon and mg2400.

Also with yaourt using terminal.



They are:

cnijfilter-common-mg2400 - https://aur.archlinux.org/packages/cnijfilter-common-mg2400 and cnijfilter-mg2400series - https://aur.archlinux.org/packages/cnijfilter-mg2400series

Be sure that gutenprint is also installed.

sudo pacman -S gutenprint

Maybe instead of gutenprint or along with it foomatic-db-engine  is also needed.

For the integrated scanner the driver is scangearmp-common (a common package).

The printer needs to be manually added.

Monday, October 12, 2015

Install from source

Never succeeded just yet, but the idea is:

Usually compiling involves nothing but execute a couple of commands. Try entering the directory, execute ./configure if no errors appear then execute make and if no errors appear then finally execute make install. If any of the previous steps go wrong then keep looking for the binaries, otherwise you have compiled and installed your first program from sources 

 (comment under this answer)

So:


  • enter directory, execute ./configure
  • if no errors appear then execute make
  • if no errors appear then finally execute make install

Friday, October 9, 2015

Set mime types

Generic mime types for categories (that are not standard but work) should be like:
audio/*
video/*
image/*

See and edit your mimetypes asociations and forms in

/usr/share/applications/defaults.list



To get the mime type of a file from the command line use

file --mime-type -b filename


Generic mime types (all files):


application/octet-stream  
application/binary




 


Thursday, October 1, 2015

Install multiple deb files




terminal in folder  
sudo dpkg -i *.deb

The downside is that it installs everything without warning of any incompatibility or broken package.

Process video (or audio) with ffmpeg - trim, cut, join without transcoding.

The general command is

ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}... 

The option -c stands for the "codec" to be used.

 -c copy means the file is not re-coded.

-ss
followed by time  (like  00:03:05.0 ) is the start time: all before that point is removed

-t
followed by time (like 00:03:05.0 ) stands for the duration of output: all after that is removed

 -to serves to specify the end time inside the input (sometimes simpler to use instead of -t)


So:

To keep data after a start point (up to the end):

ffmpeg -i INPUT -c copy -ss START_TIME -map 0 OUTPUT




To keep data between two time points:




ffmpeg -i INPUT -c copy -ss START_TIME -to END_TIME -map 0 OUTPUT


To keep data of a certain duration after a certain point:



ffmpeg -i INPUT -c copy -ss START_TIME -t DURATION_TIME -map 0 OUTPUT


To keep data of a certain duration after beginning:



ffmpeg -i INPUT -c copy -t DURATION_TIME -map 0 OUTPUT




To keep data from beginning up to a time point:

ffmpeg -i INPUT -c copy -to TIME_POINT -map 0 OUTPUT



---

To join mpeg files (including transport files)

 ffmpeg -i "concat:INPUT-1|INPUT-2" -c copy -bsf:a aac_adtstoasc OUTPUT


Or:

create a file called `join.txt` with the content

file 'path-to-INPUT1'
file 'path-to-INPUT2'
file...etc


then

 ffmpeg -f concat -i join.txt OUTPUT