mirror of https://github.com/k0kubun/xremap
Rename xkremap to xremap
parent
ea34e7504e
commit
6e8e1f2128
@ -1,2 +1,2 @@
|
||||
/xkremap
|
||||
/xremap
|
||||
/mruby
|
||||
|
@ -1,26 +1,26 @@
|
||||
current_dir := $(shell pwd)
|
||||
CSRCS := $(wildcard tools/xkremap/*.[ch])
|
||||
MRBSRCS := $(wildcard mrblib/xkremap/*.rb)
|
||||
CSRCS := $(wildcard tools/xremap/*.[ch])
|
||||
MRBSRCS := $(wildcard mrblib/xremap/*.rb)
|
||||
MRBCSRCS := $(wildcard src/*.[ch])
|
||||
# Using master to apply https://github.com/mruby/mruby/pull/3192
|
||||
REVISION=0ff3ae1fbaed62010c54c43235e29cdc85da2f78
|
||||
DESTDIR := /usr/local/bin
|
||||
.PHONY: all clean install
|
||||
|
||||
all: xkremap
|
||||
all: xremap
|
||||
|
||||
clean:
|
||||
rm -rf mruby/build/host
|
||||
|
||||
install: xkremap
|
||||
mv xkremap $(DESTDIR)/xkremap
|
||||
install: xremap
|
||||
mv xremap $(DESTDIR)/xremap
|
||||
|
||||
xkremap: mruby/build/host/bin/xkremap
|
||||
cp mruby/build/host/bin/xkremap xkremap
|
||||
xremap: mruby/build/host/bin/xremap
|
||||
cp mruby/build/host/bin/xremap xremap
|
||||
|
||||
mruby:
|
||||
git clone https://github.com/mruby/mruby
|
||||
git -C mruby reset --hard $(REVISION)
|
||||
|
||||
mruby/build/host/bin/xkremap: mruby build_config.rb $(CSRCS) $(MRBSRCS) $(MRBCSRCS)
|
||||
mruby/build/host/bin/xremap: mruby build_config.rb $(CSRCS) $(MRBSRCS) $(MRBCSRCS)
|
||||
cd mruby && MRUBY_CONFIG="$(current_dir)/build_config.rb" make
|
||||
|
@ -1,15 +0,0 @@
|
||||
# 1. Copy this to ~/.config/systemd/user/xkremap.service
|
||||
# 2. systemctl --user enable xkremap
|
||||
|
||||
[Unit]
|
||||
Description=xkremap
|
||||
|
||||
[Service]
|
||||
KillMode=process
|
||||
ExecStart=/usr/bin/xkremap /home/k0kubun/.xkremap
|
||||
ExecStop=/usr/bin/killall xkremap
|
||||
Restart=always
|
||||
Environment=DISPLAY=:0.0
|
||||
|
||||
[Install]
|
||||
WantedBy=graphical.target
|
@ -0,0 +1,15 @@
|
||||
# 1. Copy this to ~/.config/systemd/user/xremap.service
|
||||
# 2. systemctl --user enable xremap
|
||||
|
||||
[Unit]
|
||||
Description=xremap
|
||||
|
||||
[Service]
|
||||
KillMode=process
|
||||
ExecStart=/usr/bin/xremap /home/k0kubun/.xremap
|
||||
ExecStop=/usr/bin/killall xremap
|
||||
Restart=always
|
||||
Environment=DISPLAY=:0.0
|
||||
|
||||
[Install]
|
||||
WantedBy=graphical.target
|
@ -1,9 +1,9 @@
|
||||
module Xkremap
|
||||
module Xremap
|
||||
class ActiveWindow
|
||||
# @param [Fixnum] current_window
|
||||
attr_reader :current_window
|
||||
|
||||
# @param [Xkremap::Display] display
|
||||
# @param [Xremap::Display] display
|
||||
def initialize(display)
|
||||
@display = display
|
||||
@current_window = fetch_active_window
|
@ -1,4 +1,4 @@
|
||||
module Xkremap
|
||||
module Xremap
|
||||
class Config
|
||||
# FIXME: :to_keys should be :to_actions, and Key and Execute should be adapted.
|
||||
Remap = Struct.new(:from_key, :to_keys)
|
@ -1,6 +1,6 @@
|
||||
module Xkremap
|
||||
module Xremap
|
||||
class ConfigDSL
|
||||
# @param [Xkremap::Config] config
|
||||
# @param [Xremap::Config] config
|
||||
def initialize(config, win = Config::AnyWindow)
|
||||
@config = config
|
||||
@window = win
|
@ -1,7 +1,7 @@
|
||||
module Xkremap
|
||||
module Xremap
|
||||
class EventHandler
|
||||
# @param [Xkremap::Config] config
|
||||
# @param [Xkremap::Display] display
|
||||
# @param [Xremap::Config] config
|
||||
# @param [Xremap::Display] display
|
||||
def initialize(config, display)
|
||||
@active_window = ActiveWindow.new(display)
|
||||
@grab_manager = GrabManager.new(config, display)
|
@ -1,7 +1,7 @@
|
||||
module Xkremap
|
||||
module Xremap
|
||||
class GrabManager
|
||||
# @param [Xkremap::Config] config
|
||||
# @param [Xkremap::Display] display
|
||||
# @param [Xremap::Config] config
|
||||
# @param [Xremap::Display] display
|
||||
def initialize(config, display)
|
||||
@config = config
|
||||
@display = display
|
@ -1,8 +1,8 @@
|
||||
module Xkremap
|
||||
module Xremap
|
||||
module KeyExpression
|
||||
class << self
|
||||
# @param [String] exp
|
||||
# @return [Xkremap::Config::Key] key
|
||||
# @return [Xremap::Config::Key] key
|
||||
def compile(exp)
|
||||
keyexp, modifiers = split_into_key_and_mods(exp)
|
||||
Config::Key.new(to_keysym(keyexp), modifier_mask(modifiers))
|
@ -1,4 +1,4 @@
|
||||
module Xkremap
|
||||
module Xremap
|
||||
class KeyRemapCompiler
|
||||
def initialize(config, display)
|
||||
@config = config
|
@ -1,21 +0,0 @@
|
||||
#include "mruby.h"
|
||||
|
||||
extern void mrb_xkremap_xlib_wrapper_init(mrb_state *mrb, struct RClass *mXkremap);
|
||||
extern void mrb_xkremap_display_init(mrb_state *mrb, struct RClass *mXkremap);
|
||||
extern void mrb_xkremap_x11_constants_init(mrb_state *mrb, struct RClass *mXkremap);
|
||||
|
||||
void
|
||||
mrb_xkremap_gem_init(mrb_state *mrb)
|
||||
{
|
||||
struct RClass *mXkremap = mrb_define_module(mrb, "Xkremap");
|
||||
|
||||
mrb_xkremap_xlib_wrapper_init(mrb, mXkremap);
|
||||
mrb_xkremap_display_init(mrb, mXkremap);
|
||||
mrb_xkremap_x11_constants_init(mrb, mXkremap);
|
||||
mrb_gc_arena_restore(mrb, 0);
|
||||
}
|
||||
|
||||
void
|
||||
mrb_xkremap_gem_final(mrb_state *mrb)
|
||||
{
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
#include "mruby.h"
|
||||
|
||||
extern void mrb_xremap_xlib_wrapper_init(mrb_state *mrb, struct RClass *mXremap);
|
||||
extern void mrb_xremap_display_init(mrb_state *mrb, struct RClass *mXremap);
|
||||
extern void mrb_xremap_x11_constants_init(mrb_state *mrb, struct RClass *mXremap);
|
||||
|
||||
void
|
||||
mrb_xremap_gem_init(mrb_state *mrb)
|
||||
{
|
||||
struct RClass *mXremap = mrb_define_module(mrb, "Xremap");
|
||||
|
||||
mrb_xremap_xlib_wrapper_init(mrb, mXremap);
|
||||
mrb_xremap_display_init(mrb, mXremap);
|
||||
mrb_xremap_x11_constants_init(mrb, mXremap);
|
||||
mrb_gc_arena_restore(mrb, 0);
|
||||
}
|
||||
|
||||
void
|
||||
mrb_xremap_gem_final(mrb_state *mrb)
|
||||
{
|
||||
}
|
Loading…
Reference in New Issue