Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
入力されたテキストで投稿ボックスを埋めるmikutterプラグイン
# -*- coding: utf-8 -*-
Plugin.create :fill_postbox do
command(:fill_postbox,
name: '投稿ボックスを埋める',
condition: lambda{ |opt| true },
visible: true,
role: :postbox) do |opt|
str = Plugin.create(:gtk).widgetof(opt.widget).widget_post.buffer.text
if str.size > 0
result = ""
result += str while result.size < 140
Plugin.create(:gtk).widgetof(opt.widget).widget_post.buffer.text = result[0..139]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.