Skip to content

Instantly share code, notes, and snippets.

@firstspring1845
Last active August 29, 2015 14:05
Show Gist options
  • Save firstspring1845/f08128e18dda92da355e to your computer and use it in GitHub Desktop.
Save firstspring1845/f08128e18dda92da355e to your computer and use it in GitHub Desktop.
mikutterで名前変えるやつ
# -*- coding: utf-8 -*-
Plugin.create :change_name do
command(:change_name,
name: '名前変更',
condition: lambda{|opt|true},
visible: false,
role: :window) do |opt|
d = Gtk::Dialog.new('名前変更')
l = Gtk::Label.new('名前を入れてEnter押してね')
e = Gtk::Entry.new
e.signal_connect('activate') do |w, r|
(Service.primary.twitter/:account/:update_profile).json(:name => w.text).next do |u|
activity :system, "名前を#{u[:name]}に変更しました"
end
d.destroy
end
d.vbox.pack_start(l, true, true, 0)
d.vbox.pack_start(e, true, true, 0)
d.show_all
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment